[CFX-4730] Add inert plugin CLI version constraint predicate (PR 1/2) - #814
Draft
ajalon1 wants to merge 1 commit into
Draft
[CFX-4730] Add inert plugin CLI version constraint predicate (PR 1/2)#814ajalon1 wants to merge 1 commit into
ajalon1 wants to merge 1 commit into
Conversation
Add MaxCLIVersion to PluginManifest alongside the existing MinCLIVersion, and extend PluginConflict with a typed Reason (PluginSkipReason, zero value SkipReasonNameConflict preserves every existing literal) and a Detail string, so the existing skip-record channel can carry version-incompatibility skips in addition to name conflicts. Add compatibleCLIVersion, a pure predicate comparing only the core (major.minor.patch) version of the running CLI against declared minCLIVersion/maxCLIVersion bounds, inclusive on both ends. A malformed declared bound always causes a skip, even when the running CLI version is "dev" or otherwise unparseable — the dev/unparseable bypass only applies once the declared bounds are confirmed well-formed. Add cliVersionSkip to build the PluginConflict record from a manifest, and a currentCLIVersion package-level seam so tests do not silently no-op against the literal "dev" build value. Update validation.go comments to also name MaxCLIVersion among the fields intentionally excluded from cross-manifest comparison. Neither function is wired into discovery yet: this is the inert, independently testable predicate mechanism. Discovery call sites, conflict reporting, and docs land in a follow-up PR.
|
🎫 Jira: |
This was referenced Aug 21, 2026
ajalon1
commented
Aug 21, 2026
Contributor
Author
There was a problem hiding this comment.
This was the spec used to implement this; will remove before I merge, just thought it would be useful to share.
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.
Summary
PR 1 of 2 (stacked-to-main chain) for CFX-4730. Adds the inert, independently-testable predicate mechanism for plugin manifest CLI version constraints. Nothing in this PR changes plugin discovery behavior — the new predicate and fields exist but are not wired into any discovery call site yet. That wiring lands in PR 2.
What changed
internal/plugin/types.go: addedMaxCLIVersionalongside the existingMinCLIVersiononPluginManifest; added a typedPluginSkipReasonenum (SkipReasonNameConflictis the zero value, so every existingPluginConflict{Name:…, Path:…}literal keeps its exact meaning) plusReason/Detailfields onPluginConflict.internal/plugin/cli_version.go(new):compatibleCLIVersion— a pure predicate comparing only the core (major.minor.patch) version of the running CLI against declaredminCLIVersion/maxCLIVersionbounds, inclusive on both ends. A malformed declared bound always causes a skip, even when the running CLI version isdevor otherwise unparseable — the dev/unparseable-CLI bypass only applies once the declared bounds are confirmed well-formed. Also addscliVersionSkip(builds thePluginConflictrecord) and acurrentCLIVersionpackage-level seam so tests never silently no-op against the literal"dev"build value.internal/plugin/validation.go: comment-only update namingMaxCLIVersionalongsideMinCLIVersionas fields intentionally excluded from cross-manifest comparison.internal/plugin/cli_version_test.go(new): table-driven coverage for every relevant spec scenario — no bounds, min-only, max-only inclusive boundary, both bounds, below min, above max, malformed bound (skip regardless of CLI version), dev/unparseable CLI with well-formed bounds (bypass), the joint dev+malformed case (malformed takes precedence), and prerelease CLI version (core-version comparison).Out of scope (PR 2)
internal/plugin/discover.gocall sites,cmd/plugin/discovery.go,LogConflicts/ConflictsForNamebranching, and docs — this PR is self-contained and does not change plugin discovery behavior.Ref: https://datarobot.atlassian.net/browse/CFX-4730
Also
Thanks @yuriyhrytsyuk for doing the original work on this!