[build] retrigger CI after auto-format commits#17000
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to bd8d060
Previous suggestions✅ Suggestions up to commit 7175fad
|
|||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where auto-format commits from the CI bot didn't trigger subsequent CI runs, hiding test failures. The solution uses a Personal Access Token (SELENIUM_CI_TOKEN) for commits and implements loop prevention to avoid infinite commit cycles.
Changes:
- Added
SELENIUM_CI_TOKENto commit-fixes job to trigger CI on bot commits - Implemented
check-bot-commitjob to detect and prevent infinite loops - Restructured job dependencies:
format→check-bot-commit→commit-fixes
User description
A PR had a lint issue that the autofix job autofixed, except there was another failure, and the way GitHub
does commits from
GITHUB_TOKEN, it does not send the commit added / PR updated event, so the jobs do not rerun,so the failures were hidden, which is not what we want.
💥 What does this PR do?
SELENIUM_CI_TOKENto commit the changes so auto-fix pushes trigger a full CI run🔧 Implementation Notes
Added a
check-bot-commitjob that:formatfails (for PRs on non-forks)should-commit=true/falseThe
commit-fixesjob now only runs ifshould-commit == 'true'.💡 Additional Considerations
Requires
SELENIUM_CI_TOKENsecret to be configured with appropriate permissions. Falls back to current behavior if not available.🔄 Types of changes
PR Type
Bug fix, Enhancement
Description
Adds loop prevention to skip auto-formatting if last commit from bot
Uses SELENIUM_CI_TOKEN to trigger full CI run on auto-fix commits
Implements check-bot-commit job to detect previous bot commits
Prevents infinite commit loops in auto-format workflow
Diagram Walkthrough
File Walkthrough
ci-lint.yml
Add bot commit detection and token-based CI retrigger.github/workflows/ci-lint.yml
check-bot-commitjob that detects if last commit was fromSelenium CI Bot
should-commitflag to prevent infinite commit loopscommit-fixesjob to depend oncheck-bot-commitinstead offormatSELENIUM_CI_TOKENsecret pass-through tocommit-changesworkflow