Supply chain: dev tool pins have no hashes, and pre-commit hooks are pinned by tag #113

Open
opened 2026-11-14 10:04:58 +00:00 by Dragonish · 3 comments
Collaborator

Two small supply-chain observations on the dev tooling. Neither is urgent and neither
is a bug; I'm raising them as a decision, because the fix touches CI image inputs and
that is yours to schedule.

What I found

  1. requirements-dev.txt pins the six direct tools with == but has no hashes and no
    constraints file.
    Their transitive dependencies resolve fresh on every install
    (scripts/dev-setup.sh locally, and the slow path in lint.yml/build.yml when a PR
    changes the pin files).
  2. .pre-commit-config.yaml pins hook repos by tag (rev: v8.30.1, v1.7.12, ...).
    Tags can be moved. pre-commit install --install-hooks builds the code at that tag, on
    a contributor's machine and in the ci image build.

Why it might matter

Lint and Build only use the baked tools while the pin files match the ci image; any PR
that edits them makes the job pip install from PyPI inside the job container. Hashes
would make that path reproducible. SHA-pinned hook revisions would make a moved tag
visible instead of silent.

Possible fix (for you to judge)

  • pip-compile --generate-hashes into a lockfile, and pip install --require-hashes.
  • rev: set to commit SHAs (Renovate's pre-commit manager can keep # frozen: vX.Y.Z
    comments updated).

Both are inputs of the ci/molecule images, so they follow the two-PR loop in CONTRIBUTING.md
(image version bump, rebuild on main, then the digest pin PR). That is why I have not
opened a PR for it.

Not in scope

scripts/dev-setup.sh itself looks sound: it derives the repo from its own location,
restores core.hooksPath on interruption, and limits rm -rf to the clone's .venv.

Happy to help with a PR if you want one; tell me which of the two (or both) you prefer.

Two small supply-chain observations on the dev tooling. Neither is urgent and neither is a bug; I'm raising them as a decision, because the fix touches CI image inputs and that is yours to schedule. ## What I found 1. **`requirements-dev.txt` pins the six direct tools with `==` but has no hashes and no constraints file.** Their transitive dependencies resolve fresh on every install (`scripts/dev-setup.sh` locally, and the slow path in `lint.yml`/`build.yml` when a PR changes the pin files). 2. **`.pre-commit-config.yaml` pins hook repos by tag** (`rev: v8.30.1`, `v1.7.12`, ...). Tags can be moved. `pre-commit install --install-hooks` builds the code at that tag, on a contributor's machine and in the ci image build. ## Why it might matter Lint and Build only use the baked tools while the pin files match the ci image; any PR that edits them makes the job `pip install` from PyPI inside the job container. Hashes would make that path reproducible. SHA-pinned hook revisions would make a moved tag visible instead of silent. ## Possible fix (for you to judge) - `pip-compile --generate-hashes` into a lockfile, and `pip install --require-hashes`. - `rev:` set to commit SHAs (Renovate's `pre-commit` manager can keep `# frozen: vX.Y.Z` comments updated). Both are inputs of the ci/molecule images, so they follow the two-PR loop in CONTRIBUTING.md (image version bump, rebuild on main, then the digest pin PR). That is why I have not opened a PR for it. ## Not in scope `scripts/dev-setup.sh` itself looks sound: it derives the repo from its own location, restores `core.hooksPath` on interruption, and limits `rm -rf` to the clone's `.venv`. Happy to help with a PR if you want one; tell me which of the two (or both) you prefer.
Author
Collaborator

Opened #124 for both halves: SHA-pinned hook revisions and a hashed lock (requirements-dev.lock, installed with --require-hashes). Open point for you in the PR: Renovate cannot regenerate the lock, so pip bumps need scripts/lock-requirements.sh until that is wired (or accepted as manual).

Opened #124 for both halves: SHA-pinned hook revisions and a hashed lock (requirements-dev.lock, installed with --require-hashes). Open point for you in the PR: Renovate cannot regenerate the lock, so pip bumps need scripts/lock-requirements.sh until that is wired (or accepted as manual).
Owner

@Dragonish didnt you close this already?

@Dragonish didnt you close this already?
Owner

This looks already shipped: the hashed requirements-dev.lock and SHA-pinned hooks landed in #124. Recommend the maintainer closes it. (From Order of the implementation backlog, #198.)

This looks already shipped: the hashed `requirements-dev.lock` and SHA-pinned hooks landed in #124. Recommend the maintainer closes it. (From Order of the implementation backlog, #198.)
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#113