Skip to content

OCPBUGS-72592: fix Helm chart created in incorrect namespace - #17040

Closed
platex-rehor-bot wants to merge 1 commit into
openshift:mainfrom
platex-rehor-bot:bot/OCPBUGS-72592
Closed

OCPBUGS-72592: fix Helm chart created in incorrect namespace#17040
platex-rehor-bot wants to merge 1 commit into
openshift:mainfrom
platex-rehor-bot:bot/OCPBUGS-72592

Conversation

@platex-rehor-bot

@platex-rehor-bot platex-rehor-bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Analysis / Root cause:

When the user changes the namespace on the Create Helm Release page (via the project dropdown), handleNamespaceChange navigates to /helm/ns/<new-ns> — stripping the chartURL, indexEntry, and all other query params from the URL. This causes:

  1. The chart context is lost (the page can no longer load the selected chart)
  2. The namespace variable captured at render time via URL params becomes stale
  3. When the user submits the form, the Helm release is created in the original namespace instead of the newly selected one

Root cause analysis by @jhadvig in the Jira ticket.

Solution description:

Preserve location.search (query parameters) when navigating to the new namespace in handleNamespaceChange:

- navigate(`/helm/ns/${ns}`);
+ navigate(`/helm/ns/${ns}${location.search}`);

This ensures that when the namespace changes, the URL retains all query params (chartURL, indexEntry, etc.), the component re-renders with the correct namespace, and the submit handler uses the updated namespace value.

Added unit tests to verify:

  • Query params are preserved when namespace changes
  • No navigation occurs when selecting the same namespace
  • All-namespaces navigation works unchanged

Screenshots / screen recording:

Test setup:
No special setup required. Navigate to Developer > +Add > Helm Chart > select any chart > Create.

Test cases:

  • Select namespace foo, open a Helm chart from catalog, on Create page switch to namespace bar via project dropdown, click Create → chart should be created in bar
  • Create a new namespace from the project dropdown on the Create Helm Release page → chart form should remain functional with the new namespace
  • Switch namespace on the Create page and verify the chart data still loads correctly (query params preserved)

Browser conformance:

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

Additional info:
Fixes OCPBUGS-72592

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Preserved URL query parameters when switching to a specific Helm namespace.
    • Avoided unnecessary navigation when the selected namespace is already active.
    • Removed query parameters when switching to all namespaces.
  • Tests

    • Added coverage for namespace navigation and query-parameter behavior.

Preserve URL query params (chartURL, indexEntry) when changing namespace
on the Create Helm Release page. Previously, handleNamespaceChange
navigated to /helm/ns/<new-ns> without carrying forward location.search,
causing the chart context to be lost and the namespace in the submit
payload to remain stale.

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: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Aug 19, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-72592, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (yapei@redhat.com), skipping review request.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause:

When the user changes the namespace on the Create Helm Release page (via the project dropdown), handleNamespaceChange navigates to /helm/ns/<new-ns> — stripping the chartURL, indexEntry, and all other query params from the URL. This causes:

  1. The chart context is lost (the page can no longer load the selected chart)
  2. The namespace variable captured at render time via URL params becomes stale
  3. When the user submits the form, the Helm release is created in the original namespace instead of the newly selected one

Root cause analysis by @jhadvig in the Jira ticket.

Solution description:

Preserve location.search (query parameters) when navigating to the new namespace in handleNamespaceChange:

- navigate(`/helm/ns/${ns}`);
+ navigate(`/helm/ns/${ns}${location.search}`);

This ensures that when the namespace changes, the URL retains all query params (chartURL, indexEntry, etc.), the component re-renders with the correct namespace, and the submit handler uses the updated namespace value.

Added unit tests to verify:

  • Query params are preserved when namespace changes
  • No navigation occurs when selecting the same namespace
  • All-namespaces navigation works unchanged

Screenshots / screen recording:

Test setup:
No special setup required. Navigate to Developer > +Add > Helm Chart > select any chart > Create.

Test cases:

  • Select namespace foo, open a Helm chart from catalog, on Create page switch to namespace bar via project dropdown, click Create → chart should be created in bar
  • Create a new namespace from the project dropdown on the Create Helm Release page → chart form should remain functional with the new namespace
  • Switch namespace on the Create page and verify the chart data still loads correctly (query params preserved)

Browser conformance:

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

Additional info:
Fixes OCPBUGS-72592

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

@coderabbitai

coderabbitai Bot commented Aug 19, 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: Pro Plus

Run ID: 25fa6fbb-fcd0-4147-9132-3869d5350910

📥 Commits

Reviewing files that changed from the base of the PR and between b242d4f and 8fa83b3.

📒 Files selected for processing (2)
  • frontend/packages/helm-plugin/src/components/forms/install-upgrade/HelmInstallUpgradePage.tsx
  • frontend/packages/helm-plugin/src/components/forms/install-upgrade/__tests__/HelmInstallUpgradePage.spec.tsx

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

Helm install and upgrade namespace navigation now preserves the current URL query string for specific namespaces. Tests verify preserved queries, same-namespace no-op behavior, and query removal for all namespaces.

Changes

Helm namespace navigation

Layer / File(s) Summary
Namespace navigation and validation
frontend/packages/helm-plugin/src/components/forms/install-upgrade/HelmInstallUpgradePage.tsx, frontend/packages/helm-plugin/src/components/forms/install-upgrade/__tests__/HelmInstallUpgradePage.spec.tsx
handleNamespaceChange preserves the current query string for specific namespace routes. Tests cover namespace changes, same-namespace navigation, and all-namespaces navigation without query parameters.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8fa83

This localized fix preserves Helm chart query parameters when changing namespaces and adds focused unit tests; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested labels: component/helm, verified

Suggested reviewers: logonoff, sowmya-sl

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Helm namespace bug fix and includes the required Jira issue key.
Description check ✅ Passed The description covers the root cause, solution, setup, test cases, and relevant issue, with only non-critical review details incomplete.
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 PR adds a Jest/Testing Library suite, not Ginkgo tests. Its describe/it titles are static and contain no generated names, timestamps, namespaces, IPs, or other dynamic values.
Test Structure And Quality ✅ Passed The check targets Ginkgo tests, but this PR changes TSX and adds Jest describe/it tests; no Ginkgo code is changed, so the requirements are inapplicable.
Microshift Test Compatibility ✅ Passed The PR adds a TypeScript Jest unit test, not a Ginkgo e2e test; it references no MicroShift-incompatible OpenShift APIs or unsupported features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added test is a frontend Jest/React unit test, not a Ginkgo e2e test, and it contains no multi-node or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The reported changes are limited to a frontend Helm page and tests; they add URL navigation behavior, not deployment manifests, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The patch changes only two frontend TSX files; it introduces no OTE binary, Go suite setup, or process-level stdout write. The existing console.error line is unchanged.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The added test is a Jest React unit test, not a Ginkgo e2e test; it mocks fetches, uses example.com only as a URL string, and has no IPv4 assumptions or external connectivity.
No-Weak-Crypto ✅ Passed The diff changes only URL navigation and adds Jest mocks/assertions; it introduces no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only Helm UI TypeScript and a Jest test; the diff introduces no container/Kubernetes manifest or privilege setting.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds navigation and tests only. No logging statements were added, and the existing console.error is unchanged from the parent revision.
✨ 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.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-72592, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (yapei@redhat.com), skipping review request.

Details

In response to this:

Analysis / Root cause:

When the user changes the namespace on the Create Helm Release page (via the project dropdown), handleNamespaceChange navigates to /helm/ns/<new-ns> — stripping the chartURL, indexEntry, and all other query params from the URL. This causes:

  1. The chart context is lost (the page can no longer load the selected chart)
  2. The namespace variable captured at render time via URL params becomes stale
  3. When the user submits the form, the Helm release is created in the original namespace instead of the newly selected one

Root cause analysis by @jhadvig in the Jira ticket.

Solution description:

Preserve location.search (query parameters) when navigating to the new namespace in handleNamespaceChange:

- navigate(`/helm/ns/${ns}`);
+ navigate(`/helm/ns/${ns}${location.search}`);

This ensures that when the namespace changes, the URL retains all query params (chartURL, indexEntry, etc.), the component re-renders with the correct namespace, and the submit handler uses the updated namespace value.

Added unit tests to verify:

  • Query params are preserved when namespace changes
  • No navigation occurs when selecting the same namespace
  • All-namespaces navigation works unchanged

Screenshots / screen recording:

Test setup:
No special setup required. Navigate to Developer > +Add > Helm Chart > select any chart > Create.

Test cases:

  • Select namespace foo, open a Helm chart from catalog, on Create page switch to namespace bar via project dropdown, click Create → chart should be created in bar
  • Create a new namespace from the project dropdown on the Create Helm Release page → chart form should remain functional with the new namespace
  • Switch namespace on the Create page and verify the chart data still loads correctly (query params preserved)

Browser conformance:

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

Additional info:
Fixes OCPBUGS-72592

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

  • Preserved URL query parameters when switching to a specific Helm namespace.

  • Avoided unnecessary navigation when the selected namespace is already active.

  • Removed query parameters when switching to all namespaces.

  • Tests

  • Added coverage for namespace navigation and query-parameter behavior.

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 baijum and sowmya-sl August 19, 2026 14:51
@openshift-ci openshift-ci Bot added the component/helm Related to helm-plugin label Aug 19, 2026
@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: platex-rehor-bot
Once this PR has been reviewed and has the lgtm label, please assign baijum 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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 19, 2026
@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Hi @platex-rehor-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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

@platex-rehor-bot
platex-rehor-bot deleted the bot/OCPBUGS-72592 branch August 19, 2026 14:55
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-72592. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

Details

In response to this:

Analysis / Root cause:

When the user changes the namespace on the Create Helm Release page (via the project dropdown), handleNamespaceChange navigates to /helm/ns/<new-ns> — stripping the chartURL, indexEntry, and all other query params from the URL. This causes:

  1. The chart context is lost (the page can no longer load the selected chart)
  2. The namespace variable captured at render time via URL params becomes stale
  3. When the user submits the form, the Helm release is created in the original namespace instead of the newly selected one

Root cause analysis by @jhadvig in the Jira ticket.

Solution description:

Preserve location.search (query parameters) when navigating to the new namespace in handleNamespaceChange:

- navigate(`/helm/ns/${ns}`);
+ navigate(`/helm/ns/${ns}${location.search}`);

This ensures that when the namespace changes, the URL retains all query params (chartURL, indexEntry, etc.), the component re-renders with the correct namespace, and the submit handler uses the updated namespace value.

Added unit tests to verify:

  • Query params are preserved when namespace changes
  • No navigation occurs when selecting the same namespace
  • All-namespaces navigation works unchanged

Screenshots / screen recording:

Test setup:
No special setup required. Navigate to Developer > +Add > Helm Chart > select any chart > Create.

Test cases:

  • Select namespace foo, open a Helm chart from catalog, on Create page switch to namespace bar via project dropdown, click Create → chart should be created in bar
  • Create a new namespace from the project dropdown on the Create Helm Release page → chart form should remain functional with the new namespace
  • Switch namespace on the Create page and verify the chart data still loads correctly (query params preserved)

Browser conformance:

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

Additional info:
Fixes OCPBUGS-72592

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

  • Preserved URL query parameters when switching to a specific Helm namespace.

  • Avoided unnecessary navigation when the selected namespace is already active.

  • Removed query parameters when switching to all namespaces.

  • Tests

  • Added coverage for namespace navigation and query-parameter behavior.

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.

@webbnh

webbnh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

For anyone else coming here late, this PR was apparently superseded by #17041.

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

Labels

component/helm Related to helm-plugin jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants