refactor: enhance log message for cancel-in-progress#2791
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the cancelPipelineRuns function to accept a reason string, allowing for more descriptive logging when a PipelineRun is cancelled (e.g., due to a closed pull request, a newer matching event, or a manual /cancel command). The corresponding unit tests have been updated to assert these new log messages. There are no review comments, so I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2791 +/- ##
==========================================
+ Coverage 59.73% 59.77% +0.03%
==========================================
Files 210 210
Lines 21117 21135 +18
==========================================
+ Hits 12615 12633 +18
Misses 7707 7707
Partials 795 795 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
theakshaypant
left a comment
There was a problem hiding this comment.
Overall LGTM, have a minor suggestion for the test cases. Added the comment for only one case but is applicable for all of them
| "pr-foo-2": true, | ||
| }, | ||
| wantLog: "cancel-in-progress: cancelling pipelinerun foo/pr-foo-2", | ||
| wantLog: "A newer pull_request event matched the same PipelineRun definition, and cancel-in-progress is enabled.", |
There was a problem hiding this comment.
[nit] Similar to the previous wantLog, maybe we can keep the secondary check that the correct PipelineRun was targeted, such as cancelling pipelinerun foo/pr-foo-2: A newer pull_request event...,
this commits adds a reason in log message that why the PipelineRun is cancelled so to make it clear to users. Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
6ae88f3 to
f9d93ed
Compare
📝 Description of the Change
this commits adds a reason in log message that why the PipelineRun is cancelled so to make it clear to users.
🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
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: Claude noreply@anthropic.com
✅ 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.