Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(ci): add step-per-lane mode with folded check groups and lane table

Steven Enamakel657a9e288e84
diff --git a/docs/ci-self-hosted.md b/docs/ci-self-hosted.md
index 80e77c82e0..130dd81a40 100644
--- a/docs/ci-self-hosted.md
+++ b/docs/ci-self-hosted.md
@@ -38,9 +38,16 @@ How lanes behave:
- **Selection is by area only.** The changed-area filters in
`.github/ci-paths-filter.yml`, which CI Lite also uses, decide whether a
whole suite runs. Nothing narrows a suite to the changed files.
-- **A failed check does not stop the lane.** Every later check still runs,
- and the lane still fails. A check whose dependency failed reports
- `blocked`.
+- **Nothing stops early.** A failed check never stops the checks after it
+ in its lane, and never stops other lanes. Inside the coverage check,
+ `scripts/ci/rust-coverage.sh` runs every crate and integration target even
+ after one fails, merges the lcov report from what ran, and then lists every
+ failure. A check whose dependency failed reports `blocked`. Only a
+ cancellation stops a run.
+- **One workflow step per lane.** `Start lanes` launches every lane in the
+ background, so they still run in parallel. Each `Lane: …` step streams its
+ own lane's log live, with one folded group per check, and passes or fails
+ on that lane alone. `Lane summary` carries the overall result.
- **Changed-line coverage** must be at least 80% through
`scripts/ci/self-hosted/diff-cover.sh`, the same gate as `PR CI Gate`.
diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjs
index e9fcf6d886..a2f18a07a7 100644
--- a/scripts/__tests__/self-hosted-lanes.test.mjs
+++ b/scripts/__tests__/self-hosted-lanes.test.mjs
@@ -18,7 +18,9 @@ import {
} from "../ci/self-hosted/lanes-plan.mjs";
import {
Runner,
+ foldLine,
gatingFailures,
+ renderLaneTable,
orderProblems,
parseArgs,
renderSummary,
@@ -320,3 +322,41 @@ test("compare-runs pairs the newest completed run per workflow by head SHA", asy
{ "rust-cov": 30 },
);
});
+
+test("step-per-lane mode: args, folded check groups and the lane table", () => {
+ assert.equal(parseArgs(["--wait", "rust-cov"]).wait, "rust-cov");
+ assert.equal(parseArgs(["--wait-all"]).waitAll, true);
+ assert.equal(parseArgs(["--profile", "ex63", "--detach"]).detach, true);
+
+ const state = { open: false };
+ const out = [
+ "[ci][lanes] ===== clippy =====",
+ "$ cargo clippy",
+ "warning: x",
+ "[ci][lanes] clippy: failure (exit 101, 3s)",
+ "[ci][lanes] next: blocked — needs lane:clippy",
+ "[ci][lanes] ===== fmt =====",
+ "[ci][lanes] ===== tests =====",
+ ].map((l) => foldLine(l, state));
+ assert.equal(out[0], "::group::clippy");
+ assert.equal(
+ out[3],
+ "[ci][lanes] clippy: failure (exit 101, 3s)\n::endgroup::",
+ );
+ assert.equal(out[4], "[ci][lanes] next: blocked — needs lane:clippy");
+ // A check whose outcome line never came is closed by the next check.
+ assert.equal(out[6], "::endgroup::\n::group::tests");
+ assert.equal(state.open, true);
+
+ const table = renderLaneTable({
+ name: "rust-lint",
+ checks: [
+ { name: "clippy", status: "failure", durationS: 3, reportOnly: false },
+ { name: "off", status: "skipped", durationS: null, reportOnly: false },
+ { name: "bench", status: "failure", durationS: 9, reportOnly: true },
+ ],
+ });
+ assert.match(table, /failure\s+clippy 3s/);
+ assert.doesNotMatch(table, /off/);
+ assert.match(table, /bench 9s \(report-only\)/);
+});
diff --git a/scripts/ci/self-hosted/lanes.mjs b/scripts/ci/self-hosted/lanes.mjs
index c9e9e88880..fe3b6db47b 100644
--- a/scripts/ci/self-hosted/lanes.mjs
+++ b/scripts/ci/self-hosted/lanes.mjs
@@ -474,7 +474,8 @@ async function waitLane(out, name) {
const lane = JSON.parse(readFileSync(statusPath, "utf8"));
console.log(renderLaneTable(lane));
const failures = gatingFailures({ lanes: [lane] });
- for (const f of failures) console.log(`::error::[ci][lanes] ${f} did not pass`);
+ for (const f of failures)
+ console.log(`::error::[ci][lanes] ${f} did not pass`);
return failures.length > 0 ? 1 : 0;
}
@@ -483,7 +484,9 @@ async function waitAll(out) {
const donePath = join(out, "status", "_done.json");
while (!existsSync(donePath)) {
if (!runnerAlive(out)) {
- console.error("::error::[ci][lanes] the lane runner exited without finishing");
+ console.error(
+ "::error::[ci][lanes] the lane runner exited without finishing",
+ );
printRunnerTail(out);
return 2;
}