Skip to content

Commit

Permalink
Remove unneeded break/label thing.
Browse files Browse the repository at this point in the history
Just return true when a relevant app is found
  • Loading branch information
Oded-B committed Oct 24, 2024
1 parent ea9ad22 commit b6e9f86
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/pkg/githubapi/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ func (ghPrClientDetails *GhPrClientDetails) getBlameURLPrefix() string {
// - The component is allowed to be synced from a branch(based on Telefonsitka configuration)
// - The relevant app is not new, temporary app that was created just to generate the diff
func shouldSyncBranchCheckBoxBeDisplayed(componentPathList []string, allowSyncfromBranchPathRegex string, diffOfChangedComponents []argocd.DiffResult) bool {
var displaySyncBranchCheckBox bool

outOfLoop:
for _, componentPath := range componentPathList {
// First we check if the component is allowed to be synced from a branch
if !isSyncFromBranchAllowedForThisPath(allowSyncfromBranchPathRegex, componentPath) {
Expand All @@ -122,13 +119,11 @@ outOfLoop:
// We don't support syncing new apps from branches
for _, diffOfChangedComponent := range diffOfChangedComponents {
if diffOfChangedComponent.ComponentPath == componentPath && !diffOfChangedComponent.AppWasTemporarilyCreated {
displaySyncBranchCheckBox = true
break outOfLoop
return true
}
}
}

return displaySyncBranchCheckBox
return false
}

func HandlePREvent(eventPayload *github.PullRequestEvent, ghPrClientDetails GhPrClientDetails, mainGithubClientPair GhClientPair, approverGithubClientPair GhClientPair, ctx context.Context) {
Expand Down

0 comments on commit b6e9f86

Please sign in to comment.