Skip to content

Gates should assert their own workflow wiring, so an unapplied patch fails loudly #272

Description

@rubenhensen

Every gate in this epic was landed in two halves: dobby writes the code and tests, and a maintainer applies the workflow YAML by hand, because the App has no workflows: write. Nothing detects a missing second half. The failure is silent and the PR is green.

It has already happened twice:

encryption4all/cryptify#203 solves this properly. Its the_workflow_uses_the_settings_this_module_pins test reads .github/workflows/api-diff.yml, asserts the gate's fail-on and include-checks match the constants the test module pins, and fails with both sides named:

.github/workflows/api-diff.yml and this module disagree about what the gate does:
  fail-on: the gate runs with ERR, this module pins WARN
  include-checks: the gate runs with nothing, this module pins response-non-success-status-removed,...

That turns "the maintainer forgot to apply the patch" from an invisible no-op into a red cargo test, and it also stops the settings drifting away from the mutation test that certifies them.

Worth copying to

  • postguardwire-compat-rust / wire-compat-js / semver-checks / api-diff. pg-pkg/tests/api_gate.rs already pins the oasdiff settings in spirit; extend it to assert the workflow's inputs the way cryptify's does. The wire gates are the higher-value target: they are required checks, and a silently-unapplied change to them means a required check that certifies nothing.
  • postguard-jswebsite.yml / tb-addon.yml / the API-surface gate. The tb-addon one has a concrete hook already: check-version could also assert the release job's tag prefix is tb-addon-v, since a bare v* would be a silent no-op release.

The alternative

Granting the App workflows: write removes the hand-off entirely. It has now cost six round trips (postguard#266/#267/#269/#270, postguard-js#134/#135/#137, cryptify#203). Rejected earlier on the grounds that an agent able to edit workflows can alter the gates and reach workflow-level secrets — which is exactly the layer this epic hardens — and that reasoning still holds. But the guard tests above are what make the hand-off safe rather than merely tolerated, so they are worth having either way.

Part of #247 (workstream C).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwayfinder:taskWayfinder ticket: manual work unblocking a decision, or execution under this map

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions