Skip to content

Commit

Permalink
handle case for a component with 0 skipPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvarts committed Oct 29, 2024
1 parent 1e7e760 commit c891f07
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/pkg/githubapi/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,17 @@ func generatePromotionPrBody(ghPrClientDetails GhPrClientDetails, components str
func getPromotionSkipPaths(promotion PromotionInstance) map[string]bool {
perComponentSkippedTargetPaths := promotion.Metadata.PerComponentSkippedTargetPaths
promotionSkipPaths := make(map[string]bool)

// if any promoted component is not in the perComponentSkippedTargetPaths
// then that means we have a component that is promoted to all paths,
// therefore, we return an empty promotionSkipPaths map to signify that
// there are no paths that are skipped for this promotion
for _, component := range promotion.Metadata.ComponentNames {
if _, ok := promotion.Metadata.PerComponentSkippedTargetPaths[component]; !ok {
return promotionSkipPaths
}
}

if perComponentSkippedTargetPaths == nil {
return promotionSkipPaths
}
Expand Down

0 comments on commit c891f07

Please sign in to comment.