Skip to content

NO-ISSUE: Return self-support when date is before all lifecycle phases#16699

Open
joelanford wants to merge 1 commit into
openshift:mainfrom
joelanford:lifecycle-pre-phase-self-support
Open

NO-ISSUE: Return self-support when date is before all lifecycle phases#16699
joelanford wants to merge 1 commit into
openshift:mainfrom
joelanford:lifecycle-pre-phase-self-support

Conversation

@joelanford

@joelanford joelanford commented Jul 1, 2026

Copy link
Copy Markdown
Member

Analysis / Root cause:
getSupportPhase was returning Active with the first phase when the current date was before all lifecycle phases had started. This was misleading — being outside the supported window (whether before or after all phases) should be treated the same way.

Solution description:
Changed the fallback in getSupportPhase (in operator-lifecycle-status.tsx) to return SelfSupport instead of Active when the current date precedes all phases. Updated the corresponding test case in operator-lifecycle-status.spec.tsx.

Screenshots / screen recording:
N/A — logic-only change. The UI already renders SelfSupport as a "Self-support" badge; this change ensures the badge appears when the date is before all phases (previously it incorrectly showed the first phase name as if it were active).

Test setup:
No special setup required.

Test cases:

  • "returns self-support when date is before all phases" test updated and passing
  • All other existing tests continue to pass

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
N/A

Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted operator lifecycle status fallback: when a date doesn’t match any defined phase, the status now reports self-support (instead of treating the first phase as active).
  • Tests
    • Updated operator lifecycle status tests to verify the new fallback output, including assertions for the returned status and phase set.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 1, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@joelanford: This pull request explicitly references no jira issue.

Details

In response to this:

Analysis / Root cause:
getSupportPhase was returning Active with the first phase when the current date was before all lifecycle phases had started. This was misleading — being outside the supported window (whether before or after all phases) should be treated the same way.

Solution description:
Changed the fallback in getSupportPhase (in operator-lifecycle-status.tsx) to return SelfSupport instead of Active when the current date precedes all phases. Updated the corresponding test case in operator-lifecycle-status.spec.tsx.

Screenshots / screen recording:
N/A — logic-only change. The UI already renders SelfSupport as a "Self-support" badge; this change ensures the badge appears when the date is before all phases (previously it incorrectly showed the first phase name as if it were active).

Test setup:
No special setup required.

Test cases:

  • "returns self-support when date is before all phases" test updated and passing
  • All other existing tests continue to pass

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
N/A

Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from jhadvig and stefanonardo July 1, 2026 18:59
@openshift-ci openshift-ci Bot added the component/olm Related to OLM label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 878184a4-92e8-4304-bd99-c7a09c7557f8

📥 Commits

Reviewing files that changed from the base of the PR and between c83d7c6 and 7238147.

📒 Files selected for processing (2)
  • frontend/packages/operator-lifecycle-manager/src/components/__tests__/operator-lifecycle-status.spec.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/packages/operator-lifecycle-manager/src/components/tests/operator-lifecycle-status.spec.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx

Walkthrough

getSupportPhase now returns SupportPhaseStatus.SelfSupport with allPhases when no lifecycle phase matches. The unit test for dates before all phases is updated to expect the new fallback result.

Changes

Support phase fallback

Layer / File(s) Summary
Fallback return and test update
frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx, frontend/packages/operator-lifecycle-manager/src/components/__tests__/operator-lifecycle-status.spec.tsx
The fallback path in getSupportPhase now returns SupportPhaseStatus.SelfSupport with allPhases, and the matching unit test now asserts that result.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title matches the code change, but it violates the repo requirement to include a Jira issue prefix instead of NO-ISSUE. Prefix the title with a valid Jira key, such as CONSOLE-XXXX: Return self-support when date is before all lifecycle phases.
✅ Passed checks (14 passed)
Check name Status Explanation
Description check ✅ Passed The description is mostly complete and follows the template, with all core sections filled in and only the reviewers/assignees section omitted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The changed Ginkgo/Jest titles are static and descriptive; no titles embed dates, IDs, names, or other run-specific values.
Test Structure And Quality ✅ Passed PASS: The changed test is a pure Jest unit test, not Ginkgo; it covers one behavior, needs no teardown or timeouts, and uses direct assertions against a pure function.
Microshift Test Compatibility ✅ Passed Only a Jest unit test and helper logic changed; no new Ginkgo e2e tests or MicroShift-unsupported APIs/resources were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes a TS helper and its unit test, so SNO multi-node assumptions are not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only pure lifecycle support-phase logic and its test changed; no manifests, controllers, replicas, affinity, selectors, or topology-aware scheduling code was added.
Ote Binary Stdout Contract ✅ Passed Touched files are a React component and test; no console/log/printf/klog/stdout writes or process-level setup were added, so the change stays stdout-safe.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only a pure date-based helper and Jest unit tests changed; no Ginkgo e2e, IPv4 literals, or external connectivity assumptions were added.
No-Weak-Crypto ✅ Passed Changed files only adjust support-phase date fallback and tests; no crypto imports/APIs, weak algorithms, custom crypto, or secret comparisons found.
Container-Privileges ✅ Passed Only frontend TSX/test files changed; no container/K8s manifests or privilege fields were introduced.
No-Sensitive-Data-In-Logs ✅ Passed The changed files add no console/logger calls or sensitive literals; the new support-phase fallback only returns enum values.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx (1)

141-146: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Redundant conditional now that both branches return the same result.

With the fallback changed to SelfSupport, the if (now > parseLocalEndOfDay(lastPhase.endDate)) branch (line 142-144) and the final fallback (line 146) both return the identical { status: SupportPhaseStatus.SelfSupport, allPhases }. The condition can be removed for clarity.

♻️ Proposed simplification
-  const lastPhase = allPhases[allPhases.length - 1];
-  if (now > parseLocalEndOfDay(lastPhase.endDate)) {
-    return { status: SupportPhaseStatus.SelfSupport, allPhases };
-  }
-
   return { status: SupportPhaseStatus.SelfSupport, allPhases };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx`
around lines 141 - 146, The fallback logic in operator-lifecycle-status.tsx is
redundant because the `if` branch and the final return in the status calculation
both return the same `SelfSupport` result. Remove the unnecessary `now >
parseLocalEndOfDay(lastPhase.endDate)` conditional in the function that builds
`{ status, allPhases }`, and keep a single fallback return so the
`SupportPhaseStatus` flow is clearer and easier to maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx`:
- Around line 141-146: The fallback logic in operator-lifecycle-status.tsx is
redundant because the `if` branch and the final return in the status calculation
both return the same `SelfSupport` result. Remove the unnecessary `now >
parseLocalEndOfDay(lastPhase.endDate)` conditional in the function that builds
`{ status, allPhases }`, and keep a single fallback return so the
`SupportPhaseStatus` flow is clearer and easier to maintain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 105764c1-9b79-487c-b075-eb3454d2eec2

📥 Commits

Reviewing files that changed from the base of the PR and between c49aa59 and a1fb1ab.

📒 Files selected for processing (2)
  • frontend/packages/operator-lifecycle-manager/src/components/__tests__/operator-lifecycle-status.spec.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/operator-lifecycle-status.tsx

@joelanford joelanford force-pushed the lifecycle-pre-phase-self-support branch from a1fb1ab to c83d7c6 Compare July 1, 2026 19:50
@joelanford

Copy link
Copy Markdown
Member Author

/test backend

@perdasilva

Copy link
Copy Markdown

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2026
@perdasilva

Copy link
Copy Markdown

Docs Approver:
cc @jseseCCS

PX Approver:
cc @rh-joshbeverly

@rh-joshbeverly

Copy link
Copy Markdown

/label px-approved

@openshift-ci openshift-ci Bot added the px-approved Signifies that Product Support has signed off on this PR label Jul 2, 2026

@jseseCCS jseseCCS left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one lil comment! conditionally approving...

@jseseCCS

jseseCCS commented Jul 2, 2026

Copy link
Copy Markdown

/label docs-approved

@openshift-ci openshift-ci Bot added the docs-approved Signifies that Docs has signed off on this PR label Jul 2, 2026
@perdasilva

Copy link
Copy Markdown

/hold to address docs review comments

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 2, 2026
getSupportPhase was returning Active with the first phase when the
current date preceded all phases. If you're outside the supported
window — whether before or after — the status should be the same:
self-support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@joelanford joelanford force-pushed the lifecycle-pre-phase-self-support branch from c83d7c6 to 7238147 Compare July 2, 2026 14:54
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2026
@perdasilva

Copy link
Copy Markdown

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2026
@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: joelanford, jseseCCS, perdasilva
Once this PR has been reviewed and has the lgtm label, please assign spadgett for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@perdasilva

Copy link
Copy Markdown

/retest

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@joelanford: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console 7238147 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/olm Related to OLM do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants