Skip to content

A Dispatch of the Smoke Pull Request Stub Can Mask a Pull Request's Required Check #3334

Closed

Description

@ptr727

Problem

The smoke-variant pull request stub, catalog/snippets/workflows/test-pull-request-smoke.yml, triggers on pull_request and workflow_dispatch, and both events run the same aggregator, Check pull request workflow status job, the ruleset-bound required check. A dispatch on a branch therefore posts that check on the branch's head SHA. Where that SHA is also the head of an open pull request, two runs produce the one required context, and they do not run the same gates.

  • validate-task.yml gates its "Read comments label", "Resolve prose base", and "Check prose" steps on github.event.pull_request != null, so a dispatch run never runs the prose gate.
  • A dispatch validates the branch head, where the pull request run validates the test merge commit.

So a pull request whose run failed the prose gate can show a green required check once anyone dispatches the workflow on its head branch, where the check reads the newest run with that name on the SHA. Dispatching to re-run a red check, or to force a smoke build after a workflow-only hub pin bump merges into develop while a promotion pull request is open, both reach it.

Found while adopting the stub in ptr727/ESPHome-NonRoot#332, whose OPERATIONS.md prescribes such a dispatch.

Options

  • Have the aggregator fail, or report a distinct name, on a workflow_dispatch run, so only a pull_request run can satisfy the required context.
  • Run the prose gate on a dispatch too, against the default branch or the branch's merge base, so both producers carry the same gates.
  • Document the hazard in WORKFLOW.md D1.5 and in the stub, where neither change is wanted.

Done when

A workflow_dispatch run of the stub cannot turn a pull request's failed required check green without running the gates that pull request's own run failed.

This issue reports a finding and is not a pull request against the hub.

Activity

  1. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: In catalog/snippets/workflows/test-pull-request-smoke.yml (and the no-build stub test-pull-request.yml), how should a non-pull_request run be stopped from posting the ruleset-bound Check pull request workflow status job on a PR's head SHA without the prose gate: a distinct aggregator name on such runs, the prose gate on dispatch, dispatch in its own workflow, or a WORKFLOW.md D1.5 note only?

    Options, recommended first:

    1. Give the aggregator a distinct name on non-PR events (recommended): An expression name: yielding the ruleset name only when github.event_name == 'pull_request', so only a PR run can satisfy the required context. A dispatch still smoke-builds as Smoke-Build a Dispatched Run of the Smoke Caller Snippet Past Its Paths Filter #3149 decided, and the no-build stub's push-to-develop runs stop competing with a promotion PR's run. Cost: spec/audit.py check_interface (~line 960) matches the name only as a literal scalar, so audit, requiredCheckName handling, tests, both stubs, and the byte-identical docs example change together. No work in flight.
    2. Run the prose gate on dispatch against a resolved base: A dispatch has no pull_request.base.sha, so the base is guessed and may sweep in lines already reviewed, and the run still validates the head rather than the merge commit. No work in flight.
    3. Move dispatch smoke builds to their own workflow: Keeps the literal name and audit, but goes against Smoke-Build a Dispatched Run of the Smoke Caller Snippet Past Its Paths Filter #3149's "Keep workflow_dispatch:", adds a carried file, and leaves the no-build stub's push trigger as a second mask. No work in flight.
    4. Document the hazard in D1.5 and the stub only: Cheapest, but the mask stays reachable, including by the dispatch ESPHome-NonRoot's operations doc prescribes. No work in flight.

    Evidence: validate-task.yml:495, 545, 559 gate the comments-label, prose-base, and prose steps on github.event.pull_request != null. Both stubs keep workflow_dispatch:, the smoke stub runs smoke-build on dispatch (7a58899, #3153, per #3149, which did not consider this). The no-build stub also triggers on push: branches: [develop], and a promotion PR's head is develop's tip. Skipping the aggregator on dispatch fails (a condition-skipped job reports success), and failing it turns a green PR check red. D1.5 binds the job name: to the ruleset context:, which option 1 keeps on every PR run.

    Blocks: #1516 (its prose-gate-on-push sub-question is the same class of problem)

  2. added
    decision
    on Nov 1, 2026
  3. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: give the aggregator job an expression name that yields the ruleset-bound name only when github.event_name == 'pull_request'. Update spec/audit.py check_interface's literal-name match, requiredCheckName handling, tests, both stubs, and the docs example together. This is now work for the next burndown round.

  4. removed
    decision
    on Nov 1, 2026
  5. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-02): worktree and branch removed, so this claim holds no files. Its fix merged to develop in PR #3796.

    Backlog burndown claim (round 2, group R2G3). Branch: feature/burn-3334. Issues: #3334, #1516, #3487, #1485, #1938.

    Predicted file set:

    • .github/workflows/test-pull-request.yml, .github/workflows/validate-task.yml, .github/workflows/build-release-task.yml
    • catalog/snippets/workflows/test-pull-request.yml, catalog/snippets/workflows/test-pull-request-smoke.yml
    • docs/reusable-workflows.md, WORKFLOW.md, spec/audit.py, spec/files.json, scripts/repo_gate.py
    • spec/project-types.json, spec/fidelity-model.md (added in adjudication)
    • tests/test_audit.py, tests/test_audit_helpers.py, tests/test_release_guards.py, tests/test_repo_gate.py
    • .agents/skills/workflow-ci-contract/ and its generated trees (.github/skills/workflow-ci-contract/, .claude-plugin/fleet-skills/skills/workflow-ci-contract/, .claude-plugin/fleet-skills/.source-digests/workflow-ci-contract)
  6. ptr727 commented on Nov 2, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-02): worktree and branch removed, so this claim holds no files. Its fix merged to develop in PR #3799.

    Backlog burndown claim (round 2, promotion fix 1). Branch: feature/burn-3797-fix1. Fixes the #3797 finding that check_interface skips the every-event check for a second job carrying the literal required name once any job uses the pull_request-only expression.

    Predicted file set:

    • spec/audit.py, tests/test_audit.py, tests/test_audit_helpers.py (added in adjudication)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions