Repository navigation
fix(ci): ignore dev-deps in publish order and stop finalizing immutable releases - #42
Merged
Merged
Conversation
…le releases The 0.31.1 release surfaced two independent failures. Publish crates (run 43747049013, tag 0.31.1): `Verify crate publish order` rejected the supported order because pd-host-function dev-depends on pd-vm. Dev-dependencies are not part of a published crate, so they cannot constrain publish order; only normal and build dependencies do. The ordering logic is now a pure function with unit tests covering dev/normal/build/duplicate/unknown orders, and the live gate passes for `pd-host-function pd-vm pd-vm-nostd rustscript`. CI (run 43747049031, tag 0.31.1): both the pd-vm CLI matrix and the VS Code job uploaded through softprops/action-gh-release, which publishes the release it touches. Once the release is immutable that finalization fails with `tag_name was used by an immutable release`, and concurrent jobs raced to create/update the same release. Each job now ensures the release exists as a draft (tolerating a concurrent creator) and uploads with `gh release upload --clobber`, never publishing it. Upload failures still fail the job; a release that is already published is skipped with a warning.
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.
Summary
Fixes the two failures from the 0.31.1 tag push. No Rust source, version or tag changes.
Publish crates/Verify crate publish orderpd-host-function has a dev dependency on pd-vm, so pd-vm must be published firstRoot cause:
scripts/verify_publish_order.pytreated every entry incargo metadata's dependency list as a publish-order constraint, includingkind == "dev".pd-host-function/Cargo.tomlintentionally dev-depends onpd-vm(trybuild tests), and dev-dependencies are not part of the published package, so they cannot constrain publish order. Onlynormal(reported askind: null) andbuilddependencies do.CI/ release asset uploadtag_name was used by an immutable releaseRoot cause: both
pd-vm-cli(matrix, up to 3 jobs) andvscode-extensionuploaded throughsoftprops/action-gh-release, which publishes the release it touches. Against an already-created release this finalizes it, which immutable releases reject; the concurrent jobs also raced to create/update the same release.Changes
scripts/verify_publish_order.pypublish_order_errors(packages, order); onlynormal/builddependencies constrain order,devis ignored (ORDERING_DEPENDENCY_KINDS).scripts/test_verify_publish_order.py(new)pd-host-functionbeforepd-vm).softprops/action-gh-release, both jobs usegh release upload --clobber, nothing publishes the release..github/workflows/ci.ymlEnsure draft release existsstep per job: reuses an existing release, otherwise creates it with--draft --generate-notes; a lost create race re-reads the release instead of failing, and a real failure exits non-zero.gh release upload "$TAG" <assets> --clobberwithset -euo pipefail; an empty asset glob fails the step instead of passing silently.::warning::annotation and no write. CI never publishes/finalizes; a human publishes the draft last.Verification
python3 -m unittest scripts.test_verify_publish_order scripts.test_publish_crates→ 12 tests, OK.python3 scripts/verify_publish_order.py pd-host-function pd-vm pd-vm-nostd rustscript→crate publish order is valid(the exact 43747049013 command). The pre-fix script still exits 1 with the reported message on the same tree.actionlint .github/workflows/ci.yml→ clean (ci.yml shell blocks also pass shellcheck separately).actionlintonpublish-crates.ymlreports only the pre-existing SC2086 on the unchanged$PACKAGE_ORDERword-splitting line, identical onorigin/master.ghin six states per job: missing release (creates draft,is_draft=true), existing draft, already-published release (warning +is_draft=false), create race/failure (fails closed), upload with assets (--clobber), upload with no assets (fails). All 12 cases as expected.git difftouches only the three files above.