Skip to content

ci: hash-pin the shipped surface: templates and action.yml (Part of #4918) - #4931

Merged
squid-protocol merged 3 commits into
mainfrom
churn/4918-20261011T2108Z
Oct 11, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
churn/4918-20261011T2108Z

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Part of #4918 (step 1 only: the shipped surface; steps 2-4 are not here).

  • templates/requirements/{core,yaml,full}.txt: uv pip compile --universal --generate-hashes lockfiles pinned to gitgalaxy 2.11.0 (+ PyYAML, tiktoken, xgboost, pandas, numpy and transitive deps), valid on every OS / Python >= 3.10. Regenerate with tests/tools/pin_shipped_requirements.sh, then stamp templates with tests/tools/stamp_template_pins.py.
  • action.yml installs with --require-hashes from ${GITHUB_ACTION_PATH}/templates/requirements/ (the action's own checkout).
  • The five templates (GitHub, GitLab, scan.yml component, Azure, Bitbucket) run in a customer repo or a remote component, so they do NOT read the workspace. Each install step: downloads <set>.txt from raw.githubusercontent.com/.../gitgalaxy/${GG_REF}/templates/requirements/ to /tmp, runs sha256sum -c against GG_SHA256, then pip install --require-hashes -r. One marker line per install (GG_REF=<commit> GG_SHA256=<sha> # gg-pin:<set>) holds both values; the stamp script rewrites them all. No install depends on a prior checkout, so step order no longer matters (Azure/GitHub installs before checkout are fine).
  • version: latest means the pinned release; an explicit version is exact-pinned but not hash-verified. Dropped the unpinned pip install --upgrade pip.
  • tests/core_engine/test_shipped_pip_pins.py (22 tests): lockfiles exact + hashed; pins agree; no unpinned install in any shipped file; action uses GITHUB_ACTION_PATH; every template download is a pinned raw URL with a sha256 check before pip, never a workspace path; markers match the committed lockfiles' sha256 and share one ref.

Evidence: fetched full.txt from the real raw URL at the stamped ref and sha256sum -c passed; ran the scan.yml fetch+verify+install snippet against a Python 3.12 venv (installed with hashes, imports ok); bash -n on both GitLab blocks; all six YAML files parse. pr_gates --fast 5/5, --ratchets 7/7 (merged origin/main first). Not tested: Python 3.10, real CI runs of each template.

Open items:

  • Ref is not a release. GG_REF is the commit 1c0805a80 on this PR's branch (where the lockfiles were first pushed). It is immutable on GitHub, but if the squash merge makes it unreachable the downloads 404. After merge/tag, re-point: run stamp_template_pins.py <merge-or-tag-sha> in a follow-up (the sha256 is unchanged, so integrity holds either way).
  • templates/github/gitgalaxy-pipeline.yml still has squid-protocol/[email protected] for three jobs; bump after the release that contains the lockfiles.
  • An explicit version with full still resolves transitive deps unhashed.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…ify its sha256 (Part of #4918)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 11, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 11, 2026 21:27
@squid-protocol
squid-protocol enabled auto-merge (squash) October 11, 2026 21:27
@squid-protocol
squid-protocol merged commit 37e7187 into main Oct 11, 2026
26 checks passed
@squid-protocol
squid-protocol deleted the churn/4918-20261011T2108Z branch October 11, 2026 21:39
squid-protocol added a commit that referenced this pull request Oct 12, 2026
…inned_install rule (Part of #4918) (#4942)

* ci: re-stamp template GG_REF to the #4931 merge commit; document v2.4.0 action bump and pre-full-extra versions (Part of #4918)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: hash-pinned install sets for our own workflows + Dependabot; pip-install gate; SHA-pin remaining uses (Part of #4918)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* security: unpinned_install rule for YAML pipelines, surfaced in SARIF as GG-SAST-UNPINNED_INSTALL (Part of #4918)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* security: pipeline_pins mypy fix (Part of #4918)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* tests: bless golden SARIF snapshots for the new GG-SAST-UNPINNED_INSTALL rule (+82 results on corpus YAML, nothing removed) (Part of #4918)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* tests: pr_gates reads the ruff pin from ci/requirements/lint.in now that the workflow installs the hashed set (Part of #4918)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant