Skip to content

OU-1351: prevent namespace and project desync#933

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
PeterYurkovich:ou-1351
May 12, 2026
Merged

OU-1351: prevent namespace and project desync#933
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
PeterYurkovich:ou-1351

Conversation

@PeterYurkovich
Copy link
Copy Markdown
Contributor

@PeterYurkovich PeterYurkovich commented May 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed variable dropdowns in legacy dashboards to properly synchronize values after options are fully loaded, preventing premature or incorrect value syncing.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 12, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 12, 2026

@PeterYurkovich: This pull request references OU-1351 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:

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 jgbernalp and zhuje May 12, 2026 14:06
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 12, 2026

@PeterYurkovich: This pull request references OU-1351 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 either version "5.0." or "openshift-5.0.", but it targets "openshift-4.22" instead.

Details

In response to this:

Summary by CodeRabbit

  • Bug Fixes
  • Fixed variable dropdowns in legacy dashboards to properly synchronize values after options are fully loaded, preventing premature or incorrect value syncing.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Walkthrough

The LegacyDashboardsVariableDropdown component now delays synchronizing variable values with query parameters until dropdown options have loaded, preventing sync operations when options are unavailable.

Changes

Variable Sync Guard Condition

Layer / File(s) Summary
Options-availability guard for variable sync
web/src/components/dashboards/legacy/legacy-variable-dropdowns.tsx
Adds options?.length > 0 check to the variable/query-parameter syncing effect so synchronization only occurs when both the value mismatch condition and options availability are met. Includes explanatory comment for the deferred sync behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is partially related to the changeset but overly broad. The actual change is specifically about preventing a race condition in the namespace variable dropdown by delaying synchronization until options load, not a general namespace/project desync prevention. Consider a more specific title that reflects the technical nature of the fix, such as 'Fix namespace variable dropdown desync by waiting for options to load' or similar, to better describe the implementation detail.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 Custom check not applicable. PR modifies only TypeScript React component, contains no Ginkgo test files. Check applies only to Ginkgo tests, which are absent.
Test Structure And Quality ✅ Passed The PR does not contain Ginkgo test code. The repository uses standard Go testing with testify assertions, not Ginkgo. The custom check is not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests added in this PR. Changes are TypeScript/React UI components and Go backend code using standard testing, not Ginkgo. Check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Changes are limited to a TypeScript React component fix for dashboard variable synchronization. SNO test compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only a React UI component. The topology-aware scheduling check applies to deployment manifests, operator code, and controllers—none present here.
Ote Binary Stdout Contract ✅ Passed OTE Binary Stdout Contract check is not applicable. PR modifies only TypeScript/React component code (legacy-variable-dropdowns.tsx), not Go process-level code or test infrastructure.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests are added. The PR only modifies a TypeScript/React component file. The custom check does not apply to this PR.

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

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

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@web/src/components/dashboards/legacy/legacy-variable-dropdowns.tsx`:
- Around line 269-270: The sync check currently uses options?.length > 0 but can
run while a new options fetch is in flight; update the guard in the
legacy-variable-dropdowns.tsx sync block to also require the options-loading
flag (e.g., !optionsLoading or !isLoadingOptions) before setting variable.value
from queryParam so stale options cannot trigger a write; if there isn't an
existing loading boolean, derive one from the options fetch state or introduce
an optionsLoading state and use it in the condition alongside variable,
queryParam and options to prevent the race.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 8bd22bd5-66c8-4a07-8a94-abef695fb47c

📥 Commits

Reviewing files that changed from the base of the PR and between 3d4bd16 and 5550ccb.

📒 Files selected for processing (1)
  • web/src/components/dashboards/legacy/legacy-variable-dropdowns.tsx

Comment thread web/src/components/dashboards/legacy/legacy-variable-dropdowns.tsx
@zhuje
Copy link
Copy Markdown
Contributor

zhuje commented May 12, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 12, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PeterYurkovich, zhuje

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [PeterYurkovich,zhuje]

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

@PeterYurkovich
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.22

@openshift-cherrypick-robot
Copy link
Copy Markdown

@PeterYurkovich: once the present PR merges, I will cherry-pick it on top of release-4.22 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.22

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.

@etmurasaki
Copy link
Copy Markdown
Contributor

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label May 12, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 0070343 and 2 for PR HEAD 5550ccb in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

@PeterYurkovich: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 73591f7 into openshift:main May 12, 2026
10 checks passed
@openshift-cherrypick-robot
Copy link
Copy Markdown

@PeterYurkovich: new pull request created: #935

Details

In response to this:

/cherry-pick release-4.22

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants