ci(lstt): run formatting on develop pushes, not just PRs - #11000
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
- Run the pre-commit job on pushes to develop, diffing the commit range that just landed, so whole-tree hooks report against the merge that introduced a violation instead of the next unrelated pull request - Stop cancelling in-progress runs outside pull requests so back-to-back merges each keep their own verdict Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
6ea7f09 to
20f30c7
Compare
|
claude: rebase looks right — only the workflow change is left, the headers landed independently via #8561. Two things from testing it:
FWIW |
Motivation
amdsmi-license-headersispass_filenames: false, so it rescans the whole tree.Once a violation lands on
develop, every later PR goes red instead of the mergethat caused it. #10010 merged on a stale-green formatting run and reddened #10973
and #10998 until #8561 fixed the headers. Third time against this hook (#10402,
#10845, #8561), each fixed reactively.
Technical Details
.github/workflows/lstt-formatting.yml:pushtrigger ondevelop, same path filter aspull_request, so a whole-treehook runs on the merge commit.
--from-refis event-aware viaFROM_REF:github.event.beforeon push, basebranch on PR. PR behavior unchanged.
cancel-in-progresslimited topull_request, so consecutive merges each keeptheir verdict.
Detection at merge, not prevention. Prevention is "Require branches to be up to
date before merging" —
develophas no branch protection at all today (theprotection API returns 404), which is how the stale-green merge happened.
Known gap:
github.event.beforeis unguarded, so a branch re-create or force-pushgives
pre-commita zero/unreachable SHA and it exits 128. Loud, not silent.Follow-up can fall back to the base branch on
github.event.created/forced.JIRA ID
N/A (CI hygiene). Drift origin #10010, headers fixed by #8561.
Test Plan / Result
pre-commit run --from-ref origin/develop --to-ref HEADinprojects/amdsmi— passes.python3 projects/amdsmi/tests/check_license_headers.py— clean.FROM_REFgivesgithub.event.beforeon push andorigin/<base>on PR;cancel-in-progressisfalse on push, true on PR.
pre-commit run --from-ref 0000000000000000000000000000000000000000reproducesthe exit-128 gap above.