Skip to content

fix(auth,appstore): eliminate identical conditional branches and add batch query helpers - #7024

Open
vjymisal0 wants to merge 3 commits into
devtron-labs:mainfrom
vjymisal0:fix/redundant-query-branches-and-auth-lookups
Open

vjymisal0 wants to merge 3 commits into
devtron-labs:mainfrom
vjymisal0:fix/redundant-query-branches-and-auth-lookups

Conversation

@vjymisal0

Copy link
Copy Markdown

PR title

fix(auth,appstore): eliminate identical conditional branches and add batch query helpers

What changed

  • AppStoreApplicationVersionRepository: Removed 4 identical if-then-elseif branches in FindAllWithFilter where each branch executed the exact same query invocation (Fixes All branches of if-then-elseif construction are identical #6030).
  • UserAuthRepository: Removed identical fallback else if branch in GetRoleForOtherEntity (Fixes Both branches of if-then-else are identical #6031).
  • AppStoreRepository: Added FindAppStoresByChartRepoIds batch query helper with empty slice short-circuiting.
  • RoleGroupRepository: Added GetRoleGroupsByIds batch helper for bulk lookup operations.
  • Added unit tests in:
    • pkg/appStore/discover/repository/AppStoreApplicationVersionRepository_test.go
    • pkg/auth/user/repository/UserAuthRepository_test.go

Why

  • Reduces code duplication, eliminates static analysis warnings, and optimizes query execution paths.

Validation

  • Verified unit tests with go test.
  • Validated clean syntax and formatting across all modified packages.

Closes #6030
Closes #6031

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

…batch query helpers

Clean up redundant if-else branches in AppStoreApplicationVersionRepository and UserAuthRepository, add batch repository helpers, and add unit test coverage.
@vjymisal0
vjymisal0 force-pushed the fix/redundant-query-branches-and-auth-lookups branch from 0076c51 to 261b8cd Compare September 21, 2026 06:34
Copilot AI balanced review requested due to automatic review settings October 8, 2026 15:12

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.

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 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.

Both branches of if-then-else are identical All branches of if-then-elseif construction are identical

2 participants