Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# xk. `xk_checks_labels_and_fix_loops_follow_the_work`

**What happened:** On one team's pnpm monorepo three things went wrong at once. The review's own verification said part of it "couldn't run": the root workspace's type-check stopped on a member's `node_modules missing`. The same review left four unit tests kept in the end-to-end package out as "an end-to-end spec: it runs against a preview", though Vitest runs them. The stale label stayed on pull requests that people were working on again. And on another pull request CoderHelm's CI fix loop stopped while its fixes were still changing what failed.

**Why:** The root package was installed with `--ignore-workspace`, so the workspace's members had nothing installed when the root's type-check ran them all. A test file was called an end-to-end spec by where it sat: its package's dependencies named Playwright, or it sat under the folder holding the Playwright config. The stale label came off only in the hourly sweep, which skipped the removal in "Preview only" mode; commits made before the label and pushed after it carried older dates, so they never counted; a person's label was taken off like CoderHelm's own; and a failed removal was a warning line. The CI fix loop ended on fixed counts (ten cycles, eight pushes, two fixes per failing test) whether or not its fixes made progress, and its endings asked a person to look at the check.

**The guarantee:** A repository root that declares a workspace installs the whole workspace once, with the sandbox's package cache, and every member's checks reuse that install. The review calls its own verification incomplete only when a step really couldn't run. Whether a test file runs in the sandbox is decided by the runner whose config picks it up (its folder and patterns, the runner's defaults standing in): only a file Playwright, Cypress or WebdriverIO picks up waits for a preview. CoderHelm's stale label comes off as soon as the pull request is active again: on the webhook for a push, a review, a review comment, a comment or ready for review, and in the sweep as a backstop, in every mode except the dashboard's preview. A push since the warning counts by the head the warning recorded. Removal is idempotent (a label already gone is done), a label a person put on stays theirs, and a failure is an internal alert, CoderHelm's own problem. The CI fix loop goes on while its fixes make progress: past its usual cycles and pushes while the failure keeps changing, up to twice them, and a test still red after its fixes stops the loop only when nothing else moved. Two cycles without progress end it. Every ending of its own is typed and alerted, never a person's to-do.

**Where it's enforced:** `common::e2e::test_owner::{owner, configs_for}`, `common::e2e::test_package::{package_of, install_cmd}` (`workspace_root`), `common::test_env::{script_files, package_test_command, narrow}`, the worker's `review_verify::{plan, script}` and `habits_check::is_e2e_spec`. `common::stale_prs::{webhook_activity, last_activity, head_when_warned, unmark_on_activity, decide}`, the gateway's `stale_prs::on_webhook` and the worker's `stale_prs::{on_activity, activity, run_repo}`. `common::run_round::{ci_cycle_goes_on, ci_push_cap, test_cap_stops}`, the worker's `GaveUp::own_problem` and `resume::hand_off_red_ci`.
13 changes: 9 additions & 4 deletions infra/lib/worker-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,10 @@ export class WorkerStack extends cdk.Stack {
},
},
logging: { cloudWatch: { logGroup: sandboxLogGroup } },
// Playwright's browsers, kept on the build host between builds (the
// buildspec's `cache.paths`): an end-to-end run, page check or probe
// reuses the last download instead of fetching ~200 MB each time.
// Playwright's browsers and the package managers' downloads, kept on
// the build host between builds (the buildspec's `cache.paths`): an
// end-to-end run, page check or probe reuses the last browser
// download, and an install the last packages fetched.
cache: codebuild.Cache.local(codebuild.LocalCacheMode.CUSTOM),
// NO_SOURCE: the worker passes a presigned URL for the tarball + the
// derived check command as env overrides. The buildspec fetches, extracts, runs the
Expand Down Expand Up @@ -532,7 +533,11 @@ export class WorkerStack extends cdk.Stack {
],
},
},
cache: { paths: ["/root/.cache/ms-playwright/**/*"] },
// The package managers' downloads too (`review_verify::PM_CACHE`):
// a workspace install fetches only what changed since the last build.
cache: {
paths: ["/root/.cache/ms-playwright/**/*", "/root/.cache/coderhelm-pm/**/*"],
},
}),
});

Expand Down
1 change: 1 addition & 0 deletions services/common/src/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub mod signature;
pub mod stats;
pub mod store;
pub mod suggest;
pub mod test_owner;
pub mod test_package;
pub mod triage;
pub mod workflow_gate;
Loading