Skip to content

fix(auth): preserve literal group names and simplify role checks - #7025

Open
vjymisal0 wants to merge 14 commits into
devtron-labs:mainfrom
vjymisal0:fix/auth-appstore-redundant-branches-and-queries
Open

vjymisal0 wants to merge 14 commits into
devtron-labs:mainfrom
vjymisal0:fix/auth-appstore-redundant-branches-and-queries

Conversation

@vjymisal0

@vjymisal0 vjymisal0 commented Sep 8, 2026 •

Copy link
Copy Markdown

Summary of Changes

Group names were interpreted as format strings during merging: distinct names such as team%v and team%0v collapse to the same key. Compare names literally so both groups survive, while duplicates remain deduplicated.

Role authorization also returns check results directly, preserving global, team and cluster scopes, branch precedence, chart-group handling and unknown-role denial.

Remove the redundant role-group self-assignment reported by vet.

Validation

  • Production auth package builds; 18 RBAC cases and the literal-group regression pass with all production files in the focused test invocation.
  • A global-authorization bypass fails ten cases; restoring format-string group keys fails the group regression. Vet runs on the corrected production code and tests.
  • gofmt, diff and tracked-source preservation checks pass in Linux validation.
  • Full go test ./pkg/auth/user remains blocked by stale UserFlows_test.go and UserService_test.go APIs. The exact upstream base produces identical compilation diagnostics; this is not a full-package passing result.

@bito-code-review

Copy link
Copy Markdown

Bito Review Skipped - Source Branch Not Found

Bito didn't review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

@vjymisal0

Copy link
Copy Markdown
Author

Removed the unused FilterActiveUserIds helper and its associated unit test in commit 12cb36e.

@vjymisal0

Copy link
Copy Markdown
Author

Thanks for the review. I followed up on those points in commit 12cb36e727564194cf4adea8d0fbb7d4692da209: the unused FilterActiveUserIds helper and its associated test are removed, so the remaining diff is limited to the intended auth/appstore changes.

@vjymisal0

Copy link
Copy Markdown
Author

Pushed the cleanup. The unrelated appstore helper test is gone now, and the unused FilterActiveUserIds helper/test were already removed in the previous update.

@vjymisal0
vjymisal0 force-pushed the fix/auth-appstore-redundant-branches-and-queries branch from 8bf1924 to b5d80e2 Compare September 16, 2026 10:22
@vjymisal0

Copy link
Copy Markdown
Author

Reviewed the latest PR state and the available checks. SonarQube reports a passed quality gate with 0 new issues, 0 accepted issues, and 0 security hotspots. I did not make additional changes because no maintainer action was requested; the Bito review was skipped due to a source-branch lookup issue. A local Go test was not runnable because Go is not installed in this environment.

@vjymisal0

Copy link
Copy Markdown
Author

Thanks for the review @Shivam-nagar23. The unrelated appstore test and unused repository helper/test you flagged have been removed; the current diff is limited to UserCommonService.go and its test. Could you take another look and dismiss the old changes-requested review if the cleanup now addresses your concerns?

Copilot AI balanced review requested due to automatic review settings October 8, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 12:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@vjymisal0

Copy link
Copy Markdown
Author

Hi @Shivam-nagar23, gentle ping on this one. The unused UserRepository helper and its test you flagged are gone, so the diff is now just UserCommonService.go and its test, and SonarQube passes. Could you take another look when you have a moment?

Copilot AI balanced review requested due to automatic review settings November 13, 2026 05:09
@vjymisal0 vjymisal0 changed the title fix(auth,appstore): eliminate redundant query branches and optimize batch role lookups fix(auth): preserve literal group names and simplify role checks Nov 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 05:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings November 30, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Copilot AI balanced review requested due to automatic review settings December 2, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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