Repository navigation
Let a plugin manifest name the oldest Buzz it runs on - #4264
Draft
BurningMoneySlowly wants to merge 2 commits into
Draft
BurningMoneySlowly wants to merge 2 commits into
BurningMoneySlowly wants to merge 2 commits into
Conversation
A plugin that starts using a host feature has to keep working on every Buzz that lacks it, by feature-detecting each one, because nothing stops an older Buzz from installing or updating to it. A manifest can now set "minBuzzVersion": "1.2.0". The desktop tells the plugin manager its own version, and an install, update or reload to a plugin that needs a newer Buzz is refused with a message naming both versions; an installed copy stays where it is. A prerelease counts as its release. A Buzz from before this field already refuses such a manifest as an unknown key. The check is not part of Manifest::validate, which runs on every installed plugin each time the registry is read, so a plugin installed before a downgrade does not stop the others from loading. The buzzodz CLI passes no version and refuses nothing. Co-authored-by: Swiper <24077d5cda8e7e757be4b5e182ef5a8daf7c0447eb339cbf9c3d148fbcc8ecfa@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tyler Green <tylerg@squareup.com>
Review feedback on the minBuzzVersion gate: - A rollback switched to the previous revision without checking its minBuzzVersion, so after a Buzz downgrade it could restore a version that a fresh install refuses. It is now checked like an install. - A dev build reports tauri.conf.json's version rather than the release it becomes, so a plugin naming that release could not be installed in its own author's dev build. Dev builds now check no minBuzzVersion. Co-authored-by: Swiper <24077d5cda8e7e757be4b5e182ef5a8daf7c0447eb339cbf9c3d148fbcc8ecfa@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tyler Green <tylerg@squareup.com>
Contributor
Author
|
🤖 Addressed the two P2 findings from the
The review posted no inline threads here, so there's nothing to resolve on GitHub. |
This branch has not been deployed
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.
Why
Today a plugin has to stay compatible with every Buzz build it might be installed on. Nothing stops an older Buzz from installing a plugin, or updating to a version of it, that uses host features that older build doesn't have. So authors feature-detect each capability (
ctx.host?.runCommand?.(...), "On Buzz 0.7.19 and later…") and keep fallbacks around indefinitely.This is a proposal: let a plugin release say which Buzz it needs, so it can drop that compatibility code instead of carrying it.
What
"minBuzzVersion": "1.2.0".validateaccepts only a plainMAJOR.MINOR.PATCH(no ranges, prereleases orvprefix).context.package_info().version, which release builds set via--config candidate.json) to the pluginManagerwithwith_buzz_version.install_artifact_if, which every install and update path goes through (folder, Git and URL imports, and automatic managed updates),reloadandrollbackrefuse a plugin whoseminBuzzVersionis newer than the running Buzz. The error is "Example needs Buzz 1.5.0 or later, and this is Buzz 1.4.0. Update Buzz to install it." The installed copy stays where it is.1.5.0-preview.3and1.5.0-beta.1satisfy1.5.0.buzzodzpasses no version and refuses nothing. Dev builds (tauri::is_dev()) don't pass one either, because they reporttauri.conf.json's version, not the release they become.Older Buzz builds
The manifest is parsed with
deny_unknown_fields, so a Buzz from before this change already rejects a manifest that setsminBuzzVersion. The gate fails closed on old builds too; they just show an "unknown field" error instead of the friendly one.Why the check isn't in
Manifest::validateManager::readrunsvalidate()on every installed manifest and fails the whole registry if one fails. If the version check lived there, downgrading Buzz below a plugin's minimum would stop every plugin from loading. Sovalidatechecks only the field's syntax, and the version comparison runs only when new bytes come in.Open questions for maintainers
minBuzzVersionis a flat string. Something like"requires": { "buzz": "1.2.0" }would leave room for other requirements later. I went with the smallest shape.1.5.0-preview.3 < 1.5.0). But previews are "one patch above the highest stable", so under strict semver, preview users couldn't install plugins that need features they already have. The cost is that an early preview of 1.5.0 built before the feature landed would also pass.api.tsis FOUNDATION. This adds one optional field (minBuzzVersion?: string) toPluginManifest, the public plugin contract. It needs a maintainer's explicit go-ahead.Tests
New tests in
crates/plugin-manager/src/lib.rs:min_buzz_version_is_a_release_version_and_absent_by_default: old manifests round-trip without the field; valid and invalid version strings.app_versions_compare_by_release_and_prereleases_count_as_their_release: ordering (including1.9.9vs1.10.0), prerelease handling, and the error text.a_plugin_that_needs_a_newer_buzz_is_not_installed_updated_or_reloaded: a refused install leaves nothing installed. A refused update or reload keeps the current revision. A newer Buzz installs it, and the older manager still lists it afterwards.a_rollback_to_a_version_that_needs_a_newer_buzz_is_refused: a rollback after a downgrade is refused and keeps the current revision. It fails without the fix.Checks run at
388c38dda:cargo test -p buzzodz-plugins: 140 lib tests plus the integration suites pass.cargo clippy -p buzzodz-plugins --all-targets: clean.cargo check -p Buzz: compiles.pnpm typecheck: passes.Not tested in the running app.
Docs
docs/plugin-authoring-guide.md(contract rules): describes the field.docs/plugins.md: points to it.docs/managed-plugins.md: what happens when a policy pins a version that needs a newer Buzz.🤖 Generated with Claude Code