OCPBUGS-71878: Show empty state instead of 403 error for users without projects#16464
Conversation
|
@rhamilto: This pull request references Jira Issue OCPBUGS-71878, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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. |
📝 WalkthroughWalkthroughThis PR adds optional mock mode support across five resource-list and resource-page components. When 🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/cherry-pick release-4.22 release-4.21 release-4.20 |
|
@rhamilto: once the present PR merges, I will cherry-pick it on top of DetailsIn 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 kubernetes-sigs/prow repository. |
|
/test backend |
|
/jira refresh |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-71878, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (yapei@redhat.com), skipping review request. DetailsIn 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. |
|
/retest |
…t projects
Resource list pages that use useK8sWatchResource directly were ignoring
the mock prop passed by withStartGuide when no projects are available.
This caused API calls that returned 403 errors, displayed as "Restricted
access" instead of the expected "No {resource} found" empty state.
Accept and respect the mock prop in PodsPage, PodDisruptionBudgetsPage,
VolumeSnapshotPage, and RoleBindingsPage to skip API calls and forward
mock to ConsoleDataView, which already renders an EmptyBox when mock is
true.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@rhamilto: This pull request references Jira Issue OCPBUGS-71878, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (yapei@redhat.com), skipping review request. DetailsIn 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. |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
QA Verification Evidence
Verification Steps
Step 3: PodDisruptionBudgets (was 403, now empty state) (FIXED)
Step 4: VolumeSnapshots (was 403, now empty state) (FIXED)
Warning This verification was performed by an AI agent. Results may contain false positives or miss Automated QA verification by Claude Code |
|
/verified by claude |
|
@logonoff: This PR has been marked as verified by DetailsIn 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff, rhamilto The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@rhamilto: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
@rhamilto: Jira Issue Verification Checks: Jira Issue OCPBUGS-71878 Jira Issue OCPBUGS-71878 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 DetailsIn 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. |
|
@rhamilto: new pull request created: #16467 DetailsIn 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 kubernetes-sigs/prow repository. |
|
Fix included in release 5.0.0-0.nightly-2026-05-20-101113 |

























































Analysis / Root cause:
Five resource list pages use
useK8sWatchResourcedirectly, bypassing themockprop thatResourceListPage_passes viawithStartGuidewhen a user has no projects (SHOW_OPENSHIFT_START_GUIDEflag). The API calls fire regardless and return 403, whichStatusBoxrenders as "Restricted access / You don't have access to this section due to cluster policy."Affected pages:
PodsPage)PodDisruptionBudgetsPage)VolumeSnapshotPage)RoleBindingsPage)HelmReleaseListviaHelmTabbedPage)Pages using
DefaultPage→ListPage→MultiListPage(Services, Routes, Ingresses, NetworkPolicies, UserDefinedNetworks) already handlemockcorrectly.Solution description:
Accept and respect the
mockprop in each affected page:mock=true— passnulltouseK8sWatchResource(returns[undefined, true, undefined]) or{}touseK8sWatchResourcesto prevent 403 errors.mocktoConsoleDataView— which already renders<EmptyBox label={label} />("No {resource} found") whenmock=true.mock=true— users without projects shouldn't see resource creation actions.For the Helm page,
mockis threaded fromwithStartGuide→PageContents→HelmPage→HelmReleaseListviapageData(used byHorizontalNavto pass props to tab components) and via direct prop to theHelmReleaseListPagefallback path.Screenshots / screen recording:





Test setup:
Log in as a normal user without any projects.
Test cases:
Browser conformance:
Additional info:
OCPBUGS-71878