-
Notifications
You must be signed in to change notification settings - Fork 101
Disable GitLab comments for pipeline start/end events to reduce MR noise #2066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Disable GitLab comments for pipeline start/end events to reduce MR noise #2066
Conversation
## Disabling all comments for Pipelinruns on Gitlab MR | ||
`comment_strategy` allows you to disable the comments on Gitlab MR for a Repository | ||
|
||
```yaml | ||
spec: | ||
gitlab: | ||
comment_strategy: "disable_all" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PuneetPunamiya can you please add details about other options? e.g. on_failure
and update_existing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was thinking to add those options, but didn't add because the support for that as of now was not added
wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PuneetPunamiya are you planning to do that in separate PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I thought of like when we implement the other strategies we can add accordingly
8bf3ea5
to
ef26110
Compare
6c419c2
to
f2a7167
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR disables GitLab comments for pipeline start/end events by introducing a new setting (comment_strategy: disable_all) and updating tests and provider logic accordingly. Key changes include:
- Adding a settings parameter to CRD creation functions and updating relevant tests.
- Updating the GitLab provider and webhook validation logic to support the new comment strategy.
- Documenting the new behavior in the repository guide and configuration files.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/pkg/wait/wait.go | Added a new UpdateRepo function to reset repository settings. |
test/pkg/gitlab/crd.go | Updated CreateCRD signature to accept new settings. |
test/gitlab_push_gitops_command_test.go | Updated CreateCRD calls with an extra settings parameter. |
test/gitlab_merge_request_test.go | Added tests for disabling MR comments and updated CRD calls. |
test/gitlab_incoming_webhook_test.go | Updated CRD call with settings parameter. |
test/gitlab_delete_tag_event_test.go | Updated CRD call with settings parameter. |
pkg/webhook/validation.go | Added validation logic for allowed GitLab comment strategies. |
pkg/reconciler/status_test.go | Minor adjustment (blank line) in status test file. |
pkg/provider/gitlab/gitlab.go | Modified CreateStatus to handle the disable_all comment strategy. |
pkg/apis/pipelinesascode/v1alpha1/types.go | Introduced GitlabSettings in repository spec. |
docs/content/docs/guide/repositorycrd.md | Updated documentation on disabling GitLab MR comments. |
config/300-repositories.yaml | Added GitLab settings schema in repository configuration. |
f2a7167
to
3eb58e9
Compare
/test linters |
/test doc-generation |
The GitLab integration was previously generating a comment on every pipeline start and end filling merge requests with redundant updates Hence this patch introduces a new setting to completely disable comment creation By using `comment_strategy: disable_all`, no comments will be added for either pipeline start or completion Also includes e2e tests to validate the new behavior Signed-off-by: PuneetPunamiya <[email protected]>
edbd538
to
bff67b8
Compare
The GitLab integration was previously generating a comment on every pipeline start and end filling merge requests with redundant updates
Hence this patch introduces a new setting to completely disable comment creation
By using
comment_strategy: disable_all
, no comments will be added for either pipeline start or completionAlso includes e2e tests to validate the new behavior
Changes
Submitter Checklist
📝 Ensure your commit message is clear and informative. Refer to the How to write a git commit message guide. Include the commit message in the PR body rather than linking to an external site (e.g., Jira ticket).
♽ Run make test lint before submitting a PR to avoid unnecessary CI processing. Consider installing pre-commit and running pre-commit install in the repository root for an efficient workflow.
✨ We use linters to maintain clean and consistent code. Run make lint before submitting a PR. Some linters offer a --fix mode, executable with make fix-linters (ensure markdownlint and golangci-lint are installed).
📖 Document any user-facing features or changes in behavior.
🧪 While 100% coverage isn't required, we encourage unit tests for code changes where possible.
🎁 If feasible, add an end-to-end test. See README for details.
If adding a provider feature, fill in the following details:
(update the provider documentation accordingly)