Skip to content

TRT-2677: Component readiness: gaReleaseInfo crashes when releases con#3598

Open
openshift-trt-agent[bot] wants to merge 2 commits into
openshift:mainfrom
openshift-trt:trt-2677
Open

TRT-2677: Component readiness: gaReleaseInfo crashes when releases con#3598
openshift-trt-agent[bot] wants to merge 2 commits into
openshift:mainfrom
openshift-trt:trt-2677

Conversation

@openshift-trt-agent

@openshift-trt-agent openshift-trt-agent Bot commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • Adds a null guard to gaReleaseInfo() in CompReadyVars.js that returns safe defaults ('' for releases, () => new Date() for getReleaseDate) when releases.ga_dates, releases.releases, or releases.release_attrs are missing.
  • Prevents a TypeError: Cannot convert undefined or null to object crash when navigating to /component_readiness before the /api/releases fetch completes or after it fails.
  • Follows the same guard pattern already used by findFirstNonGARelease() in helpers.js.

Test plan

  • ESLint passes on the modified file
  • Prettier formatting check passes
  • All 13 component_readiness Jest tests pass
  • Manual: navigate to /component_readiness during local dev startup (before backend is ready) and verify no crash

Fixes: TRT-2677


Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced reliability of release information handling to gracefully manage incomplete or missing data, preventing errors when data is unavailable.

Add null guard for releases.ga_dates, releases.releases, and
releases.release_attrs in gaReleaseInfo(), returning safe defaults
when the ReleasesContext value is incomplete. This prevents a
TypeError when navigating to /component_readiness before the
/api/releases fetch completes or after it fails.

Fixes: TRT-2677

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

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

openshift-ci-robot commented Jun 9, 2026

Copy link
Copy Markdown

@openshift-trt-agent[bot]: This pull request references TRT-2677 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds a null guard to gaReleaseInfo() in CompReadyVars.js that returns safe defaults ('' for releases, () => new Date() for getReleaseDate) when releases.ga_dates, releases.releases, or releases.release_attrs are missing.
  • Prevents a TypeError: Cannot convert undefined or null to object crash when navigating to /component_readiness before the /api/releases fetch completes or after it fails.
  • Follows the same guard pattern already used by findFirstNonGARelease() in helpers.js.

Test plan

  • ESLint passes on the modified file
  • Prettier formatting check passes
  • All 13 component_readiness Jest tests pass
  • Manual: navigate to /component_readiness during local dev startup (before backend is ready) and verify no crash

Fixes: TRT-2677


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 added ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 9, 2026
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Hi @openshift-trt-agent[bot]. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci openshift-ci Bot requested review from deads2k and stbenjam June 9, 2026 14:08
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-trt-agent[bot]
Once this PR has been reviewed and has the lgtm label, please assign deepsm007 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

@smg247

smg247 commented Jun 9, 2026

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: f39c2adb-296b-4feb-8d03-d1ab05203ad7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR adds defensive programming to the gaReleaseInfo function in CompReadyVars.js. The change adds an early return that detects missing or undefined releases data and its required subfields (ga_dates, releases, release_attrs), returning safe default values instead of failing.

Changes

Release Data Fallback Handling

Layer / File(s) Summary
Safe handling of missing release data
sippy-ng/src/component_readiness/CompReadyVars.js
gaReleaseInfo adds an early defensive check that detects absent or undefined releases data and provides default empty release identifiers (defaultBaseRelease, defaultSampleRelease) plus a getReleaseDate fallback function that returns new Date() for any requested release.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 18 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is truncated and incomplete, ending abruptly mid-word with 'con' instead of completing the thought about what condition causes the crash. Complete the title to clearly state the specific condition that causes the crash, e.g., 'TRT-2677: Fix gaReleaseInfo crash when releases data is missing or undefined'.
Test Coverage For New Features ⚠️ Warning Bug fix to gaReleaseInfo null handling lacks regression test; function is not exported and no tests verify null guard behavior when ga_dates/releases/release_attrs are missing. Add tests for gaReleaseInfo covering cases where releases object or its properties (ga_dates, releases, release_attrs) are null/undefined to verify safe defaults are returned.
✅ Passed checks (18 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Go Error Handling ✅ Passed Custom check for Go error handling is not applicable; PR only modifies JavaScript file (CompReadyVars.js), not Go code.
Sql Injection Prevention ✅ Passed The PR modifies a React frontend component. No SQL operations exist in the modified file. The change adds null guards for release data, not SQL query construction.
Excessive Css In React Should Use Styles ✅ Passed PR modifies only data-handling logic in gaReleaseInfo() function with no CSS or styling changes; custom check about inline styles is not applicable.
Single Responsibility And Clear Naming ✅ Passed gaReleaseInfo has clear naming (not generic), single responsibility, minimal parameters, and reasonable return structure. Follows all recommended patterns with no red flags.
Stable And Deterministic Test Names ✅ Passed This check applies to Ginkgo test names in Go files (*_test.go). The PR only modifies JavaScript frontend code (CompReadyVars.js) with no Ginkgo tests, so the check is not applicable.
Test Structure And Quality ✅ Passed The custom check about Ginkgo test code quality is not applicable. This PR modifies CompReadyVars.js (JavaScript/React), not Go test code. Repository uses Jest, not Ginkgo.
Microshift Test Compatibility ✅ Passed This PR adds no Ginkgo e2e tests. It modifies a JavaScript React component (CompReadyVars.js) and adds Go unit tests, neither of which are subject to the MicroShift e2e test compatibility check.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies only a React frontend JavaScript file (CompReadyVars.js) and does not add any Ginkgo e2e tests. The SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies a JavaScript/React component in a monitoring UI, not deployment manifests, operator code, or controllers. No scheduling constraints introduced.
Ote Binary Stdout Contract ✅ Passed PR only modifies JavaScript frontend code (CompReadyVars.js). OTE Binary Stdout Contract check applies to Go test binaries, not React apps. Sippy is not an OTE binary.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR does not add any Ginkgo e2e tests. The only change is to a JavaScript component file (CompReadyVars.js) with a null guard for release data. Check is not applicable.
No-Weak-Crypto ✅ Passed No weak crypto, custom implementations, or non-constant-time comparisons found. PR contains only null guard logic for release data handling.
Container-Privileges ✅ Passed PR modifies only JavaScript application code (CompReadyVars.js), not container/K8s manifests. Custom check for container privileges is not applicable to application code changes.
No-Sensitive-Data-In-Logs ✅ Passed The null guard in gaReleaseInfo() does not log sensitive data. The only console.log is a hardcoded status message with no exposed credentials, tokens, or PII.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Comment on lines +58 to +61
!releases ||
!releases.ga_dates ||
!releases.releases ||
!releases.release_attrs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we extract a variable here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done — extracted a hasReleaseData variable and flipped the condition to if (!hasReleaseData).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smg247

smg247 commented Jun 9, 2026

Copy link
Copy Markdown
Member

/close

@openshift-ci openshift-ci Bot closed this Jun 9, 2026
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@smg247: Closed this PR.

Details

In response to this:

/close

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.

@openshift-trt-agent openshift-trt-agent Bot reopened this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants