Skip to content

CI: a Markdown-only change skips the repository gates that read Markdown, on PRs and on master #882

Closed

Description

@Blind-Striker

What happened

#878 was a Markdown-only canon PR: it recorded divergences in docs/architecture/client-runtime.md. It merged green, and master (3675de82) has been red in OpenCode.Sdk.Tools.Tests since. Five CanonDescriptionSourceTests fail on every OS: EventsClient.SubscribeAsync: docs/architecture/client-runtime.md#server-sent-events: excerpt not found in heading section. The new table row uses an escaped \|, which is outside the canon reader's subset.

Nothing ran that test before or after the merge:

The next code PR found it instead: #880 is red on all three OSes with exactly these 5 failures, which reproduce on a clean master.

Why it matters

Several repository gates read Markdown as their input:

  • RepositoryGates/ConsumerPinGuard, SnippetCompileGuard and PlaygroundGuard;
  • Documentation/ReadmeGuideTableTests;
  • the description-canon tests CanonDescriptionSourceTests, DescriptionCurationCanonTests, DescriptionInventoryTests and DescriptionSourceTests;
  • CommentResidue;
  • Packaging/PackedReadmeTests.

A docs edit can break any of them while every check shows green, and the break lands on whoever opens the next code PR. documentation.md's ConsumerPinGuard bullet (#867) records the gap as accepted ("not with a Markdown-only change"). This incident shows it is not harmless.

Proposed fix (design, for the lead before building)

A change that touches Markdown runs the Linux Build & Test leg, which is the full OpenCode.Sdk.Tools.Tests and OpenCode.Sdk.Tests run, on PRs, merge groups and master pushes. Lint and the benchmarks stay code-only.

  1. changes job: a new output docs (some changed path is *.md).
    • For push, the job also classifies the diff (github.event.before..github.sha) instead of assuming code=true. If that diff cannot be read, it falls back to code=true, so the full run happens.
    • It emits the Build & Test matrix as JSON: all three legs when code=true, only the Linux leg when only docs=true.
  2. push trigger: drop "**.md" from paths-ignore (LICENSE stays), so a docs merge runs on master.
  3. build-and-test: if: becomes (code || docs) && !reuse, and strategy.matrix comes from that JSON.
  4. ci-result: a docs-only branch requires Build & Test success, with Lint and both benchmark jobs skipped. The existing branches are unchanged.
  5. Reuse (CI: run the merge-queue reuse decision from the base commit, so pin and dependency changes can skip the second full run #826): unchanged. A docs PR now records its tested tree, so its merge group can reuse the green PR run as any other change does.

Cost: a docs-only PR goes from about 1 minute to about 11, the Linux leg's measured time. The same applies to a docs-only master push. Nightly publish stays code-only, because it needs Lint.

Rejected alternatives:

  • A separate Tools-only job, Markdown-reading gates only. It saves about 5 minutes per docs PR. But it duplicates about ten setup steps of Build & Test, which is upkeep. It also needs a test category every new Markdown-reading gate must remember. Forgetting it reopens this gap silently, and it misses a reader added to another test project.
  • Treat Markdown as code. That gives a full three-OS matrix plus Lint and benchmarks, about 25 minutes, for every docs PR.

Proof:

  • A repository gate on ci.yml, beside CiMergeGroupReuseTests. It asserts three things: the classifier marks *.md as docs; a docs-only change selects the Linux leg; and CI result requires that leg. A mutant that lets a docs-only change skip Build & Test must fail it.
  • The first docs-only PR after the merge, which must show the Linux leg running.

Canon to update with it:

  • quality-gates.md: the docs-only local-check line;
  • workflow.md: "a merge of only Markdown or LICENSE triggers none" and "passes without the build and test jobs";
  • the ConsumerPinGuard bullet in documentation.md;
  • the comments in ci.yml.

The change touches .github/, so its own merge group runs in full under reuse rule 5.

Activity

  1. added this to the Next milestone on Nov 15, 2026
  2. Blind-Striker commented on Nov 15, 2026

    @Blind-Striker
    CollaboratorAuthor

    #881 (closed as a duplicate of this issue) has the precise mechanism of the incident: the new table row in docs/architecture/client-runtime.md (line 835) lists `<` in a cell, which is outside the Markdown subset the canon reader in CanonDescriptionSourceTests models. The fix-forward is #883.

  3. Blind-Striker commented on Nov 15, 2026

    @Blind-Striker
    CollaboratorAuthor

    Design update (lead decision, 2026-11-15): master pushes stay full runs.

    The review of the implementation found that GitHub cancels a run that is pending in a concurrency group when a newer run is queued, even with cancel-in-progress: false. With push classification, a docs-only push B could replace a pending code push A and, classified against A's head, run only the Linux leg, so A's code would never get Lint, Windows, macOS, the benchmarks or a nightly on master.

    So point 1's push classification and its fallback are dropped:

    • Push to master: always the full run (code, both benchmark guards, all three legs), as before. "**.md" still leaves the push paths-ignore (only LICENSE stays), so a docs-only merge now triggers that full run instead of none.
    • Pull requests and merge groups: unchanged from the design. A change whose paths are all Markdown or LICENSE and include Markdown runs the Linux Build & Test leg; Lint is skipped; the benchmark jobs keep their own path selection (a spec/*.md change still selects them, as before); CI result requires that leg green, or proven same-tree reuse.
    • Cost: a docs-only merge costs a full CI run on master (CI minutes only, nothing on the merge path).
  4. Blind-Striker commented on Nov 15, 2026

    @Blind-Striker
    CollaboratorAuthor

    Live proof after #888 merged: #891 (Markdown only, docs/engineering/quality-gates.md) ran Build & Test (Linux) and no other leg; Lint & Generated Output and both benchmark jobs were skipped; CI result passed (run 43687139253). The first master push after the merge (85cf65f, run 43685968232) ran the full matrix and CI result passed.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions