Skip to content

msggen: propagate added and deprecated fields#8873

Open
daywalker90 wants to merge 3 commits intoElementsProject:masterfrom
daywalker90:msggen-fix-added
Open

msggen: propagate added and deprecated fields#8873
daywalker90 wants to merge 3 commits intoElementsProject:masterfrom
daywalker90:msggen-fix-added

Conversation

@daywalker90
Copy link
Collaborator

@daywalker90 daywalker90 commented Jan 31, 2026

Whenever we want to add a new rpc command or notification we get an error during make that the added field of that new command or notification is missing even when it's clearly not and we had to uncomment those 2 lines in patch.py to get it running. The first commit passes any added or deprecated fields from the root object correctly now so we no longer have to do this.

Unfortunately we have commited wrong metadata to .msggen.json in the past, which now came to light since msggen noticed some added field mismatches. In the second commit i've used msggen to overrite the wrong metadata in .msggen.json. This of course results in a few changes to the generated code.

This leads me to commit 3. Because there were some changes i thought we could use the opportunity to raise the minimum supported version from v0.10.1 to something more realistic like v24.11 (age of xpay)?

Changelog-None

Edit: PR changed a bit see later comments.

@rustyrussell
Copy link
Contributor

OK, firstly, the explanation here belongs in the commit messages! GitHub is transient (and PRs more so!).

Secondly, the second commit is a bad idea: all our documentation should not say each field is added, when it's the entire command which was added.

I'm not sure why msggen doesn't just inherit deprecated and added, unless overridden, but msggen is so complex I can never figure out what it's doing already.

I've asked Christian how far back he needs msggen to support though!

@daywalker90
Copy link
Collaborator Author

OK, firstly, the explanation here belongs in the commit messages! GitHub is transient (and PRs more so!).

Done, transient as in one 9 of uptime btw 😄

Secondly, the second commit is a bad idea: all our documentation should not say each field is added, when it's the entire command which was added.

Yeah, what was i thinking. Fixed by inheriting both added and deprecated from parents.

I'm not sure why msggen doesn't just inherit deprecated and added, unless overridden, but msggen is so complex I can never figure out what it's doing already.

Whoops, made it more complex.

I've asked Christian how far back he needs msggen to support though!

Great, otherwise drop the commit.

@daywalker90
Copy link
Collaborator Author

I have included a commit to cleanup v26.03 versions with v26.04 versions

@daywalker90
Copy link
Collaborator Author

The test_sql_deprecated is failing now. Not sure why. Was it added too soon or what is going on?

@daywalker90 daywalker90 changed the title msggen: fix added field handling in root object msggen: propagate added and deprecated fields Mar 15, 2026
@sangbida sangbida self-requested a review March 16, 2026 02:05
Whenever we want to add a new rpc command or notification in msggen's `util.py` we get an error during `make`
that the `added` field of that new command or notification is missing even when it's clearly not.
We had to uncomment 2 lines in `patch.py` and override any missing `added` annotation to get it running.
We now pass any `added` or `deprecated` fields from the parent object correctly so we no longer have to do this.

Unfortunately we have commited wrong metadata to `.msggen.json` in the past.
This commit also includes missing `added` annotation for commands added after the `pre-v0.10.1` cutoff and
manual fixes of the metadata in `.msggen.json`
Allowing deprecated API's should actually allow them in test_sql_deprecated
@daywalker90
Copy link
Collaborator Author

daywalker90 commented Mar 16, 2026

The test_sql_deprecated is failing now. Not sure why. Was it added too soon or what is going on?

I think it was and allowing deprecated API's should allow them in test_sql_deprecated, so i made the test do that. If that is somehow wrong here let me know.

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.

2 participants