Skip to content

fix: filter packages for publication#449

Closed
diogomatsubara wants to merge 8 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:ignore-dev-build-deps-for-publishing
Closed

fix: filter packages for publication#449
diogomatsubara wants to merge 8 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:ignore-dev-build-deps-for-publishing

Conversation

@diogomatsubara
Copy link
Copy Markdown
Contributor

Update packagesOrdered() to return only packages for publication, filtering out dev, build and publish=false packages. Avoids a circular dependency due to the recent introduction of zenoh-test crate. Also add a guard after each iteration to error out in case no progress is done during the outer loop.

See https://github.com/eclipse-zenoh/zenoh/actions/runs/26133565301/job/76863995762

Update packagesOrdered() to return only packages for publication,
filtering out dev, build and publish=false packages. Avoids a circular
dependency due to the recent introduction of zenoh-test crate. Also add
a guard after each iteration to error out in case no progress is done
during the outer loop.
@diogomatsubara diogomatsubara marked this pull request as draft May 20, 2026 14:33
- correct packagesOrdered() test to a newer zenoh version with an order
  that matches reality
- update bump deps zenoh test to include the exact zenoh version since
  bump() take into account the `=` prefix in newer version
@diogomatsubara
Copy link
Copy Markdown
Contributor Author

@fuzzypixelz I updated the test to use a recent version of zenoh and updated the order of the packages in the test to match a topological order that seems correct. Once this is merged I can test the action with the zenoh release workflow.

@diogomatsubara diogomatsubara marked this pull request as ready for review May 20, 2026 16:26
Copy link
Copy Markdown
Member

@fuzzypixelz fuzzypixelz left a comment

Choose a reason for hiding this comment

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

We should carefully check how the behavior changes in packagesOrdered affect the rest of the codebase.

Comment thread src/cargo.ts
Comment thread src/cargo.ts
Comment thread src/cargo.ts Outdated
Comment thread src/cargo.ts
Comment thread src/cargo.ts Outdated
Comment thread src/cargo.ts
Comment thread src/cargo.ts
@diogomatsubara
Copy link
Copy Markdown
Contributor Author

We should carefully check how the behavior changes in packagesOrdered affect the rest of the codebase.

Thanks for the review! Addressed your review comments and checked packagesOrdered is only used in cargo.ts, publish-crates-cargo.ts and cargo.test.ts. I'll be able to further test this once it lands on main and I can run the zenoh workflow from it.

packagesOrdered() previously relied on a loose workspace ordering and
could loop forever when dev-only cycles were present. It now derives a
true publication order by:

- including only publishable crates
- honoring normal and build workspace dependencies
- ignoring dev dependencies
- rejecting invalid graphs early
- throwing on unresolved graphs instead of spinning

Update the zenoh test expectations to match the new publication-order
semantics.
Copy link
Copy Markdown
Member

@fuzzypixelz fuzzypixelz left a comment

Choose a reason for hiding this comment

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

Perhaps this is the right time to test cargo publish --workspace.

This should be easy now that the project updated its toolchain to Rust 1.93 > 1.90.

@diogomatsubara
Copy link
Copy Markdown
Contributor Author

diogomatsubara commented May 26, 2026

Closing this one in favor of PR #451

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.

2 participants