infra_wiki

Test a change

Run the local check for each kind of change before you open a pull request, with the CI workflow that runs the same check.

Use this runbook before you open a pull request. It gives the local command for each kind of change and the CI workflow that runs the same check.

note

Each CI workflow starts only for the paths in its filter. A path that no filter lists runs no check, and the pull request still shows green.

Before you start#

  • Run mise install and bun install from the repository root.
  • For a Nix change, run mise run devshell.
  • mise tasks ls lists every task. If a task exists for a check, use the task.

Test the change#

You changedCommandCI workflow
docs/, a .md file, or .agents/mise run docs:checkwiki.yml
apps/wiki/bun run --cwd apps/wiki test, then mise run docs:buildwiki.yml
nix/, flake.nix, flake.lock, or a topology JSON filemise run nix:checknix-ci.yaml, which builds only after the merge to main
clusters/ or packages/charts/mise run k8s:render-apps, then mise run k8s:check-ruleskustomize.yml
One directory under clusters/<site>/ with a kustomization.yamlkubectl kustomize clusters/<site>/<dir>None
clusters/<site>/config/cluster-topology.jsonconftest verify -p .github/policy, then the conftest test command in topology-contract.ymltopology-contract.yml
A .tf or .terraform.lock.hcl fileThe local checks in Apply an OpenTofu changeterraform.yml
A .tftest.hcl filemise run tf:init, then tofu -chdir=<root> testterraform.yml
TypeScript in apps/ or packages/mise run ts:check, then bun run testtypescript.yml, if its changed-files list names the path
A Go module in apps/go -C apps/<app> vet ./..., then go -C apps/<app> test ./...go.yml, rackstat.yml or view-counter.yml, if one of them lists the module
apps/fml-pki/ or terraform/pki/certs/mise run pki:verifygo.yml
apps/fml-derive-rs/ or apps/fml-ceremony/mise run rust:test, then mise run pki:crosscheckrust.yml
A shell script in scripts/ or .github/scripts/mise run checkshell.yml
.github/scripts/validation-impact.shmise run validation-impact:testterraform.yml
.github/scripts/cd-*.sh, .github/scripts/detect-containers.sh, .github/scripts/image-affected.sh, .github/containers.json or .github/workflows/containers.ymlmise run cd-digest:testcontainers.yml
  1. List the files that the branch changes.

    git diff --name-only main...HEAD

    Result: One changed file on each line.

  2. Find the Nix check and the OpenTofu directories that CI checks for these files.

    git diff --name-only main...HEAD | .github/scripts/validation-impact.sh targets

    Result: nix:flake-check, one terraform:<dir> line for each root or module that the change affects, or no output.

  3. For each row of the table that matches a changed file, run its command from the repository root.

    Result: Each command completes without an error. docs:check prints ok after each check.

  4. If you changed docs/, search the pages for secret values.

    grep -rn -i -E -e 'BEGIN [A-Z ]*PRIVATE KEY' -e '(password|secret|token) *[:=] *[^ <$]' docs

    Result: Each line that can hold a secret.

  5. Make sure that no line from step 4 holds a secret value.

If something goes wrong#

SymptomCauseAction
docs:check prints MISSING and a path.A page names a repository path that does not exist.Correct the path in the page.
docs:check prints BROKEN, a file and a wiki reference.The file points at a page path that the wiki does not serve. The wiki has no redirects.Point the reference at the current path of the page.
docs:check prints past tense in docs.A page describes history.Describe the current state.
bun run test cannot connect to Postgres.The kthx tests in apps/kthx-engine/ need a database.Set DATABASE_URL, as apps/kthx-engine/README.md describes.
mise tasks ls exits with an error.mise does not trust the configuration of the checkout.Run mise trust.

Edit on GitHub

↑↓ move ↵ open esc close