chore: fix release.sh so release PRs pass CI, add publish-workflow.sh - #45
chore: fix release.sh so release PRs pass CI, add publish-workflow.sh#45rohan-hotdata wants to merge 2 commits into
Conversation
`release.sh prepare` bumped pyproject.toml and CHANGELOG.md but never relocked. uv.lock records this project's own version and ci.yml installs with `uv sync --locked`, so every release PR the script opened failed CI before it could be reviewed. Reproduced by bumping to 0.3.0 and running `uv lock --locked`: "The lockfile at uv.lock needs to be updated, but --locked was provided." Now runs `uv lock` and commits uv.lock alongside, and requires uv up front rather than failing midway. default_branch() chained `sed` into `||` fallbacks, but sed always exits 0, so neither fallback could ever run. Against a remote with no origin/HEAD it returned the empty string, and the caller then ran `git fetch origin ""`. Verified before and after in a scratch repo: [] -> [main]. Both fixes are taken from hotdata-dlt-destination, which shares this repo's --locked CI. publish-workflow.sh was the one release script missing here; it is byte-identical across the sibling repos and regenerates the checked-in publish.yml exactly (verified by diff). No package code changes, so no CHANGELOG entry.
| [[ -n "$bump" ]] || { usage; die "missing bump kind or explicit version"; } | ||
| need gh | ||
| need python3 | ||
| need uv |
There was a problem hiding this comment.
super nit: prepare now hard-requires uv, but RELEASING.md "One-time setup" only lists gh. Worth adding a line there so someone hitting error: uv is required knows it's expected. (not blocking)
| @@ -0,0 +1,75 @@ | |||
| #!/usr/bin/env bash | |||
| # Generate publish.yml for a package. Usage: publish-workflow.sh hotdata-framework | |||
There was a problem hiding this comment.
super nit: this makes the generator a second source of truth for .github/workflows/publish.yml with nothing keeping the two in sync — a hand-edit to the workflow (e.g. bumping a pinned action SHA) would be silently reverted the next time someone regenerates. A one-line CI check (./scripts/publish-workflow.sh <pkg> | diff - .github/workflows/publish.yml) would catch drift. (not blocking)
prepare now calls need uv, so the one-time setup list was incomplete.
|
Both are fair. Took the first, declined the second — reasoning below. 1. 2. Drift check between the generator and For the record on consistency, since it is the point of the PR: |
Unblocks releasing this repo. No package code changes.
1. Release PRs could not pass CI
release.sh preparebumpedpyproject.tomlandCHANGELOG.mdbut never relocked.uv.lockrecords this project's own version (uv.lock:265), andci.ymlinstalls withuv sync --locked— so the release PR the script opens fails CI before it can be reviewed.Reproduced by bumping a scratch copy to 0.3.0:
preparenow runsuv lockand commitsuv.lockalongside, and callsneed uvup front rather than failing midway through a version bump.2.
default_branch()fallbacks were dead codesedalways exits 0, so neither||branch can ever run. Against a remote with noorigin/HEADthis returns the empty string, and the caller then runsgit fetch origin ""/git checkout ""and fails with an unrelated-looking error.Verified before and after in a scratch repo with a remote that has no refs:
3.
scripts/publish-workflow.shwas missingIt is the generator that emits
publish.yml, and is byte-identical inhotdata-ibis,hotdata-dlt-destinationand the framework repo. Confirmed it regenerates the checked-in workflow exactly:Provenance
Both script fixes are taken from
hotdata-dlt-destination, which shares this repo's--lockedCI, so they are known-correct in this configuration.hotdata-ibisand the framework repo still carry both bugs — the framework'suv lockvariant additionally does[[ -f uv.lock ]] && git add uv.lock, which aborts underset -euo pipefailwhen the lock file is absent, so it is deliberately not the template used here.need uvis the one line taken from ibis.No CHANGELOG entry: nothing user-facing changed, and this keeps the PR conflict-free with #44's changelog edits.