Skip to content

Commit

Permalink
Do not cancel other actions when errgroup go routine has an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Oct 23, 2023
1 parent 68fc2be commit 575b5c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pkg/webhooks/github/actions/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func InitActions(logger *zap.SugaredLogger, cs clients.ClientMap, config config.
func (w *WebhookActions) ProcessReleaseEvent(ctx context.Context, payload *ghwebhooks.ReleasePayload) {
ctx, cancel := context.WithTimeout(ctx, constants.WebhookHandleTimeout)
defer cancel()
g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)

for _, a := range w.ar {
a := a
Expand Down Expand Up @@ -182,7 +182,7 @@ func (w *WebhookActions) ProcessReleaseEvent(ctx context.Context, payload *ghweb
func (w *WebhookActions) ProcessPullRequestEvent(ctx context.Context, payload *ghwebhooks.PullRequestPayload) {
ctx, cancel := context.WithTimeout(ctx, constants.WebhookHandleTimeout)
defer cancel()
g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)

for _, a := range w.dp {
a := a
Expand Down Expand Up @@ -238,7 +238,7 @@ func (w *WebhookActions) ProcessPullRequestEvent(ctx context.Context, payload *g
func (w *WebhookActions) ProcessPushEvent(ctx context.Context, payload *ghwebhooks.PushPayload) {
ctx, cancel := context.WithTimeout(ctx, constants.WebhookHandleTimeout)
defer cancel()
g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)

for _, a := range w.ar {
a := a
Expand Down Expand Up @@ -291,7 +291,7 @@ func (w *WebhookActions) ProcessPushEvent(ctx context.Context, payload *ghwebhoo
func (w *WebhookActions) ProcessRepositoryEvent(ctx context.Context, payload *ghwebhooks.RepositoryPayload) {
ctx, cancel := context.WithTimeout(ctx, constants.WebhookHandleTimeout)
defer cancel()
g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)

for _, a := range w.rm {
a := a
Expand Down Expand Up @@ -322,7 +322,7 @@ func (w *WebhookActions) ProcessRepositoryEvent(ctx context.Context, payload *gh
func (w *WebhookActions) ProcessIssueCommentEvent(ctx context.Context, payload *ghwebhooks.IssueCommentPayload) {
ctx, cancel := context.WithTimeout(ctx, constants.WebhookHandleTimeout)
defer cancel()
g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)

for _, i := range w.ih {
i := i
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhooks/github/actions/distribute_releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (d *distributeReleases) DistributeRelease(ctx context.Context, p *distribut
}
lock := multilock.New(targetRepos...)

g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)
for targetRepoName, targetRepo := range d.targetRepos {
targetRepoName := targetRepoName
targetRepo := targetRepo
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhooks/gitlab/actions/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func InitActions(logger *zap.SugaredLogger, cs clients.ClientMap, config config.
func (w *WebhookActions) ProcessTagEvent(ctx context.Context, payload *glwebhooks.TagEventPayload) {
ctx, cancel := context.WithTimeout(ctx, constants.WebhookHandleTimeout)
defer cancel()
g, ctx := errgroup.WithContext(ctx)
g, _ := errgroup.WithContext(ctx)

for _, a := range w.ar {
a := a
Expand Down

0 comments on commit 575b5c9

Please sign in to comment.