Skip to content

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

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

fix(auth,appstore): eliminate identical conditional branches and add batch query helpers#7024
vjymisal0 wants to merge 1 commit 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

…batch query helpers

Clean up redundant if-else branches in AppStoreApplicationVersionRepository and UserAuthRepository, add batch repository helpers, and add unit test coverage.
@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.

@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

1 participant