Skip to content

Compile-test on any non-push event, not just on main and develop - #164

Merged
ptr727 merged 1 commit into
developfrom
feature/compile-test-dispatch-gate
Jul 18, 2026
Merged

ptr727 merged 1 commit into
developfrom
feature/compile-test-dispatch-gate

Conversation

@ptr727

@ptr727 ptr727 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Why

The change-gate's fail-open for a non-push event was nested inside the main/develop arm:

if [[ "$REF_NAME" == "main" || "$REF_NAME" == "develop" ]]; then
  if [[ ... || "$EVENT_NAME" != "push" ]]; then   # only reachable on main/develop

So a workflow_dispatch on a feature branch skipped that check, fell through to the merge-base diff, and could resolve to compile-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 a Docker/** 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=true before 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:

Case Result
dispatch on docs-only feature branch true (was false)
dispatch on main / on develop true
feature: docs push, branch changed Docker/** true
feature: branch touches only docs false
develop: docs-only push false
develop: Docker/** push true
develop: new branch / unknown before-commit true

Push 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.

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.
Copilot AI review requested due to automatic review settings July 18, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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) to compile-test=true before any branch-specific diff logic.
  • Narrow the main/develop arm’s “fail-open” condition to only the “new branch / unusable BEFORE” case, since the event-type check is now handled uniformly up front.

@ptr727
ptr727 merged commit ffb2e6c into develop Jul 18, 2026
12 checks passed
@ptr727
ptr727 deleted the feature/compile-test-dispatch-gate branch July 18, 2026 21:45
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.

2 participants