Repository navigation
deps(app-contract): depend on octosense-app-contract by version; patch to the local crate - #47
Merged
Merged
Conversation
app-policy named the contract as { path = "../app-contract", version = "1" }.
A consumer that takes App Hub from git (the OctoSense shell) then resolved
the contract from that git checkout, a different crate from the crates.io
copy every app (Rinx) uses, so a build with both linked two contracts.
Every App Hub crate now writes octosense-app-contract = "1" (OctoSense
ADR 0005 section 3), and the workspace adds
[patch.crates-io] octosense-app-contract = { path = "crates/app-contract" }
so App Hub develops against its local copy. A [patch] never applies to
consumers, so they link crates.io. The contract CI and the publish workflow
copy the crate out of the workspace and are unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
OctoSense ADR 0005, plan step 2 (follow-up to #46): consumers get the contract from crates.io, and only one copy of it.
Why
app-policynamed the contract as{ path = "../app-contract", version = "1" }. A consumer that takes App Hub from git (the OctoSense shell) then resolves the contract from that git checkout. Cargo treats that as a different crate from the crates.iooctosense-app-contractthat apps (Rinx 1.1.0) use, so a build with both would link two contracts.What changes
crates/app-policy/Cargo.toml:octosense-app-contract = "1"(version only, no path). It is the only App Hub crate that depends on the contract directly. The others reach it throughapp-policy's re-export.Cargo.toml:[patch.crates-io] octosense-app-contract = { path = "crates/app-contract" }, so App Hub develops against its local copy. A[patch]never applies to consumers, so they link crates.io 1.x.Cargo.lock: unchanged. The patched path package is recorded the same way as the path dependency was.app-contract.yml) andpublish-app-contract.yml: unchanged and unaffected. Both copy the crate out of the workspace before building.Verified locally
cargo test --workspace --locked: all green (207 tests, 30 test binaries).cargo tree -i octosense-app-contractresolves tocrates/app-contractthrough the patch.cargo publish -p octosense-app-contract --dry-run(clean tree): OK.cargo test --all-targets,cargo test --doc,cargo clippy --all-targets --no-deps -D warnings,cargo publish --dry-run): OK.Merge order
This PR (A) → Rinx 1.1.0 (contract from crates.io, no App Hub git dependency) → OctoSense repins App Hub to this PR's merge commit.
🤖 Generated with Claude Code