Repository navigation
fix(ci): defer wrapper releases while moq-ffi has unreleased changes - #4009
Conversation
Release Kotlin lib published dev.moq:moq:0.5.0 compiled against bindings generated from main, which already used TrackDemand, while the newest published dev.moq:moq-ffi (0.4.0) predates it. Swift and Python already defer in that case by diffing rs/moq-ffi against its release tag. Move that check into `release.sh ffi-unreleased` and use it from the Kotlin, Go, Swift, and Python wrapper releases. Kotlin now also chains off Release Kotlin FFI so a deferred wrapper publishes once the bindings land, and requires the exact bindings version rather than any in range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2c0aab7ce
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | ||
| with: | ||
| ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }} |
There was a problem hiding this comment.
Rebuild deferred Kotlin releases from the deferred commit
When a Kotlin wrapper bump lands after the moq-ffi tag is pushed but before Release Kotlin FFI finishes, its push run sees the bindings as unpublished and defers, but this workflow_run checks out the older tag SHA. It then reads and builds the pre-bump wrapper and may no-op because that old version is already on Maven, leaving the newer wrapper unpublished until a manual dispatch or another FFI release. The chained run must evaluate the deferred wrapper commit or current branch while still guarding against newer unreleased FFI changes.
Useful? React with 👍 / 👎.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review. WalkthroughThe release script adds an Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This CI-only change defers Go, Python, Swift, and Kotlin wrapper releases until any pending moq-ffi changes are released, and adds a tested shared check for this. No concrete defects were found. The main trade-off, which the author states, is that wrappers may be deferred for FFI changes they do not use. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
moq-ffi-v0.4.0was tagged before #3949 (TrackDemand) merged, so the wrappers on main called FFI API that no published moq-ffi had.dev.moq:moq:0.5.0. It compiles against bindings generated from HEAD, but its only FFI guard checked that somedev.moq:moq-ffiin[0.4,0.5)was on Maven Central. At runtime,demand()has nothing behind it until 0.4.1 lands.moq.dev/moq@v0.7.0, which doesn't compile. fix(go): compile the wrapper against the pinned ffi before releasing #3999 added ago buildagainst the pinned ffi. That catches the problem, but every main push fails Release Go (and alerts) until the next ffi release.git diff moq-ffi-v<crate version> HEAD -- rs/moq-ffiand defer to the FFI release chain. Each had its own inline copy of the check.Approach
release.sh ffi-unreleased <version>. It emitsunreleased=trueand a::warning::when themoq-ffi-v<version>tag is missing (release in flight) orrs/moq-ffichanged since that tag.Release Kotlin FFIthroughworkflow_run, with the same trust gate as Swift/Python, and builds from that tag's commit.dev.moq:moq-ffi:<crate version>on Maven Central instead of any version in range.maven-version-in-rangeis now unused, so it's deleted.workflow_run, which builds main HEAD..github/scripts/release.test.sh, whichjust checkruns from.github/justfile.Dry-runs: the Kotlin and Swift PR runs still build the wrapper. They also run the check, so a PR merged while the ffi is ahead shows a warning that says so. Python and Go have no PR dry-run. Nightly does not call the wrapper workflows.
Trade-off: diff guard vs compiling against the published FFI
A compile against the published artifact is the stronger check. It only flags FFI changes the wrapper actually uses. It is also costly:
verifyjob on macOS).dev.moq:moq-ffifrom Maven.The diff guard is one cheap
git diff, already proven in Swift and Python, and defers instead of failing. The FFI release then re-triggers the wrapper. The cost is false positives: anyrs/moq-ffichange, even one the wrapper doesn't use, holds wrapper releases until the next ffi release. release-plz cuts that release wheneverrs/moq-ffichanges, so the hold is bounded. Go keeps its compile check and Swift keeps its verify job as backstops.Impact
release.sh: addsffi-unreleasedand removesmaven-version-in-range.rs/moq-ffiis ahead of its tag. Kotlin now publishes from the Release Kotlin FFI chain.Alternatives
rs/moq-ffi. Fewer false positives, but it needs a Rust build at both refs.Follow-ups
[0.4,0.5), Python~= 0.4.0, and Dart^0.4.0floors are set by hand. Nothing stops a consumer that pins moq-ffi 0.4.0 from resolving it under a wrapper that needs 0.4.1. Swift and Go derive the floor from the ffi they built against. Changing this is a version-coupling policy call for the maintainer.dev.moq:moq-ffi:0.4.1is on Maven Central, because its range floats. Go 0.7.0 is re-cut by the Release Go FFI chain.🤖 Generated with Claude Code
(written by Opus 5.5)