fix(gitops-comments): parse branch vs tag by 'tag:' #2505
fix(gitops-comments): parse branch vs tag by 'tag:' #2505zakisk merged 2 commits intotektoncd:mainfrom
Conversation
Summary of ChangesHello @mathur07, 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 addresses a critical parsing bug in the GitOps comment processing, which previously misidentified certain branch names as tags. By refining the detection mechanism to look for "tag:" instead of just "tag", the system can now correctly differentiate between branches and tags, preventing erroneous pipeline run failures caused by incorrect branch name resolution. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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 by creating a comment using either
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 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
|
There was a problem hiding this comment.
Code Review
This pull request addresses a bug in parsing GitOps comments where a branch name containing the substring "tag" was incorrectly identified as a tag. The fix correctly requires the tag: prefix to make the distinction, which is a more robust approach. The addition of a specific test case to cover this scenario is a good practice and ensures the bug is resolved. The changes are correct and improve the reliability of comment parsing.
aThorp96
left a comment
There was a problem hiding this comment.
/lgtm
One request before approval. Also (nitpick) I don't think fix(provider) is correct here even though it is in provider.go. Maybe fix(gitops-comments) or fix(controller) is more accurate? The word in the parenthesis is the scope of logic with change, and this is unrelated to the providers
04cb926 to
70aca6d
Compare
Use strings.Contains(..., "tag:") instead of "tag" when deciding between tag and branch in /retest comment parsing. Branch names like akurlov/ROX-32966-test-tagged-rebuild were mis-parsed as tag, leaving branchName empty and causing 'SHA is not the HEAD of master' on commit comments. SRVKP-10915 Signed-off-by: Shubham Mathur <shumathu@redhat.com>
70aca6d to
e53bdda
Compare
|
/retest |
🔍 PR Lint Feedback
|
Use strings.Contains(..., "tag:") instead of "tag" when deciding between tag and branch in GitOps comment parsing. Branch names like akurlov/32966-test-tagged-rebuild were mis-parsed as tag, leaving branchName empty and causing 'SHA is not the HEAD of master' on commit comments.
SRVKP-10915
📝 Description of the Change
👨🏻 Linked Jira
🔗 Linked GitHub Issue
Fixes #
🚀 Type of Change
fix:)feat:)feat!:,fix!:)docs:)chore:)refactor:)enhance:)deps:)🧪 Testing Strategy
🤖 AI Assistance
If you have used AI assistance, please provide the following details:
Which LLM was used?
Extent of AI Assistance:
Important
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Gemini gemini@google.com
Co-authored-by: ChatGPT noreply@chatgpt.com
Co-authored-by: Claude noreply@anthropic.com
Co-authored-by: Cursor noreply@cursor.com
Co-authored-by: Copilot Copilot@users.noreply.github.com
**💡You can use the script
./hack/add-llm-coauthor.shto automatically addthese co-author trailers to your commits.
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.