Skip to content

fix(incoming): honor skip-CI exemption for incoming webhooks - #2958

Open
krishhlogan wants to merge 1 commit into
tektoncd:mainfrom
krishhlogan:fix/incoming-webhook-skip-ci
Open

fix(incoming): honor skip-CI exemption for incoming webhooks#2958
krishhlogan wants to merge 1 commit into
tektoncd:mainfrom
krishhlogan:fix/incoming-webhook-skip-ci

Conversation

@krishhlogan

Copy link
Copy Markdown

📝 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

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 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.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

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-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

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)
@chmouel
chmouel requested a lite review from Copilot September 2, 2026 07:37
@chmouel

chmouel commented Sep 2, 2026

Copy link
Copy Markdown
Member

/ok-to-test

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment on lines +68 to +73
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)
Comment on lines 116 to +120
// 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() {
Comment on lines +909 to +912
err := p.Run(ctx)
assert.NilError(t, err)

prs, err := cs.Clients.Tekton.TektonV1().PipelineRuns("").List(ctx, metav1.ListOptions{})
@chmouel

chmouel commented Sep 2, 2026

Copy link
Copy Markdown
Member

/paco review

@pipelines-as-code

Copy link
Copy Markdown

Paco Review ⚠️

Paco: the Gemini/OpenCode backend exited with an error; check the PipelineRun logs.

Reviewed commit: 4cc35e9

@chmouel

chmouel commented Sep 2, 2026

Copy link
Copy Markdown
Member

please look over the bot comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants