-
Notifications
You must be signed in to change notification settings - Fork 114
fix!: Disable PipelineRun status comment in GitLab #2231
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?
fix!: Disable PipelineRun status comment in GitLab #2231
Conversation
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.
Summary of Changes
Hello @zakisk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request enhances the GitLab integration by making PipelineRun status comments conditional. Previously, these comments might have been redundant if the commit status API already provided the necessary feedback. The change ensures that comments are only posted as a last resort, improving the signal-to-noise ratio in GitLab merge requests and providing a cleaner user experience.
Highlights
- GitLab Integration Improvement: PipelineRun status comments in GitLab are now suppressed when the commit status API successfully updates. This makes the comments a fallback mechanism, only appearing if the commit status API fails.
- Documentation Update: The documentation for
repositorycrd.md
has been updated to clarify the behavior ofcomment_strategy
for GitLab, explaining that comments are only added if the commit status API fails.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request enhances the GitLab provider to avoid posting a PipelineRun status comment when the commit status can be updated successfully via the API. This reduces unnecessary notifications on merge requests. The code change in pkg/provider/gitlab/gitlab.go
is straightforward and correct. I've suggested a minor clarification in the documentation to make the new behavior easier to understand.
5b4f21d
to
3554932
Compare
/retest linters |
3554932
to
1071af8
Compare
/retest linters |
1071af8
to
88d4f5d
Compare
/retest linters |
@@ -500,122 +482,6 @@ func TestGitlabIssueGitopsComment(t *testing.T) { | |||
twait.Succeeded(ctx, t, runcnx, opts, sopt) | |||
} | |||
|
|||
func TestGitlabDisableCommentsOnMR(t *testing.T) { |
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.
This test was added to test disable_all
comment setting for GitLab but as we're disabling comments for GitLab after commit status API success this test would never pass and at the moment we don't have way to explicitly fail the commits status API from this E2E to test the setting behavior therefore it is been removed here.
88d4f5d
to
041b934
Compare
041b934
to
0171764
Compare
@chmouel can you please take a look? |
disabled PipelineRun status comment in GitLab when commit status API call succeed. it is last resort to let know users about PipelineRun status when commit status API fails. https://issues.redhat.com/browse/SRVKP-8553 Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
0171764
to
51523cb
Compare
/test linters |
Yes I started this morning to test this, since we don't have a e2e for that |
This works as intended, but why don't you have a e2e that checks that no comment has been created? I am worried as well that you break exiting behavior even if it make sense we may break user who relies on that comment or got used to it ? this was supposed to be an option in setting as what @PuneetPunamiya was implementing in 608c97b |
disabled PipelineRun status comment in GitLab when commit status API call succeed. it is last resort to let know users about PipelineRun status when commit status API fails. Deleted the E2E tests which was required PipelineRun status comment existence.
📝 Description of the Change
🔗 Linked GitHub Issue
Fixes #
👨🏻 Linked Jira
https://issues.redhat.com/browse/SRVKP-8553
🚀 Type of Change
fix:
)feat:
)feat!:
,fix!:
)docs:
)chore:
)refactor:
)enhance:
)deps:
)🧪 Testing Strategy
✅ Submitter Checklist
fix:
,feat:
) matches the "Type of Change" I selected above.make test
andmake lint
locally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit install
toautomate these checks.