Repository navigation
ci: take the template's release, publish and gate fixes - #122
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pg-partsmith was rendered from python-library-template before these template fixes landed, so they are copied in by hand here, as the template renders them now (
d9d0a6f) with only the names changed.Publish (bedrock-python/python-library-template#18).
checknow decides what is released instead of trusting the tag. It accepts only a release tag on master.inputs.tagreaches the shell throughenv:and is matched against^(pg-partsmith-)?v..., and the version in the tag has to equal__version__inpg_partsmith/__version__.pyat the tagged commit. Then the step waits for thepushCI run on that SHA and requires it to succeed.checkoutputstagandsha, and every job that checks out code (image,publish,verify) now checks out the SHA rather than the tag, so moving the tag mid-run changes nothing.checkgetscontents: read+actions: read,timeout-minutes: 60andworkflow_run.event == 'push'in itsif.id-token: writewas already job-level here (publish, andtagsfor cosign), so nothing moved there. The multi-arch image, Trivy, SBOM/provenance, the push by digest, signing, tags after PyPI and the e2e run against the published image are all unchanged. One knock-on edit:imagederived the version with${TAG#pg-partsmith-v}. Sincechecknow also accepts the barev1.2.3form, it strips both prefixes the waycheckdoes. Otherwise a bare tag would label and tag the imagev1.2.3.Attestations (bedrock-python/python-library-template#24).
pypi-attestations signruns beforeuv publish, with the template's comment on whyuv publishtakes no file arguments. This library already called it without any, so only the sign step and the comment are new.Gate (bedrock-python/python-library-template#19).
All checks passednow requiressuccessfrom every job it needs.needsis unchanged (all eight jobs).MAY_SKIP: '["dependency-review"]', because that job isif: github.event_name == 'pull_request'and is skipped on every push to master. No other job in ci.yml has anif:. Under the old step a skipped job counted as passed.Release Please (bedrock-python/python-library-template#23). The release PR is opened with the org release App's token when
RELEASE_PLEASE_APP_CLIENT_IDis set, so its CI starts without a close and reopen. Without it, the workflow falls back toGITHUB_TOKENand the run shows a warning. The config/manifest inputs stay as they were.Copier answers (bedrock-python/python-library-template#21).
.copier-answers.ymlis written by hand at_commit: d9d0a6f, socopier updatecan reach this repo from now on.actionlint config. The lint job runs
rhysd/actionlint:1.7.12, and its bundled metadata foractions/create-github-app-tokenpredatesclient-id(v3 declares it and deprecatesapp-id; see #23)..github/actionlint.yamlignores exactly those two messages, only inrelease-please.yml. Without it, the lint job fails on this PR.Evidence
actionlint 1.7.12 with shellcheck, both
uvx --from actionlint-py actionlintand therhysd/actionlint:1.7.12container CI uses: clean. Without the new config, the container run exits 1 on the twoclient-id/app-idfindings.The "Resolve the release tag" step, extracted from this
publish.ymland run withbash -eo pipefailin a throwaway repo with a bareorigin:Against this repo's own history,
pg-partsmith-v1.9.0resolves tob9e51ffon both triggers (the# x-release-please-versioncomment after the version is handled).The gate step, run the same way with this repo's eight jobs:
Not ported
docs.ymlmatches the render, and everything else inci.ymlis this library's own.The
pypienvironment already admits master only (custom branch policymaster), so the master check incheckis the readable error in front of a boundary that exists.