Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: optimize webhook wording (#11573)

Tianzhou (天舟)3cdfd5cfe087
diff --git a/backend/api/gitops/github.go b/backend/api/gitops/github.go
index eaeb4713d5..43530258d1 100644
--- a/backend/api/gitops/github.go
+++ b/backend/api/gitops/github.go
@@ -23,11 +23,11 @@ func getGitHubPullRequestInfo(ctx context.Context, vcsProvider *store.VCSProvide
return nil, errors.Errorf("failed to unmarshal push event, error %v", err)
}
if pushEvent.Action != closeAction {
- return nil, errors.Errorf("invalid webhook event action, got %s, want closed", pushEvent.Action)
+ return nil, errors.Errorf("skip webhook event action, got %s, want closed", pushEvent.Action)
}
if pushEvent.PullRequest.Base.Ref != vcsConnector.Payload.Branch {
- return nil, errors.Errorf("committed to branch %q, want branch %q", pushEvent.PullRequest.Base.Ref, vcsConnector.Payload.Branch)
+ return nil, errors.Errorf("skip branch, got %q, want %q", pushEvent.PullRequest.Base.Ref, vcsConnector.Payload.Branch)
}
mrFiles, err := vcs.Get(storepb.VCSType_GITHUB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ListPullRequestFile(ctx, vcsConnector.Payload.ExternalId, fmt.Sprintf("%d", pushEvent.Number))
diff --git a/backend/api/gitops/gitlab.go b/backend/api/gitops/gitlab.go
index b8273f6f7c..26f42770db 100644
--- a/backend/api/gitops/gitlab.go
+++ b/backend/api/gitops/gitlab.go
@@ -24,14 +24,14 @@ func getGitLabPullRequestInfo(ctx context.Context, vcsProvider *store.VCSProvide
return nil, errors.Errorf("failed to unmarshal push event, error %v", err)
}
if pushEvent.ObjectKind != mergeRequestObjectKind {
- return nil, errors.Errorf("invalid webhook event type, got %s, want push", pushEvent.ObjectKind)
+ return nil, errors.Errorf("skip webhook event type, got %s, want push", pushEvent.ObjectKind)
}
if pushEvent.ObjectAttributes.Action != mergeAction {
- return nil, errors.Errorf("invalid webhook event action, got %s, want merge", pushEvent.ObjectAttributes.Action)
+ return nil, errors.Errorf("skip webhook event action, got %s, want merge", pushEvent.ObjectAttributes.Action)
}
if pushEvent.ObjectAttributes.TargetBranch != vcsConnector.Payload.Branch {
- return nil, errors.Errorf("committed to branch %q, want branch %q", pushEvent.ObjectAttributes.TargetBranch, vcsConnector.Payload.Branch)
+ return nil, errors.Errorf("skip branch got %q, want %q", pushEvent.ObjectAttributes.TargetBranch, vcsConnector.Payload.Branch)
}
mrFiles, err := vcs.Get(storepb.VCSType_GITLAB, vcs.ProviderConfig{InstanceURL: vcsProvider.InstanceURL, AuthToken: vcsProvider.AccessToken}).ListPullRequestFile(ctx, vcsConnector.Payload.ExternalId, fmt.Sprintf("%d", pushEvent.ObjectAttributes.IID))