Skip to content

CONSOLE-5140: Hide Builds and ImageStreams nav items when Build capability is disabled#16613

Open
sampadasawant-36 wants to merge 1 commit into
openshift:release-4.20from
sampadasawant-36:CONSOLE-5140-hide-builds-nav-when-capability-disabled
Open

CONSOLE-5140: Hide Builds and ImageStreams nav items when Build capability is disabled#16613
sampadasawant-36 wants to merge 1 commit into
openshift:release-4.20from
sampadasawant-36:CONSOLE-5140-hide-builds-nav-when-capability-disabled

Conversation

@sampadasawant-36

@sampadasawant-36 sampadasawant-36 commented Jun 12, 2026

Copy link
Copy Markdown

Fixes

https://issues.redhat.com/browse/CONSOLE-5140

Analysis / Root cause

On OCP 4.20.x with baselineCapabilitySet: None and Build capability not enabled, the admin perspective Builds nav section remained visible because:

  1. The admin Builds section header (console.navigation/section) was gated only on "required": ["OPENSHIFT"] — always true on any OpenShift cluster regardless of Build capability state.
  2. The ImageStreams nav item inside the Builds section had no flag guard. Since imagestreams.image.openshift.io APIs are always present on OpenShift (independent of the Build capability), ImageStreams always appeared — keeping the section non-empty and visible.

As a result, users on clusters with Build capability disabled see a Builds section in the admin nav containing only ImageStreams, with no BuildConfigs or Builds items (those are already correctly gated by OPENSHIFT_BUILDCONFIG / OPENSHIFT_BUILD flags).

The Developer perspective Builds nav item already has "required": ["OPENSHIFT_BUILDCONFIG"] and does not need to be changed.

Solution Description

  • Added "flags": { "required": ["OPENSHIFT_BUILDCONFIG"] } to the admin imagestreams nav item in console-app/console-extensions.json, so it is hidden when buildconfigs.build.openshift.io is absent.
  • Changed the admin builds section flag from "required": ["OPENSHIFT"] to "required": ["OPENSHIFT_BUILDCONFIG"], so the entire Builds section header is also hidden when Build capability is disabled.

Test setup

  1. Create a cluster with baselineCapabilitySet: None and Build capability not enabled
  2. Verify oc api-resources | grep build shows no buildconfigs.build.openshift.io
  3. Confirm admin Builds section and ImageStreams nav item are hidden
  4. Confirm Developer → Builds nav item is hidden
  5. Enable Build capability, re-verify both items reappear correctly

…ility is disabled

When the Build capability is disabled (baselineCapabilitySet: None), the
builds.build.openshift.io and buildconfigs.build.openshift.io APIs are not
present. However, the admin perspective Builds nav section was still visible
because:

1. The admin "Builds" section header only required the generic OPENSHIFT flag
   (always true on OpenShift), not the Build-specific capability flag.
2. The "ImageStreams" nav item inside the Builds section had no flag guard,
   and imagestreams.image.openshift.io APIs are always present on OpenShift
   regardless of the Build capability state.

Fix:
- Add "flags": { "required": ["OPENSHIFT_BUILDCONFIG"] } to the admin
  ImageStreams nav item so it is hidden when BuildConfig APIs are absent.
- Change the admin Builds section flag from OPENSHIFT to OPENSHIFT_BUILDCONFIG
  so the section header itself is hidden when Build capability is disabled.

The Developer perspective Builds nav item already has the correct flag guard
("required": ["OPENSHIFT_BUILDCONFIG"]) and does not need to be changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 12, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@sampadasawant-36: This pull request references CONSOLE-5140 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 "4.20.z" version, but no target version was set.

Details

In response to this:

Fixes

https://issues.redhat.com/browse/CONSOLE-5140

Analysis / Root cause

On OCP 4.20.x with baselineCapabilitySet: None and Build capability not enabled, the admin perspective Builds nav section remained visible because:

  1. The admin Builds section header (console.navigation/section) was gated only on "required": ["OPENSHIFT"] — always true on any OpenShift cluster regardless of Build capability state.
  2. The ImageStreams nav item inside the Builds section had no flag guard. Since imagestreams.image.openshift.io APIs are always present on OpenShift (independent of the Build capability), ImageStreams always appeared — keeping the section non-empty and visible.

As a result, users on clusters with Build capability disabled see a Builds section in the admin nav containing only ImageStreams, with no BuildConfigs or Builds items (those are already correctly gated by OPENSHIFT_BUILDCONFIG / OPENSHIFT_BUILD flags).

The Developer perspective Builds nav item already has "required": ["OPENSHIFT_BUILDCONFIG"] and does not need to be changed.

Solution Description

  • Added "flags": { "required": ["OPENSHIFT_BUILDCONFIG"] } to the admin imagestreams nav item in console-app/console-extensions.json, so it is hidden when buildconfigs.build.openshift.io is absent.
  • Changed the admin builds section flag from "required": ["OPENSHIFT"] to "required": ["OPENSHIFT_BUILDCONFIG"], so the entire Builds section header is also hidden when Build capability is disabled.

Test setup

  1. Create a cluster with baselineCapabilitySet: None and Build capability not enabled
  2. Verify oc api-resources | grep build shows no buildconfigs.build.openshift.io
  3. Confirm admin Builds section and ImageStreams nav item are hidden
  4. Confirm Developer → Builds nav item is hidden
  5. Enable Build capability, re-verify both items reappear correctly

Made with Cursor

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 Jun 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: cdb345bc-5a7b-4263-8137-37e0f7ed28ac

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

@openshift-ci openshift-ci Bot requested review from TheRealJon and cajieh June 12, 2026 16:27
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jun 12, 2026
@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sampadasawant-36
Once this PR has been reviewed and has the lgtm label, please assign logonoff 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 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hi @sampadasawant-36. 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 added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 12, 2026
@dpateriya

Copy link
Copy Markdown

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 12, 2026
@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@sampadasawant-36: 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 59f14eb 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/core Related to console core functionality jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants