Skip to content

fix(ci): skip crates.io package/publish while the crate is unpublishable - #160

Merged
senamakel merged 1 commit into
mainfrom
fix-release-2026-08-30
Aug 30, 2026
Merged

fix(ci): skip crates.io package/publish while the crate is unpublishable#160
senamakel merged 1 commit into
mainfrom
fix-release-2026-08-30

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

Release run 33327821333 (gh workflow run release.yml --ref main -f bump=patch) failed in the Package crate step:

error: failed to verify manifest at `/home/runner/work/tinycortex/tinycortex/api/Cargo.toml`

Caused by:
  all dependencies must have a version requirement specified when packaging.
  dependency `tinymemory-api` does not specify a version

Root cause

  • cargo package --locked (no -p) packages every workspace default-member — [".", "api"] per Cargo.toml — so it also tries to package api/. api/Cargo.toml's tinymemory-api dependency is a bare git reference with no version key, and cargo refuses to package anything whose dependency graph contains an unpublished git/path dependency without a version requirement.
  • Scoping to -p tinycortex alone doesn't fix it either — I reproduced that locally too (cargo package -p tinycortex --lockedno matching package named 'tinycortex-api' found). Both tinycortex and tinycortex-api already carry publish = false in their Cargo.tomls, exactly because this same git dependency (tinymemory-api, tracked as tinymemory#18 §A1) makes crates.io publishing genuinely impossible right now — this is documented, pre-existing, and deliberate, not a regression. This was simply the first release run ever triggered against this workflow, so it had never been exercised end-to-end.
  • This differs from the sibling tinyagents release failure (which failed earlier, in "Compute next version", because a workspace-inherited version wasn't literally greppable). Here "Compute next version" succeeds fine — cargo metadata resolves tinycortex's version correctly. The failure is entirely about cargo package/cargo publish being run against a crate graph that isn't publishable yet.

Fix

.github/workflows/release.yml: add a Check crates.io publishability step that reads the resolved publish field for $CRATE_NAME via cargo metadata --no-deps --format-version 1 | jq, and gate the Package crate / Publish to crates.io steps on it being publishable (publish is null, not []). While it's publish = false, those two steps are skipped (with a ::notice::) instead of hard-failing the whole release — which also means the version-bump commit and git tag still get pushed, since "Push release commit and tag" runs unconditionally. Also scoped both cargo package/cargo publish invocations to -p "$CRATE_NAME" so api/ (never meant to be published by this workflow) isn't swept in once packaging does become possible.

Verification

Ran locally in the checkout:

  • cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name=="tinycortex") | .publish'[], matching the new skip condition.
  • cargo package -p tinycortex-api --locked and cargo package -p tinycortex --locked both reproduce the exact CI failure locally (manifest verification error / unresolvable tinycortex-api on crates.io respectively), confirming root cause.
  • cargo package --list -p tinycortex --locked succeeds and lists only the root crate's files.
  • Did not run the test suite per task scope (build/tests already pass on main; this is a workflow-only fix).

Test plan

  • Re-run gh workflow run release.yml --ref main -f bump=patch after merge and confirm the release job completes: version bump, tag, and push succeed, and "Package crate"/"Publish to crates.io" are skipped with the new notice (until tinymemory#18 §A1 makes the crate genuinely publishable).

Run 33327821333 failed in the "Package crate" step: `cargo package
--locked` (no `-p`) packages every workspace default-member, including
`api/`, whose `tinycortex-api` depends on `tinymemory-api` by git rev
with no `version` key -- cargo refuses to package any crate whose
dependency graph has an unpublished git/path dependency without a
version requirement.

Scoping to `-p tinycortex` alone doesn't fix it either: both
`tinycortex` and `tinycortex-api` are already marked `publish = false`
in their Cargo.toml, precisely because this same git dependency makes
crates.io publishing impossible right now (tracked as tinymemory#18
section A1). This is a known, documented, pre-existing state, not a
regression -- this was simply the first release run ever triggered
against it.

Add a "Check crates.io publishability" step that reads the resolved
`publish` field for $CRATE_NAME via `cargo metadata` and skips the
"Package crate" / "Publish to crates.io" steps when it is `[]`
(publish = false), while still completing the version bump, tag, and
push. This also stops packaging from failing on an unrelated workspace
member (`api/`) that was never meant to be published by this
workflow, by scoping both cargo invocations to `-p "$CRATE_NAME"`.

Verified locally: `cargo metadata --no-deps --format-version 1 | jq
-r '.packages[] | select(.name=="tinycortex") | .publish'` returns
`[]`, matching the skip condition; `cargo package -p tinycortex-api
--locked` and `cargo package -p tinycortex --locked` reproduce the
exact CI failure locally, confirming the root cause.

Ref: https://github.com/tinyhumansai/tinycortex/actions/runs/33327821333

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 21 days. After that, they cost $0.25 per reviewed file.

Or wait 35 minutes for your next included review.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06482dbd-8283-4a9c-8e00-8e5cd2a6a769

📥 Commits

Reviewing files that changed from the base of the PR and between 149b70a and 31f52d4.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T18:34:55.090980Z 31f52d4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

$0.0000 · 0 in / 0 out

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Aug 30, 2026
@senamakel
senamakel merged commit 18e88ce into main Aug 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant