Skip to content

fix(ci): remove ok-to-test label immediately after check#2622

Merged
chmouel merged 1 commit intotektoncd:mainfrom
zakisk:delete-label-right-after-ok-to-test
Mar 30, 2026
Merged

fix(ci): remove ok-to-test label immediately after check#2622
chmouel merged 1 commit intotektoncd:mainfrom
zakisk:delete-label-right-after-ok-to-test

Conversation

@zakisk
Copy link
Copy Markdown
Member

@zakisk zakisk commented Mar 30, 2026

Move label removal from the pre-check phase to right after the ok-to-test label condition passes. This ensures the label is consumed on use, eliminating the need to strip it on subsequent events like synchronize.

Assisted-by: Claude Opus 4.6 (via Claude Code)

📝 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 refactors the ok-to-test label management within .github/scripts/check-pr-permissions.js by centralizing the label removal logic to the point where the label is processed. Feedback suggests removing leading whitespace from the error message in core.setFailed to improve its appearance in the GitHub Actions UI.

} catch (err) {
// 404 is expected when multiple matrix jobs race to remove the same label
if (err.status !== 404) {
core.setFailed(` Failed to remove ok-to-test label: ${err.message}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The error message passed to core.setFailed includes leading spaces. While this aligns with the indentation of core.info logs, core.setFailed messages are often displayed in prominent UI locations (like PR check annotations) where leading whitespace can look awkward and reduce readability. It's better to provide a clean error message without indentation.

Suggested change
core.setFailed(` Failed to remove ok-to-test label: ${err.message}`);
core.setFailed(`Failed to remove ok-to-test label: ${err.message}`);

@zakisk zakisk force-pushed the delete-label-right-after-ok-to-test branch from 4508b63 to 75028df Compare March 30, 2026 12:37
Move label removal from the pre-check phase to right after the
ok-to-test label condition passes. This ensures the label is
consumed on use, eliminating the need to strip it on subsequent
events like synchronize.

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
Assisted-by: Claude Opus 4.6 (via Claude Code)
@zakisk zakisk force-pushed the delete-label-right-after-ok-to-test branch from 75028df to cca242e Compare March 30, 2026 13:04
@chmouel chmouel merged commit e61bf66 into tektoncd:main Mar 30, 2026
12 checks passed
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