ci: automate release process and harden test workflow#1691
Conversation
- Add concurrency groups to cancel redundant test runs - Trigger tests on v* tags in addition to branches - Add fail-fast: false to test matrices - Create automated release workflow (tag → build → PyPI → GitHub release) - Add Release Drafter for auto-generated changelogs from PR labels - Add Dependabot for weekly dependency updates (grouped)
Fizzadar
left a comment
There was a problem hiding this comment.
Quick drive by review, two security related concerns. Release stuff looks neat will play around with it over the weekend!
| @@ -0,0 +1,41 @@ | |||
| version: 2 | |||
There was a problem hiding this comment.
With all the supply chain attacks right now (and beyond, this feels like the beginning) I feel automating dependency update is high risk, low gain.
Historically legacy setup py meant users got the latest matching major dependency versions but uv changed that to specific versions.
I wonder if we do the delay thing, but that also sucks because if everyone does no one gains anything.
I think this needs discussion, I recommend moving it out of scope for this PR do now and opening a new issue just for that.
- Drop .github/dependabot.yml; defer to a separate discussion/issue per review (supply-chain concerns). - Pin new GitHub Actions references in release.yml and release-drafter.yml to exact commit SHAs (with # version comments) to mitigate tag-hijack attacks.
|
Thanks for the quick review @Fizzadar! Addressed both security concerns in Dependabot : Dropped Pinning new actions to commit SHAs : Pinned every new action reference introduced by this PR to an exact commit, with a trailing
I left the pre-existing actions in |
|
I wonder if we should first decide on if/how we want to adopt Conventional Commits and see how this changes the use of Release Drafter. |
The tag-triggered run had HEAD on the tagged commit, so the script's own tag detection found the new tag itself and produced an empty commit range. The output redirect also always created the file, so the -f check could never fall back and the release body ended up empty. Pass the previous tag explicitly, check for non-empty output and provide GH_TOKEN so the script's gh api attribution lookups work. Also sanity check that the built artifacts carry the tag's version before publishing, guarding against dynamic-versioning misfires.
The category and version-resolver labels mostly did not exist in the repo (api, core, cli, docs, enhancement, bugfix, ...), so nothing would ever be categorised and every release resolved to patch. Use the actual label set (API, CLI, operations, facts, connectors, documentation, dependency issue, new feature, bug); 'breaking' still needs creating. The pull_request trigger does nothing without an autolabeler config and fails on fork PRs where GITHUB_TOKEN is read-only, so remove it along with the now-unneeded pull-requests permission.
Branch and tag pushes should always produce a full test result, release tags especially - a cancelled tag run would leave a release with no test signal.
checkout v5.0.1 -> v6.0.3, setup-python v5.6.0 -> v6.2.0, setup-uv v6.8.0 -> v8.2.0, action-gh-release v2.6.2 -> v3.0.0, release-drafter v6.4.0 -> v7.3.1. All new majors are node24 runtime bumps, drop-in on GitHub-hosted runners; setup-uv v8 also stops publishing major tags and drafter v7 reads the token input (defaults to github.token) so the env block goes. pypi-publish was already at the latest v1.14.0.
|
Pushed a few follow-up commits to harden the release flow and align it with the repo. Summary of what changed: Release changelog extraction and artifact check (
Release Drafter labels (
Test workflow concurrency (
Action pins (
|
Automates the release pipeline and tightens the existing test workflow.
Release automation
release.yml: pushing av*tag builds withuv build, checks the artifact versions match the tag, publishes to PyPI via trusted publishing (OIDC,releaseenvironment), then creates a GitHub release.scripts/generate_changelog.py, run against the previous tag, withghattribution for external contributors. It falls back toRelease vX.Y.Zif the script produces nothing.API,CLI,operations,facts,connectors,documentation,dependency issue,new feature,bug). Abreakinglabel needs creating before it can drive major bumps.Test workflow
v*tags.fail-fast: falseon both test matrices, so one failing job does not hide the results of the others.Security
Setup needed before this works
releaseGitHub environment and configure the PyPI trusted publisher for this repo and workflow.breakinglabel for major version resolution.3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)