diff --git a/prompts/REPO_POLICIES.md b/prompts/REPO_POLICIES.md index 7a64308..ad06d01 100644 --- a/prompts/REPO_POLICIES.md +++ b/prompts/REPO_POLICIES.md @@ -231,9 +231,9 @@ Use `yarn`, not `npm`. no node and no yarn there. The stages in the `prompts` repo's `examples/go.Dockerfile` and `examples/python-test-phase.Dockerfile` are such stages. -- It installs the node packages with `yarn install --immutable`, which fails - when a package's `checksum` is wrong, or when `package.json` is out of step - with `yarn.lock`. +- `script/bootstrap` installs the node packages with `yarn install --immutable`, + which fails when a package's `checksum` is wrong, or when `package.json` is + out of step with `yarn.lock`. - Each repository commits the yarn that runs. `yarnPath` in `.yarnrc.yml` points at the release file in `.yarn/releases/`. The distribution's yarn only starts that file, and that file does the work. So Alpine's yarn 1 and Debian 13's @@ -353,9 +353,9 @@ What each stage installs: running `script/bootstrap`. Only system packages may be installed inline above it, so that check builds keep them; the `prompts` repo's own `Dockerfile` does this. -- A stage that runs `script/bootstrap` first COPYs `script/` and the dependency - manifests it needs: `go.mod` and `go.sum`, for example, or the four yarn files - named above. +- A stage that runs `script/bootstrap` COPYs `script/` and the dependency + manifests it needs before running it: `go.mod` and `go.sum`, for example, or + the four yarn files named above. ## Docker's cache @@ -442,10 +442,13 @@ Key points: ## Python `test` phase **A Python `test` phase that installs its packages from `Pipfile.lock` does it -before `COPY . .`, so check builds keep them.** The steps are -`COPY script/ script/`, `COPY Pipfile Pipfile.lock ./` and -`RUN script/bootstrap`. Docker keeps what that `RUN` installed until one of -these changes: +before `COPY . .`, so check builds keep them.** The steps are: + +- `COPY script/ script/` +- `COPY Pipfile Pipfile.lock ./` +- `RUN script/bootstrap` + +Docker keeps what that `RUN` installed until one of these changes: - the base image - `script/` @@ -499,8 +502,9 @@ checked for it covers them. System packages, Python among them, are not fixed by a hash. They keep the versions the package manager gave when the layer was built; a new install may get newer ones. -As with Go's modules, the packages are kept in a layer, not a cache mount, which -every build on the host shares and nothing checks again. +As with Go's modules, the packages are kept in a layer, not a cache mount. A +cache mount is shared by every build on the host, and nothing checks its files +again. A Python repository's `script/bootstrap` adds these lines in `main`, above the last `echo`. The `ensurepip` test fails when python is missing, and also when @@ -529,7 +533,7 @@ In `examples/python-test-phase.Dockerfile`, `script/bootstrap` finds `make`, `git`, python and venv already installed. The Python `test` phase example is at `https://git.eeqj.de/sneak/prompts/raw/branch/main/examples/python-test-phase.Dockerfile`. -Run from a `make test` target on a host, the test command in +A `make test` target on a host that runs the command in `examples/python-test-phase.Dockerfile`: - does not stop on Ctrl-C. It goes on until the tests end or the 90 seconds run @@ -547,8 +551,8 @@ Run from a `make test` target on a host, the test command in (`v1.2.3-4-gabc1234`), on a later commit - the short commit, when no tag is reachable -The stage that compiles derives it from the `.git` in the build context, as the -`prompts` repo's `examples/go.Dockerfile` shows: +The stage that compiles derives the version from the `.git` in the build +context, as the `prompts` repo's `examples/go.Dockerfile` shows: - It takes the version from the `VERSION` build argument when one is given, otherwise from `git describe`. `ARG VERSION` is declared in that stage, @@ -633,8 +637,8 @@ The workflow sets these: - **`script/cibuild` runs `script/bootstrap` first**, because the workflow checks out the repo and runs nothing else, while `script/fmt-check` runs the - formatter on the host. Without it, a pristine checkout dies there, after the - containerised gates have passed. + formatter on the host. On a pristine checkout with nothing installed, the run + dies there, after the containerised gates have passed. - Its three Docker builds are the test phase, the lint phase, then the image. So a successful run means every check passed. - The image build reuses the gate phases that the check has just built.