Skip to content

fix(versioning): accept initial version for newly introduced plugins - #477

Draft
rootkiller6788 wants to merge 1 commit into
NVIDIA:mainfrom
rootkiller6788:fix-new-plugin-version-validation
Draft

fix(versioning): accept initial version for newly introduced plugins#477
rootkiller6788 wants to merge 1 commit into
NVIDIA:mainfrom
rootkiller6788:fix-new-plugin-version-validation

Conversation

@rootkiller6788

Copy link
Copy Markdown

What

version-plugins.py auto-bumps catalog plugin versions and validates builder-set bumps. When a plugins.d/<name>.yml is newly introduced (no yaml at the base ref), analyze_plugin sets base_version = head_version and builder_changed_version = True, so decide() runs validate_builder_version(base, head) with equal versions and reports:

! foo: version did not increase: base 1.0.0 -> head 1.0.0 (must be strictly greater)

There is no prior version for a brand-new plugin to increase from — the initial version is the builder's stamp, and it is already required to be a strict MAJOR.MINOR.PATCH by SemVer.parse in analyze_plugin. The current behavior makes every plugin onboarding fail (advisory in validate-plugins.yml, but fatal in sync-skills.yml's version-plugins.sh --apply --base HEAD step).

Change

  • Add an is_new field to PluginAnalysis, set when the plugin yaml is absent at the base ref.
  • In decide(), accept newly-introduced plugins (verdict accept) instead of applying the monotonic-increase check, which only makes sense when a base version exists.
  • Existing-plugin behavior is unchanged: non-monotonic builder edits and oversized major skips still fail; structural/content changes still auto-bump y/z.
  • Add .github/scripts/tests/test_version_plugins.py (10 tests) pinning both the new-plugin fix and the pre-existing decide()/build_plan()/SemVer behavior.

A plugin yaml that is newly added at head has no base version to compare
against. decide() treated the missing base as a builder-set version that
hadn't increased, so every new plugin was reported with a misleading
'version did not increase: base 1.0.0 -> head 1.0.0' failure and the sync
workflow's --apply --base HEAD run exited non-zero.

Newly introduced plugins are now classified as 'accept': the initial
version still has to pass SemVer.parse (strict MAJOR.MINOR.PATCH, no
pre-release tags) in analyze_plugin, and there is nothing for it to
increase from. Existing plugins keep the monotonic/oversized-major-skip
validation unchanged.

Adds a regression test suite for the decide()/build_plan() layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant