Refactor plugin version lookup to use afero and fix shadowing bug in Run#1555
Merged
vzhang-stripe merged 1 commit intomasterfrom Apr 20, 2026
Merged
Refactor plugin version lookup to use afero and fix shadowing bug in Run#1555vzhang-stripe merged 1 commit intomasterfrom
vzhang-stripe merged 1 commit intomasterfrom
Conversation
Extracts lookUpInstalledVersion() using afero.Fs for testability, adds isLocalDevelopmentVersion() helper, skips checksum verification for local dev builds, and fixes a variable shadowing bug where := inside the else branch left the outer version empty. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
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.
It's annoying to run the local.build.dev version when developing a plugin, update the CLI version preference to always run the local version
What
"local.build.dev"into alocalDevelopmentVersionconstantlookUpInstalledVersion()method that checks for a local dev build first, then falls back to a semver glob — usingafero.Fsinstead offilepath.Globso it's testableisLocalDevelopmentVersion()predicate and uses it to skip checksum verification for local dev builds in bothverifyChecksumandRunRunwhere:=inside theelseblock created a new innerversion, leaving the outer variable empty and causinggetPluginInstallPath/getChecksumtoreceive
""for all non-dev plugin invocationsNo regression for production users
Regular users never have a
local.build.devdirectory, solookUpInstalledVersionalways falls through to the semver glob.afero.OsFswraps the real filesystem, so behavior is identical to theprevious
filepath.Globcall. The checksum skip only fires for thelocal.build.devversion string.Tests
TestVerifyChecksumSkipsLocalDevelopmentVersion— checksum is skipped for local dev buildsTestLookUpInstalledVersionPrefersLocalDevelopmentVersion— local dev dir takes priority over an installed releaseTestLookUpInstalledVersionFallsBackToInstalledRelease— falls back to semver glob when no local dev build exists