Skip to content

chore: pin docker images and npm deps with CI enforcement#117

Merged
CaseyHoover merged 2 commits intomainfrom
feat/pin-deps-with-ci-enforcement
May 9, 2026
Merged

chore: pin docker images and npm deps with CI enforcement#117
CaseyHoover merged 2 commits intomainfrom
feat/pin-deps-with-ci-enforcement

Conversation

@CaseyHoover
Copy link
Copy Markdown
Owner

Closes #106.

Summary

  • Pin postgres base image to 17.9-alpine (the floating 17-alpine tag was the same class of risk as the node:26-slim rebuild that hung CI on PRs docs: add bug report and feature request issue templates #99/chore(devcontainer): only install chromium for playwright #100/ci: cap every workflow job at 10 minutes #102).
  • Convert every package.json range from ^ to ~, anchored to the version that was actually installed pre-change (manifest bumps for tsup, tsx, openapi-typescript, recharts). No top-level resolved versions changed in pnpm-lock.yaml.
  • New scripts/check-pinning.mjs walks all package.json, Dockerfile, and docker-compose*.yaml files. Rejects ^, *, latest, bare-major (~25), and floating Docker tags (17-alpine). Allows exact pins, ~major.minor.patch, workspace:*/link:/file:/npm: aliases (alias version is also checked), git/http URLs, and @sha256:… digests.
  • Wired into CI as pnpm lint:pinning ahead of the main lint step.
  • Policy documented in AGENTS.md.

GitHub Actions are already SHA-pinned and enforced at the repo-settings level ("Require actions pinned to SHA"), so no extra lint is needed there.

Test plan

  • pnpm lint:pinning passes on this branch
  • pnpm lint, pnpm build, pnpm format:check all green
  • Verified the linter catches ^, *, latest, ~25, npm:foo@^1.2.3, postgres:17-alpine, node:26-slim, untagged images
  • Verified the linter accepts ~1.2.3, 1.2.3, ~1.2.3-rc.1, workspace:*, npm:foo@~1.2.3, postgres:17.9-alpine, @sha256:…
  • CI run on PR
  • Confirm Dependabot still produces minor/patch PRs after the range tightening

🤖 Generated with Claude Code

Closes #106. Two recent CI breakages traced to upstream rebuilds of
floating tags motivated a no-floating-refs stance across the repo.

- Pin postgres base image to major.minor (17.9-alpine).
- Convert all package.json ranges from `^` to `~`, anchored to the
  currently-resolved version so installs don't downgrade. Bumps
  manifests for tsup, tsx, openapi-typescript, and recharts to match
  the lockfile.
- Add scripts/check-pinning.mjs to enforce both rules; wire it into
  CI as `pnpm lint:pinning`.
- Document the policy in AGENTS.md.

GitHub Actions are already SHA-pinned and enforced via the repo's
"Require actions pinned to SHA" setting, so no extra lint there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread scripts/check-pinning.mjs Fixed
CodeQL flagged js/redos on the inner `([.+-][A-Za-z0-9._+-]+)*` group:
the prefix character set overlapped the inner character set, so a string
like "0.0+++++..." had exponentially many parses.

Replace the unbounded suffix repetition with a single optional run
`(?:[._-][A-Za-z0-9._-]*)?`. No matchable tag changes — `17.9-alpine`,
`17.9.1-alpine`, `20.0-bookworm-slim`, and `@sha256:…` digests all still
accept; `17-alpine`, `latest`, and untagged images still reject.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CaseyHoover CaseyHoover enabled auto-merge May 9, 2026 19:12
@CaseyHoover CaseyHoover merged commit 12e625f into main May 9, 2026
6 checks passed
@CaseyHoover CaseyHoover deleted the feat/pin-deps-with-ci-enforcement branch May 9, 2026 19:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

🎉 This PR is included in version 1.0.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Pin docker images and npm dependencies to a minor version, with CI enforcement

2 participants