Skip to content

Update frontend to respect benchmark permissions#2106

Merged
cezudas merged 3 commits intomainfrom
cezudas/OPS-3874
Mar 11, 2026
Merged

Update frontend to respect benchmark permissions#2106
cezudas merged 3 commits intomainfrom
cezudas/OPS-3874

Conversation

@cezudas
Copy link
Contributor

@cezudas cezudas commented Mar 11, 2026

Fixes OPS-3874.

Copilot AI review requested due to automatic review settings March 11, 2026 08:27
@linear
Copy link

linear bot commented Mar 11, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Home benchmark banner logic to also respect per-project benchmark permissions (OPS-3874), ensuring users without access don’t see the banner or trigger benchmark fetches.

Changes:

  • Update useShowBenchmarkBanner to require both the FINOPS_BENCHMARK_ENABLED flag and userMeta.projectPermissions.benchmark.
  • Adjust useBenchmarkBannerState to consume the updated hook return shape.
  • Add unit tests for the new permission-gated banner behavior and update existing banner state tests accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/react-ui/src/app/features/home/components/useShowBenchmarkBanner.ts Gate banner visibility on both the feature flag and benchmark permission; expose pending state.
packages/react-ui/src/app/features/home/components/useShowBenchmarkBanner.test.ts Add coverage for flag/permission combinations and pending behavior.
packages/react-ui/src/app/features/home/components/useBenchmarkBannerState.ts Update to consume useShowBenchmarkBanner()’s new return shape.
packages/react-ui/src/app/features/home/components/useBenchmarkBannerState.test.ts Update mocks/assertions to match the new useShowBenchmarkBanner() API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@sonarqubecloud
Copy link

@cezudas cezudas merged commit f8bf6f7 into main Mar 11, 2026
25 checks passed
@cezudas cezudas deleted the cezudas/OPS-3874 branch March 11, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants