Open akien-mga opened 3 weeks ago
CC @RedworkDE @dsnopek @raulsntos
I've been looking into what's happening with PR #90993 and trying to figure out how the validate_extension_api.sh
script is supposed to work.
It looks like it will concatenate all the *.expected
files between the reference version (the version whose extension_api.json
it's validating) and the current version, in order to attempt to account for all the progressive changes since the reference version.
For example, when the reference version is 4.1-stable, it'll concatenate the following *.expected
files:
4.1-stable_4.2-stable.expected
4.2-stable_4.3-stable.expected
4.3-stable.expected
This should theoretically work, but has problems specifically with adding/removing arguments, because the validation messages will change. If the property had simply changed type in each release, we would have been fine, because all the validation messages about the type changes would be in the concatenated file, and all would be ignored.
Here's the first bunch of solutions that come to my mind:
4.3-stable.expected
, rather than scattering them into the old 4.2-stable_4.3-stable.expected
etc files like @akien-mga describes as his workaround above. We really shouldn't change the old *.expected
files after we've moved on to the next minor version, and adding the messages in 4.3-stable.expected
would work because it'll always be concatenated together with the other files. This isn't great, because it's not obvious that this needs to be done, but it's also not the worst and we can document it.*.expected
files) seems like it'd be too much.There's probably more possible solutions that I haven't thought of.
Relating to my possible solution nr 1 above:
@akien-mga mentioned on #90993 that putting those messages in the 4.3-stable.expected
will lead the validate_extension_api.sh
script to emit warnings, since those messages won't occur in the output when the reference version is 4.3-stable.
Those warnings can help prevent unused messages from being in *.expected
files, which is generally a good thing: perhaps a message gets added accidentally, which does nothing at first, but then later ends up ignoring a message we really actually care about.
However, if we do intend to go with possible solution nr 1, then those warnings risk becoming noise: we'll have to know to ignore the ones that we put in there on purpose, while still somehow watching out for new ones that could potentially lead to problems in the future.
A couple options come to mind:
*.expected
files to silence that warning for specific messages. We would need to be careful when reviewing to ensure it's only used in these tricky situations with arguments being added/removed, but it would allow us to continue getting value from the warnings.
Tested versions
System information
Any
Issue description
We have some bugs in the GDExtension API validation checks that we perform on CI, which are starting to hamper development as we need to work them around in non-trivial ways.
90993 is a good example of that as it's impacting a complex method,
RenderingDevice::draw_list_begin
which changed multiple times since Godot 4.0:Array
to aTypedArray<RID>
(Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/draw_list_begin/arguments/9': type changed value in new API, from "Array" to "typedarray::RID".
).Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/draw_list_begin/arguments': size changed value in new API, from 10 to 9.
).Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/draw_list_begin/arguments': size changed value in new API, from 9 to 10.
).To make CI checks pass, I had to add changes to
4.0-stable_4.1-stable.expected
and4.2-stable_4.3-stable.expected
that reflects changes done in 4.4, which seems wrong to me. And also contradicts previous messages in the same.expected
files for the API breakage done in their respective versions.Aside from the above issue, we have a few other long-running problems that trigger recurring warnings in the logs, but somehow don't seem to break the CI checks, or we'd have fixed them ages ago:
Happens when checking the
4.0-stable_4.1-stable.expected
and4.1-stable_4.2-stable.expected
files.Happens for all stable version checks, but somehow not in the dev version (currently
4.3-stable.expected
). This was the same in the previous dev cycle where it didn't occur for4.2-stable.expected
, so it's not that it was fixed in 4.3 / 4.4.dev.Steps to reproduce
Minimal reproduction project (MRP)
n/a