Skip to content

ci: run the shared publish gates before the PyPI upload - #70

Merged
NaNIsaac merged 1 commit into
mainfrom
ci/publish-gates
Nov 16, 2026
Merged

NaNIsaac merged 1 commit into
mainfrom
ci/publish-gates

Conversation

@NaNIsaac

Copy link
Copy Markdown
Owner

publish.yml now calls the shared publish-gates.yml from NaNIsaac/.github, pinned to commit e2bfb9b4aa7820e8efe43afddf2d2308c6069ae3 (the first with leak-allow), before the PyPI upload. The upload stays in the pypi job with the release environment, so the PyPI Trusted Publisher registration is unchanged; the mcp job still follows pypi.

  • gates job, on Python 3.15 as before: build the sdist and wheel once; run the CI test steps (sudo apt-get install -y -qq zsh && uv run --with pytest pytest -q); scan the built files for credential file names, files over 5 MB, home-folder paths and secrets; install the wheel alone in a clean venv, import codigest, compare the installed version with the tag and run codigest --help. The publish job had no tag check before; the install check is that now.
  • pypi job: needs gates, runs only on a v* tag, and uploads the files the gates checked (artifact publish-gates-dist) instead of building again.
  • workflow_dispatch runs the gates alone. pypi is skipped there, and mcp with it.

One leak-allow entry: codigest/core/redact.py: private-key: 2. gitleaks reports the redaction module's PEM private-key pattern and mask templates as private-key; they hold no key material. The 4 lines it excuses, 2 per copy:

  • codigest-0.14.1.tar.gz/codigest-0.14.1/src/codigest/core/redact.py:54
  • codigest-0.14.1.tar.gz/codigest-0.14.1/src/codigest/core/redact.py:59
  • codigest-0.14.1-py3-none-any.whl/codigest/core/redact.py:54
  • codigest-0.14.1-py3-none-any.whl/codigest/core/redact.py:59

The path is codigest/core/redact.py, not src/...: the wheel has no src/ folder, and the suffix match covers both copies. A third private-key hit in that file, or one fewer, fails the gates.

GitHub only offers workflow_dispatch for a workflow file on the default branch, so the gates-only run can be started once this is on main: gh workflow run publish.yml -R NaNIsaac/codigest.

local-ci: e011613 | the pinned gates' leak step on a local 0.14.1 build with this entry: 4 allowed lines, no other findings, exit 0; the wheel installed alone in a Python 3.15 venv imports as 0.14.1 and codigest --help exits 0 | the test suite not run locally (the PR's Tests workflow runs it), the workflow itself not run (dispatch needs the file on main)

Part of: PUBLISH-GATES-ROLLOUT

@NaNIsaac
NaNIsaac merged commit 2dd5b80 into main Nov 16, 2026
3 checks passed
@NaNIsaac
NaNIsaac deleted the ci/publish-gates branch November 16, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant