Repository navigation
Compile-test on any non-push event, not just on main and develop - #164
Merged
Merged
Conversation
The dispatch fail-open sat inside the main/develop branch of the change-gate, so a workflow_dispatch on a feature branch fell through to the merge-base diff and could resolve to false - contradicting D1.1, which states a dispatch always compile-tests. Short-circuit any non-push event before the branch logic.
There was a problem hiding this comment.
Pull request overview
This PR fixes the compile-test change-gate in .github/workflows/test-pull-request.yml so that any non-push event (e.g., workflow_dispatch) always enables compile-test, regardless of branch, matching the documented contract for “diff unusable” scenarios.
Changes:
- Short-circuit
workflow_dispatch(and any other non-push event) tocompile-test=truebefore any branch-specific diff logic. - Narrow the
main/developarm’s “fail-open” condition to only the “new branch / unusable BEFORE” case, since the event-type check is now handled uniformly up front.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The change-gate's fail-open for a non-push event was nested inside the
main/developarm:So a
workflow_dispatchon a feature branch skipped that check, fell through to the merge-base diff, and could resolve tocompile-test=false. D1.1 states the gate is true "whenever the diff is unusable (new branch, force-push, dispatch)", so the code contradicted the contract.Reproduced before fixing: a dispatch on a docs-only feature branch returned
compile-test=false.Found by Copilot on the promotion pull request. Worth noting why my own tests missed it: the suite had a case labelled "feature: empty BEFORE still uses merge-base" that returned
true, but for a content reason - that branch had aDocker/**change - not because it failed open. The label read like dispatch coverage while asserting nothing of the kind.What
Short-circuit any non-push event to
compile-test=truebefore the branch logic, so the rule is uniform rather than per-branch.Verification
Nine cases against real git history, with the dispatch cases now covering all three branch kinds:
true(wasfalse)main/ ondeveloptrueDocker/**truefalsedevelop: docs-only pushfalsedevelop:Docker/**pushtruedevelop: new branch / unknown before-committruePush semantics are unchanged; only the non-push path moves.
Full lint gate green: actionlint, editorconfig-checker, markdownlint, cspell.
Note
This blocks promotion #163, whose Copilot review surfaced it. Once this lands on
develop, #163 picks it up automatically.