examples: pin bsr-quickstart to one buffa release and check it in CI - #436
Open
harshitwandhare wants to merge 1 commit into
Open
examples: pin bsr-quickstart to one buffa release and check it in CI#436harshitwandhare wants to merge 1 commit into
harshitwandhare wants to merge 1 commit into
Conversation
The example pinned the BSR plugin at v0.5.2 but compiled against the in-tree runtime through path dependencies, and its checked-in `src/gen/example.v1.rs` matched neither. On main it failed with four errors, the last of them a missing `merge_view_field` and a `to_owned_message` that is now infallible. The generated file had been hand-patched four times since it was generated (anthropics#184, anthropics#284, anthropics#409, anthropics#381) rather than regenerated, so it tracked the in-tree API by hand while still claiming to be published-plugin output. The example sits in the workspace `exclude` list, so nothing ever compiled it and the drift was invisible. Pinning the runtime back to the plugin's version alone does not fix it: against crates.io 0.5.2 the same file fails with three different errors, because it is no longer that plugin's output. Bumping only the plugin pin does not work either, since anthropics#381 now requires an `unsafe_impl_view_lifetime_parametric!` marker that no published plugin emits yet, so published v0.9.2 output does not compile against main. So the plugin pin moves to v0.9.2, `src/gen/` is regenerated from it, and the two crates move to the matching crates.io release. Both halves now come from one buffa version, which is also what a downstream BSR user has. A `cargo check` step in `lint-and-test` covers the example, and it can only go red if one pin moves without the other. Verified: cargo check, cargo run and clippy --all-targets -D warnings all clean.
|
All contributors have signed the CLA ✍️ ✅ |
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.
examples/bsr-quickstartpinned the BSR plugin at v0.5.2 but compiled against the in-tree runtime through path dependencies, and the checked-insrc/gen/example.v1.rsmatched neither. Four errors on18476fa, as reported.That file had been hand-patched four times since it was generated (#184, #284, #409, #381) rather than regenerated, so it tracked the in-tree API by hand while still being described as published-plugin output. The directory sits in the workspace
excludelist, so nothing compiled it and each round of drift stayed invisible.Neither half of the fix works alone.
Pinning the runtime back to crates.io
=0.5.2to match the plugin fails with a different three errors, because the file is no longer v0.5.2 output:Bumping only the plugin pin fails too. v0.9.2 is published, but #381 requires the
ViewLifetimeParametricmarker and no published plugin emits it yet, so published v0.9.2 output againstmaingives four ofwhich is the situation #381's own description calls out as needing a 0.10 BSR plugin.
So the plugin pin moves to v0.9.2,
src/gen/is regenerated from it, andbuffa/buffa-typesmove to the matching crates.io release. Both halves come from one buffa version, which is also what a downstream BSR user has, and the example stops depending onmain. That is what clears the "cannot be regenerated until a 0.10 BSR plugin is published" blocker: the example no longer needs to trackmain, so a 0.10 plugin is only wanted when the example should start demonstrating 0.10.The
unsafe_impl_view_lifetime_parametric!line added by hand in #381 goes away with the regen, which is correct here:buffa0.9.2 has no such macro, and the example no longer compiles against the runtime that requires it.The cost is the forward-compat canary the old
Cargo.tomlcomment described, and it was not working. The published plugin lagsmainby design, so between releases the canary's only outcome was a red example, and it was being silenced by hand-patching rather than acted on. In-tree codegen against the in-tree runtime is already covered bybuffa-testand the two codegen compile matrices inlint-and-test.A
cargo checkstep inlint-and-testnow covers the example. With both pins naming one release it can only go red if one pin moves without the other, which is what the release bump has to get right anyway.Verified
Regenerated with
buf generateagainst the pinned v0.9.2 plugin, then inexamples/bsr-quickstart:Cross-check on the regen: published v0.9.2 plugin output and the in-tree
protoc-gen-buffadiffer by exactly the oneunsafe_impl_view_lifetime_parametric!(GreetingView);line, so the published plugin is otherwise current with in-tree codegen.Not run: the workspace test suite, since nothing here touches a workspace crate. The
ci.ymlstep is the only change outsideexamples/bsr-quickstartand.changes/.This is option 2 from the issue. If you would rather have option 1, the regenerated
src/gen/is the same file either way and only the twoCargo.tomllines change, but it does not compile againstmaintoday for the #381 reason above.Fixes #427.