Inferred optional fields for msggen schema evolution#6142
Merged
rustyrussell merged 4 commits intoElementsProject:masterfrom Apr 6, 2023
Merged
Inferred optional fields for msggen schema evolution#6142rustyrussell merged 4 commits intoElementsProject:masterfrom
msggen schema evolution#6142rustyrussell merged 4 commits intoElementsProject:masterfrom
Conversation
Member
Author
|
You can see two examples of changed optionality here and here:
The same would be true for deprecated required fields, they'd end up as optional in the interface because we presumably want to support versions after the deprecation. The current range of versions supported is
Including various hotfixes. If you are wondering why there aren't any deprecations having effect at the moment that is because old deprecations have been removed and the remaining ones are on non-required fields anyway, hence they don't result in a change in optionality. |
3f586c4 to
b0288be
Compare
Contributor
|
I like this, and would love it within the current release of possible @ShahanaFarooqui ? |
b0288be to
46f121b
Compare
The patching system allows us to enrich the raw schema with some additional information. In this specific case we want to backfill the `added` and `deprecated` fields for the multiversion support.
This patch annotates the fields with a new `optional` attribute which determines whether the field should be considered an inferred optional due to being added or deprecated.
Changelog-Changed: msggen: The generated interfaces `cln-rpc` anc `cln-grpc` can now work with a range of versions rather than having to match the CLN version
This is a visitor that ensures every new field has at least an `added` field, and that we don't change the `added` or `deprecated` annotation after the fact.
b1a2223 to
6b3cc28
Compare
Contributor
|
Ack 6b3cc28 |
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.
This implements the solution described in #5988
Closes #5988