Skip to content

fix(ci): ignore dev-deps in publish order and stop finalizing immutable releases - #42

Merged
fffonion merged 1 commit into
masterfrom
subagent/rustscript-ci-fix-20261117
Nov 16, 2026
Merged

fffonion merged 1 commit into
masterfrom
subagent/rustscript-ci-fix-20261117

Conversation

@fffonion

Copy link
Copy Markdown
Collaborator

Summary

Fixes the two failures from the 0.31.1 tag push. No Rust source, version or tag changes.

  • run 43747049013 — Publish crates / Verify crate publish order
    pd-host-function has a dev dependency on pd-vm, so pd-vm must be published first
    Root cause: scripts/verify_publish_order.py treated every entry in cargo metadata's dependency list as a publish-order constraint, including kind == "dev". pd-host-function/Cargo.toml intentionally dev-depends on pd-vm (trybuild tests), and dev-dependencies are not part of the published package, so they cannot constrain publish order. Only normal (reported as kind: null) and build dependencies do.
  • run 43747049031 — CI / release asset upload
    tag_name was used by an immutable release
    Root cause: both pd-vm-cli (matrix, up to 3 jobs) and vscode-extension uploaded through softprops/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.py

  • Ordering logic extracted into publish_order_errors(packages, order); only normal/build dependencies constrain order, dev is ignored (ORDERING_DEPENDENCY_KINDS).
  • Behaviour for duplicate/unknown package names and error text unchanged.

scripts/test_verify_publish_order.py (new)

  • Dev-dependency on a later-published crate is valid (pd-host-function before pd-vm).
  • Normal and build dependencies published later are still rejected; duplicate and unknown names rejected.
  • Workflow contract: no softprops/action-gh-release, both jobs use gh release upload --clobber, nothing publishes the release.

.github/workflows/ci.yml

  • New Ensure draft release exists step 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.
  • Upload step uses gh release upload "$TAG" <assets> --clobber with set -euo pipefail; an empty asset glob fails the step instead of passing silently.
  • Draft-state intent kept: assets are only attached while the release is a draft; an already-published (immutable) release is skipped with a ::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). actionlint on publish-crates.yml reports only the pre-existing SC2086 on the unchanged $PACKAGE_ORDER word-splitting line, identical on origin/master.
  • Release steps executed from the workflow YAML against a stubbed gh in 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.
  • Not run: Cargo build/test, an actual publish, tag changes. git diff touches only the three files above.

…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.
@fffonion
fffonion merged commit 4ed15d3 into master Nov 16, 2026
8 checks passed
@fffonion
fffonion deleted the subagent/rustscript-ci-fix-20261117 branch November 16, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant