fix(incoming): honor skip-CI exemption for incoming webhooks - #2958
fix(incoming): honor skip-CI exemption for incoming webhooks#2958krishhlogan wants to merge 1 commit into
Conversation
Incoming webhooks are explicit user-triggered runs. The secondary skip-CI guard in Run() only exempted GitOps comment events but not incoming webhooks. Because GetCommitInfo sets HasSkipCommand from the head commit message during verifyRepoAndUser, a request whose HEAD commit contained [skip ci] was silently dropped. Add the incoming-webhook exemption alongside the existing GitOps exemption. Signed-off-by: krishhlogan <kloganat@redhat.com> Assisted-by: Claude Sonnet 4.6 (via Claude Code)
|
/ok-to-test |
There was a problem hiding this comment.
🟡 Changes recommended
The updated test helper can emit invalid JSON for commit messages containing quotes/newlines, and the new test should assert the skip marker was actually detected to avoid false positives.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adjusts the secondary skip-CI safety net in PacRun.Run() to ensure incoming webhooks (explicit user-triggered runs) are not dropped when the head commit message contains a skip marker, aligning runtime behavior with the intent of incoming webhook triggers.
Changes:
- Exempt incoming webhook events from the secondary skip-CI guard in
PacRun.Run(). - Extend the GitHub test reply helper to allow customizing the returned commit message.
- Add a unit test covering the “incoming webhook + [skip ci] commit message” behavior.
File summaries
| File | Description |
|---|---|
| pkg/pipelineascode/pipelineascode.go | Updates the secondary skip-CI condition to also exempt incoming webhook events. |
| pkg/pipelineascode/pipelineascode_test.go | Adds a targeted unit test and enhances the GitHub reply helper to simulate skip markers in commit messages. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| commitMsg := "commit message" | ||
| if len(commitMessages) > 0 && commitMessages[0] != "" { | ||
| commitMsg = commitMessages[0] | ||
| } | ||
| jj := fmt.Sprintf(`{"sha": "%s", "html_url": "https://git.commit.url/%s", "message": "%s"}`, | ||
| runevent.SHA, runevent.SHA, commitMsg) |
| // Defensive skip-CI check: this is a safety net in case events bypass the early check in sinker. | ||
| // Primary skip detection happens in sinker.processEvent() for performance, but this ensures | ||
| // nothing slips through (e.g., tests that call Run() directly, or edge cases). | ||
| // Skip only for non-GitOps events (GitOps commands can override skip-CI). | ||
| if p.event.HasSkipCommand && !opscomments.IsAnyOpsEventType(p.event.EventType) { | ||
| if p.event.HasSkipCommand && !opscomments.IsAnyOpsEventType(p.event.EventType) && p.event.EventType != triggertype.Incoming.String() { |
| err := p.Run(ctx) | ||
| assert.NilError(t, err) | ||
|
|
||
| prs, err := cs.Clients.Tekton.TektonV1().PipelineRuns("").List(ctx, metav1.ListOptions{}) |
|
/paco review |
Paco Review
|
|
please look over the bot comments |
📝 Description of the Change
Incoming webhooks are explicit user-triggered runs. The secondary skip-CI guard in Run() only exempted GitOps comment events but not incoming webhooks. Because GetCommitInfo sets HasSkipCommand from the head commit message during verifyRepoAndUser, a request whose HEAD commit contained [skip ci] was silently dropped. Add the incoming-webhook exemption alongside the existing GitOps exemption.
🔗 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.