Repository navigation
ci: take the template's release, publish and gate fixes - #51
Merged
Merged
Conversation
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.
mattermind was rendered from python-library-template before the template's recent release and CI fixes, so it still has the old publish, gate and release workflows. This brings them over by hand, taking the text of a render of the template at
d9d0a6fand changing only the names.Publish (bedrock-python/python-library-template#18, bedrock-python/python-library-template#24). The
checkjob now decides what reaches PyPI. The dispatchtaginput is only data: it reaches the shell throughenv:, has to match the release tag pattern, exist, and point at a commit on master. The publish job checks out the SHA thatcheckresolved, not the tag.checkwaits for the CIpushrun on that SHA and refuses anything that did not pass. The "Set version from release tag" step is gone: the tag's version has to match the committed one, and a mismatch now stops the release with both values instead of being overwritten.id-token: writemoved from the workflow to the publish job. Beforeuv publish,pypi-attestations signcreates PEP 740 attestations.uv publishwas already called without file arguments, so it picks up the.attestationfiles.One addition beyond the template: mattermind keeps a static
versioninpyproject.toml, and that is what hatch builds with. In the template the version comes from__version__.pythrough[tool.hatch.version]. Release Please bumps both files here, but checking only__version__.pywould leave the version that actually ships unchecked. The worst case is a tag on a commit whosepyproject.tomlstill has the previous version:--check-urlwould skip that upload and the run would end green with nothing published. So the step compares the tag withpyproject.tomltoo. That is five lines after the template's own check, plus the comment above the step. Making the version dynamic, as the template does, would also remove the duplication, but that is a packaging change and out of scope here.Gate (bedrock-python/python-library-template#19).
All checks passedused to fail only onfailureorcancelled, so a skipped job counted as passed. Now every job inneedshas to endsuccess.needsis still[lint, test].MAY_SKIPis[]: neither job has anif:, so neither is skipped by design on any event.Release Please (bedrock-python/python-library-template#23). It uses a token from the org's release App when
RELEASE_PLEASE_APP_CLIENT_IDis set, so CI starts on the release PR without a close and reopen. Until the App exists it falls back toGITHUB_TOKENand the run shows a warning. The config and manifest inputs are unchanged.Answers file (bedrock-python/python-library-template#21).
.copier-answers.yml, written by hand in the rendered format at_commit: d9d0a6f, socopier updatehas something to start from.Two small template fixes to
docs.ymlcame along: thepagesconcurrency group, so two quick pushes don't race onto Pages, and--lockedon the docs sync (uv lock --checkis clean on master).Local evidence
actionlint(actionlint-py, with shellcheck) is clean on all four workflows, apart from the two known findings aboutclient-idoncreate-github-app-token@v3. Those come from actionlint's outdated bundled metadata for that action.The "Resolve the release tag" step, taken from this branch's
publish.ymland run withbash -eo pipefailin a throwaway repo with a bareorigin, using mattermind's realpyproject.tomland__version__.py:Not ported
--no-dev --group docson the docsuv runsteps: the template's dev and docs dependencies are groups. Here they are extras, anduv rundoes not install thedevextra, so there is nothing to fix.test-integrationjob and Codecov upload: mattermind's integration tests need a real Mattermost and LLM, so leaving them out of CI is deliberate, and the Codecov upload is a feature rather than a fix.ci.ymldiffers because of the library's own layout (src/, extras, Python 3.12 to 3.14, an 80% coverage floor), not because a fix is missing.