-
Notifications
You must be signed in to change notification settings - Fork 118
fix: /ok-to-test /retest pipelineruns should not be created if last sha successful #2048
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
fix: /ok-to-test /retest pipelineruns should not be created if last sha successful #2048
Conversation
fa2a595 to
72e4aca
Compare
|
/cancel |
579fd77 to
7508871
Compare
|
/retest |
8f5c0ab to
b44e208
Compare
|
cc @chmouel seems like the provider e2e tests are not running :/ wanted to test them, not sure what's up |
|
cc @zakisk |
0e2e6b9 to
fe278ab
Compare
fe278ab to
276c789
Compare
559708d to
24ff45d
Compare
24ff45d to
be704f9
Compare
/retest and /ok-to-test should only restart failed pipelines; the changes in the PR ensure that we do not match successful pipelineruns during invocation of these gitops commands. The tests have also been updated to use /test instead wherever /retest is being used to restart successful pipelines Signed-off-by: Vibhav Bobade <[email protected]> Assisted-by: Claude-4-Sonnet (via Cursor)
be704f9 to
0dcc517
Compare
|
/gemini review |
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 correctly implements the logic to prevent /retest and /ok-to-test commands from creating new PipelineRuns if a successful one already exists for the same SHA. The changes to the core logic in pkg/matcher/annotation_matcher.go are sound, and the accompanying documentation updates are clear and comprehensive. The test suite has also been updated to reflect this new behavior, which is great. I have two suggestions: one is to improve the unit testing for the new filtering logic to make it more robust, and the other is to fix a minor typo in a newly introduced constant.
Replace simplified test helper with comprehensive unit tests for the actual production function. This addresses PR feedback about inadequate test coverage of the core filtering logic. Changes: - Remove checkForExistingSuccessfulPipelineRun helper function - Remove TestCheckForExistingSuccessfulPipelineRun test - Add comprehensive TestFilterSuccessfulTemplates covering: * Multiple templates with different success/failure states * Per-template filtering based on most recent successful runs * Event type restrictions (retest/ok-to-test only) * Edge cases: empty SHA, different SHA, missing template names * All templates filtered resulting in empty list Coverage improvements: - filterSuccessfulTemplates function: 84.0% → 92.0% - Overall matcher package: 87.4% → 87.8% 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Chmouel Boudjnah <[email protected]>
|
I have tested it and it works nicely chmouel/scratchmyback#377 I have reviewed it and it look fine to me I have improved the testing in this commit via claude/gemin review and pushed the commit to that pull request |
|
/lgtm |
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.
Congrats @waveywaves your PR Has been approved 🎉
✅ Pull Request Approved
Approval Status:
- Required Approvals: 1
- Current Approvals: 1
👥 Reviewers Who Approved:
| Reviewer | Permission Level | Approval Status |
|---|---|---|
| @chmouel | admin |
✅ |
📝 Next Steps
- Ensure all required checks pass
- Comply with branch protection rules
- Request a maintainer to merge using the
/mergecommand (or merge it
directly if you have repository permission).
Automated by the PAC Boussole 🧭
|
/retest |
|
/merge |
a72246d
into
openshift-pipelines:main
✅ PR Successfully Merged
Approvals Summary:
Thank you @waveywaves for your valuable contribution! 🎉 Automated by the PAC Boussole 🧭 |
Changes
/retest and /ok-to-test should only restart failed pipelines; the
changes in the PR ensure that we do not match successful pipelineruns
during invocation of these gitops commands. The tests have also been
updated to use /test instead wherever /retest is being used to restart
successful pipelines
fixes #1959
Jira: https://issues.redhat.com/browse/SRVKP-7236
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.
🔎 Address any CI test flakiness before merging, or provide a valid reason to bypass it (e.g., token rate limitations).
If adding a provider feature, fill in the following details:
(update the provider documentation accordingly)