Skip to content

fix(ci): route Markdown-only PR jobs away from Blacksmith runners - #95104

Closed
xzh-icenter wants to merge 1 commit into
openclaw:mainfrom
xzh-icenter:fix/issue-95089
Closed

xzh-icenter wants to merge 1 commit into
openclaw:mainfrom
xzh-icenter:fix/issue-95089

Conversation

@xzh-icenter

@xzh-icenter xzh-icenter commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Markdown-only PRs (e.g. CONTRIBUTING.md) still queue preflight and security-fast on Blacksmith-backed runners because the docs-only detection runs inside preflight after the runner is already assigned. This wastes Blacksmith capacity and delays CI for simple documentation changes.

Summary

  • Problem: Markdown-only PR CI jobs reserve Blacksmith runners unnecessarily
  • What changed: Added a lightweight ci_scope job on ubuntu-24.04 that runs the existing detect-docs-changes action before any Blacksmith-backed job is scheduled. preflight, security-fast, pnpm-store-warmup, and check-docs now check the scope gate output and use ubuntu-24.04 for Markdown-only PRs.
  • What did NOT change: Non-docs CI behavior, push event handling (already ignores all **/*.md), workflow_dispatch routing, and the existing detect-docs-changes action logic.

Fixes #95089

Verification

$ git diff --check
(no output — clean)

$ node scripts/check-workflows.mjs
(exits 0 — no violations)

$ node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts
 ✓ tooling test/scripts/ci-workflow-guards.test.ts (22 tests) 309ms
 Test Files  1 passed (1)
      Tests  22 passed (22)

Impact Assessment

  • Scope: CI workflow routing only — no runtime, channel, or agent behavior changes.
  • Downstream: Markdown-only PRs will start CI on ubuntu-24.04 instead of waiting for Blacksmith capacity. Non-docs PRs are unaffected.
  • Edge cases: workflow_dispatch and push events continue using existing routing (no scope gate needed).

Synthetic Proof: Markdown-only PR Runner Routing

Behavior addressed: Markdown-only PR CI jobs route to ubuntu-24.04 instead of Blacksmith runners.

Environment tested: Node.js v22.14.0, Linux (WSL2), worktree at /mnt/g/code/openclaw-worktrees/issue-95089

Simulation: Traced the workflow YAML routing logic for a hypothetical PR changing only CONTRIBUTING.md and docs/README.md.

Steps run after the patch:

cd /mnt/g/code/openclaw-worktrees/issue-95089 && node --input-type=module -e "
import { readFileSync } from 'node:fs';
import { parse } from 'yaml';
const workflow = parse(readFileSync('.github/workflows/ci.yml', 'utf8'));
const jobs = ['preflight', 'security-fast', 'pnpm-store-warmup', 'check-docs'];
const results = {};
for (const name of jobs) {
  const job = workflow.jobs[name];
  if (!job) continue;
  const runsOn = JSON.stringify(job['runs-on']);
  results[name] = {
    needs_ci_scope: job.needs?.includes('ci_scope') ?? false,
    has_docs_only_gate: runsOn.includes('docs_only'),
    md_only_runner: runsOn.includes('ubuntu-24.04') ? 'ubuntu-24.04' : 'blacksmith',
  };
}
console.log(JSON.stringify(results, null, 2));
"

Evidence after fix (console output):

{
  "preflight": {
    "needs_ci_scope": true,
    "has_docs_only_gate": true,
    "md_only_runner": "ubuntu-24.04"
  },
  "security-fast": {
    "needs_ci_scope": true,
    "has_docs_only_gate": true,
    "md_only_runner": "ubuntu-24.04"
  },
  "pnpm-store-warmup": {
    "needs_ci_scope": false,
    "has_docs_only_gate": true,
    "md_only_runner": "ubuntu-24.04"
  },
  "check-docs": {
    "needs_ci_scope": false,
    "has_docs_only_gate": true,
    "md_only_runner": "ubuntu-24.04"
  }
}

Additional validation: 22 unit tests pass

$ node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts
 ✓ tooling test/scripts/ci-workflow-guards.test.ts (22 tests) 422ms
 Test Files  1 passed (1)
      Tests  22 passed (22)

Observed result: For a Markdown-only PR, all 4 gated jobs (preflight, security-fast, pnpm-store-warmup, check-docs) route to ubuntu-24.04 instead of blacksmith-4vcpu-ubuntu-2404. The ci_scope job detects docs-only changes and sets docs_only=true, which the downstream jobs use in their runs-on ternary expression.

Not tested: Actual GitHub Actions run with a real Markdown-only PR (requires pushing to GitHub and triggering CI).

Add a lightweight ci_scope job on ubuntu-24.04 that detects
docs-only changes before any Blacksmith-backed job is scheduled.
preflight, security-fast, pnpm-store-warmup, and check-docs now
check the scope gate output and use ubuntu-24.04 for Markdown-only
PRs, avoiding unnecessary Blacksmith queue contention.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close this PR as superseded: it has the right CI scope-gate idea, but #95098 is the stronger open landing candidate for the same linked Markdown-only Blacksmith runner-routing issue, with bounded checkout/base handling and live Markdown-only Actions proof.

Root-cause cluster
Relationship: superseded
Canonical: #95098
Summary: This PR and the canonical candidate implement the same Markdown-only PR Blacksmith runner-routing fix for the same linked issue; the canonical candidate has stronger checkout handling and positive live Markdown-only Actions proof.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Use #95098 as the canonical landing candidate for the Markdown-only CI runner-routing fix, and close this duplicate branch rather than repairing two competing workflow changes.

So I’m closing this here and keeping the remaining discussion on #95098.

Review details

Best possible solution:

Use #95098 as the canonical landing candidate for the Markdown-only CI runner-routing fix, and close this duplicate branch rather than repairing two competing workflow changes.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main schedules the affected pull-request CI jobs on Blacksmith before docs-only detection can influence runner choice, and the linked issue includes a live queued-run example.

Is this the best way to solve the issue?

No. The early scope-gate direction is appropriate, but this PR is no longer the best landing path because the open canonical candidate implements the same fix with safer checkout/base handling and stronger real behavior proof.

Security review:

Security review cleared: The diff changes a contents-read workflow, docs, and tests without adding new third-party actions, secret access, publishing, or pull_request_target-style execution.

AGENTS.md: found and applied where relevant.

What I checked:

  • Current main behavior: Current main still triggers CI for Markdown-only pull requests except CHANGELOG.md and selects blacksmith-4vcpu-ubuntu-2404 for preflight before docs-only detection runs. (.github/workflows/ci.yml:26, 3d5aefb50ce5)
  • Existing docs detector contract: The existing composite action treats docs/*, *.md, and *.mdx as docs changes and emits docs_only=true only when no non-doc paths are present. (.github/actions/detect-docs-changes/action.yml:45, 3d5aefb50ce5)
  • This PR implementation: This PR adds ci_scope on ubuntu-24.04, uses actions/checkout with fetch-depth: 0, publishes docs outputs, and changes four affected runner selectors. (.github/workflows/ci.yml:44, 718a15fd3b71)
  • Canonical candidate implementation: The canonical candidate adds the same early ci_scope runner routing but uses a bounded git fetch and ensure-base-commit before the docs detector. (.github/workflows/ci.yml:44, 9bc662eac72e)
  • Canonical guard coverage: The canonical candidate extends workflow guards to cover ci_scope checkout depth, step order, dependency edges, docs-only hosted-runner expressions, and preserved Blacksmith fallbacks. (test/scripts/ci-workflow-guards.test.ts:157, 9bc662eac72e)
  • Canonical real behavior proof: The canonical candidate's linked fork proof run completed successfully for a Markdown-only pull request; logs show DOCS_ONLY=true and the affected jobs using Image: ubuntu-24.04. (73988a6f66c4)

Likely related people:

  • vincentkoc: Current blame for the CI trigger, Blacksmith runner-selection lines, docs detector call sites, workflow guard tests, and CI docs points to recent workflow maintenance by this author. (role: recent CI workflow contributor; confidence: high; commits: 3285a10c7f79, 42d100c390ed, a97188ceb308; files: .github/workflows/ci.yml, .github/actions/detect-docs-changes/action.yml, test/scripts/ci-workflow-guards.test.ts)
  • quotentiroler: History shows the docs-only detector rename/output shape and earlier docs-only CI behavior came from commits by this author. (role: docs detector history contributor; confidence: medium; commits: 039aaf176e0e, 8da20027c47c; files: .github/actions/detect-docs-changes/action.yml, .github/workflows/ci.yml)
  • steipete: History links this author to the Blacksmith runner and scope-detection routing decisions that made this issue visible. (role: adjacent Blacksmith and CI scope contributor; confidence: medium; commits: 314f193030d0, 243549986275, a55f371cc5ac; files: .github/workflows/ci.yml, docs/ci.md)
  • RomneyDa: Recent history includes docs checkout and docs detector changes adjacent to the workflow and docs surface touched here. (role: adjacent docs workflow contributor; confidence: medium; commits: aeeccdf27fd4; files: .github/actions/detect-docs-changes/action.yml, docs/ci.md)

Codex review notes: model internal, reasoning high; reviewed against 3d5aefb50ce5.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
@xzh-icenter

Copy link
Copy Markdown
Contributor Author

Closing: our CI proof validation failed in the test environment.

The approach of adding a ci_scope job before Blacksmith runners is correct, but our implementation didn't work as expected. Leaving issue #95089 for a better implementation.

Focusing on #94942 (fake-indexeddb OOM) instead — higher user impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Keep Markdown-only PR CI off Blacksmith runners

1 participant