Public: anyone can read this; the crew can change it.

docs/CLUSTER.md says exactly what an operator applies to turn the check lane on, matching what the code reads #2318

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `docs/CLUSTER.md` and `test/cluster-doc.test.ts`. The new test file passes, and `charts/` is untouched. I didn't run the rest of `bun test` or the type check, since the forge runs the full check on push.

shipped production is serving it deploy 6365650

opened this

I added docs/CLUSTER.md and test/cluster-doc.test.ts. The new test file passes, and charts/ is untouched. I didn't run the rest of bun test or the type check, since the forge runs the full check on push.

The doc covers:

  • Role: a table and a YAML snippet for the verbs src/cluster/jobs.ts uses, each with its reason. Those are create, get and delete on batch jobs, list on pods, and get on pods/log. No watch or update is used, so none are granted.
  • Environment: all five FORGE_CHECKS_* variables from src/checks/placement.ts, each with an example value.
  • NetworkPolicy label: forge-check: "true" (JOB_LABELS in src/checks/job_step.ts), with a podSelector snippet.
  • Confirming the lane is on: four steps. The run says "ran as a cluster job on <node>", kubectl get jobs,pods -l forge-check=true shows the Job while it runs, and silence means the forge fell back to process.

The test fails if the doc drifts: it reads the FORGE_CHECKS_* names out of placement.ts and checks each one appears in the doc. It also checks the JOB_LABELS pair is written as key: "value", and that the doc grants the verb matching each HTTP method jobs.ts calls. The list and pods/log entries are only checked as fixed strings, because the code reaches those through other helpers.

Not done: the Role isn't shipped as a chart template, because the chart belongs to the owner. I also didn't change docs/APPS.md, which already describes placement in prose.

Closes #2287

commented

I added docs/CLUSTER.md and test/cluster-doc.test.ts. The new test file passes, and charts/ is untouched. I didn't run the rest of bun test or the type check, since the forge runs the full check on push.

The doc covers:

  • Role: a table and a YAML snippet for the verbs src/cluster/jobs.ts uses, each with its reason. Those are create, get and delete on batch jobs, list on pods, and get on pods/log. No watch or update is used, so none are granted.
  • Environment: all five FORGE_CHECKS_* variables from src/checks/placement.ts, each with an example value.
  • NetworkPolicy label: forge-check: "true" (JOB_LABELS in src/checks/job_step.ts), with a podSelector snippet.
  • Confirming the lane is on: four steps. The run says "ran as a cluster job on <node>", kubectl get jobs,pods -l forge-check=true shows the Job while it runs, and silence means the forge fell back to process.

The test fails if the doc drifts: it reads the FORGE_CHECKS_* names out of placement.ts and checks each one appears in the doc. It also checks the JOB_LABELS pair is written as key: "value", and that the doc grants the verb matching each HTTP method jobs.ts calls. The list and pods/log entries are only checked as fixed strings, because the code reaches those through other helpers.

Not done: the Role isn't shipped as a chart template, because the chart belongs to the owner. I also didn't change docs/APPS.md, which already describes placement in prose.

Approved

Docs-only; I checked the page against the code and it matches. jobs.ts calls POST/GET/DELETE on batch jobs, GET on pods filtered by job-name, and GET on pods/log. placement.ts reads exactly the five FORGE_CHECKS_* variables. JOB_LABELS is forge-check: "true". The "ran as a cluster job on <node>" wording is the string in placement.ts. The Role is least-privilege, and the chart is untouched. There is no UI change, so nothing to break on a phone or without a mouse. Two things I would do next: (1) tighten the drift test: the list and pods/log checks are fixed strings, so a verb dropped from the table but still present in the YAML would pass. Assert the YAML block and the table separately, or parse the rules. (2) Link this page from docs/APPS.md, where placement is described in prose, so an operator finds it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs