Skip to content

fix(github-webhook): clear pending check on ok-to-test#2706

Merged
zakisk merged 1 commit into
tektoncd:mainfrom
zakisk:fix-ok-to-test-status-update
May 6, 2026
Merged

fix(github-webhook): clear pending check on ok-to-test#2706
zakisk merged 1 commit into
tektoncd:mainfrom
zakisk:fix-ok-to-test-status-update

Conversation

@zakisk
Copy link
Copy Markdown
Member

@zakisk zakisk commented Apr 28, 2026

When using GitHub Webhook, the pending check run created for unauthorized PRs was never resolved after an admin commented /ok-to-test, leaving it stuck indefinitely.

https://redhat.atlassian.net/browse/SRVKP-11789

📝 Description of the Change

🔗 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

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a 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 updates the logic in pkg/pipelineascode/match.go for handling /ok-to-test comments. It replaces the provider name check with a check on the InstallationID to identify GitHub Apps, ensuring that status updates are handled correctly for providers that use the checkRun API. I have no feedback to provide as there are no review comments.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 28, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.27%. Comparing base (eda5331) to head (de5ec38).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2706      +/-   ##
==========================================
+ Coverage   59.24%   59.27%   +0.03%     
==========================================
  Files         208      208              
  Lines       20566    20566              
==========================================
+ Hits        12184    12191       +7     
+ Misses       7610     7603       -7     
  Partials      772      772              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

When using GitHub Webhook, the pending check run created for
unauthorized PRs was never resolved after an admin commented
/ok-to-test, leaving it stuck indefinitely.

https://redhat.atlassian.net/browse/SRVKP-11789

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
@zakisk zakisk force-pushed the fix-ok-to-test-status-update branch from 3bd4d8e to de5ec38 Compare May 6, 2026 08:51
@zakisk zakisk marked this pull request as ready for review May 6, 2026 08:51
Copy link
Copy Markdown
Member

@theakshaypant theakshaypant left a comment

Choose a reason for hiding this comment

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

LGTM.
Updates the condition to set an "approved" status on ok-to-test for non github app providers instead of non-github providers.
Adds a comment explaining why this is not required for github apps.
Adds a test case for ok-to-test verifyRepoAndUser happy path

@zakisk zakisk merged commit 74b0d28 into tektoncd:main May 6, 2026
13 checks passed
@zakisk zakisk deleted the fix-ok-to-test-status-update branch May 6, 2026 10:16
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.

3 participants