feat: let a schema introduce a definition, not just change one - #33
Merged
Merged
Conversation
A schema could say a key was new and render it away for an older binary, but not that a whole definition was. So a preset whose point is something that shipped in a later release had no way to be held back: publish it and every install a day later can see it, install it, and find it does nothing. A schema now lists what it introduces. Such a definition is published to that schema's tree and no lower one, so a binary reading an older schema neither lists it in the catalogue nor can fetch its file. That is the version gate, expressed where the rest of the schema differences already live rather than as a field on the definition. The renderer gains checks of its own, run in CI before the render: the introduced case, a key downgrade, and the guarded drop that reads the document as authored.
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 schema could say that a key was new and render it away for an older binary, but not that a whole definition was. So a preset whose entire point is something that shipped in a later release had nowhere to be held back: publish it and every install sees it a day later, installs it, and finds it does nothing.
Spamassassin is the case. It publishes no port by design, has no dashboard, and the thing that gives it a purpose is mailpit's discover_first wiring, which lives in the binary and is not released. On 1.35 it installs and then sits there, with nothing on screen to explain why.
A schema now lists what it introduces. Such a definition is published to that schema's tree and to no lower one, so a binary reading an older schema neither lists it in the catalogue nor can fetch its file, and the preset simply does not exist for it. That is the version gate, expressed alongside the key changes rather than as a field on the definition, and it needs nothing new in the binary: an absent file and an absent index entry are already what a binary does the right thing with.
The renderer gains checks of its own, run in CI ahead of the render. They build a throwaway store in a temp dir and read the published trees back, so they describe what a binary would fetch rather than how the renderer is written. The introduced case fails against the previous renderer, which is how I know it is testing something.
Nothing changes in the published trees here: introduces is empty, and the render is byte for byte what main already carries. #23 is what puts spamassassin behind it.