@ ci(validate): derive the schema ref from the plugin's own SDK pin - #31
Merged
Conversation
A plugin already states which SDK it builds against, once, as the `#ref` on its `@lvis/plugin-sdk` dependency. Asking the caller to repeat that as an `sdk-ref` input stores the same decision in two places, and the two drifting is not loud — the manifest just gets validated against a schema the plugin does not ship with. That drift was the normal state, not the exception. Six of seven callers passed `main` while pinning v8.0.0, v11.0.0, v11.1.0 or v11.2.0; only `lvis-plugin-ep` named its own version. So `lvis-plugin-git`, on SDK 8, has been checked against a schema four majors ahead of it — a tightening on main would have failed its CI for a rule its SDK never had, and a loosening would have passed a manifest its own SDK would reject. Derive it instead. `sdk-ref` stays as an explicit override and now defaults to empty; a caller with no pinned SDK dependency still falls back to `main`, but says so with a warning instead of silently. Verified before changing anything: the schema file exists at every pinned tag, and all seven manifests validate against both their pinned schema and main — so no repo's CI changes colour when its `sdk-ref: 'main'` line goes away.
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.
A plugin already states which SDK it builds against, once, as the
#refon its@lvis/plugin-sdkdependency. Repeating it as ansdk-refinput is the same shape as the runner-group allow-list that broke publishing in 2026-08: one decision, two copies, and the drift is silent.It has been drifting the whole time:
sdk-refpassedlvis-plugin-epv12.1.0v12.1.0lvis-plugin-templatev11.2.0mainlvis-plugin-work-assistantv11.1.0mainlvis-plugin-meetingv11.1.0mainlvis-plugin-ms-graphv11.0.0mainlvis-plugin-local-indexerv12.1.0mainlvis-plugin-gitv8.0.0lvis-plugin-gitaside, every plugin but ep has been validating its manifest against a schema it does not ship with —lvis-plugin-work-assistanton SDK 11.1 checked against main, four majors ahead in the worst case. A tightening on main would fail a repo's CI for a rule its SDK never had; a loosening would pass a manifest its own SDK would reject. Neither shows up as anything but a confusing red or a false green.So the workflow now resolves the ref itself:
sdk-refif given, otherwise the#reffrom the caller'spackage.json, otherwisemainwith a::warning::that says the schema can move underneath it.Checked before touching anything —
schemas/plugin-manifest.schema.jsonexists at all seven pinned tags, and every manifest validates against both its pinned schema and main (ajv-cli@5, draft7,--strict=false). No repo's CI changes colour when thesdk-ref: 'main'line comes out of its caller; the caller cleanups follow as separate PRs.