Skip to content

Commit 79e87ee

Browse files
committed
Merge pull request #80354 from RedworkDE/ci-compat-multi
CI: Compare API compatibility against both 4.0 and 4.1
2 parents bc88dca + b83dff7 commit 79e87ee

File tree

3 files changed

+148
-123
lines changed

3 files changed

+148
-123
lines changed

misc/extension_api_validation/4.0-stable.expected renamed to misc/extension_api_validation/4.0-stable_4.1-stable.expected

Lines changed: 2 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
This file contains the expected output of --validate-extension-api when run against the extension_api.json of the
2-
4.0-stable tag (the basename of this file).
3-
4-
Only lines that start with "Validate extension JSON:" matter, everything else is considered a comment and ignored. They
5-
should instead be used to justify these changes and describe how users should work around these changes.
6-
7-
Add new entries at the end of the file.
8-
9-
========================================================================================================================
1+
This file contains, when concatenated to the expected output since 4.1, the expected output of --validate-extension-api
2+
when run against the extension_api.json of the 4.0-stable tag (first part of the basename of this file).
103

114
## Changes between 4.0-stable and 4.1-stable
125

@@ -356,112 +349,3 @@ Validate extension JSON: Error: Hash changed for 'classes/EditorUndoRedoManager/
356349
Validate extension JSON: Error: Hash changed for 'classes/UndoRedo/methods/create_action', from 0AEC1BFC to E87757EB. This means that the function has changed and no compatibility function was provided.
357350

358351
Added a optional parameters with default values. No adjustments should be necessary.
359-
360-
361-
## Changes between 4.1-stable and 4.2-stable
362-
363-
GH-79911
364-
--------
365-
Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/BarrierMask/values/BARRIER_MASK_RASTER': value changed value in new API, from 1.0 to 9.
366-
Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/BarrierMask/values/BARRIER_MASK_ALL_BARRIERS': value changed value in new API, from 7.0 to 32767.
367-
Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/BarrierMask/values/BARRIER_MASK_NO_BARRIER': value changed value in new API, from 8.0 to 32768.
368-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_update/arguments/3': default_value changed value in new API, from "7" to "32767".
369-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_copy/arguments/9': default_value changed value in new API, from "7" to "32767".
370-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_clear/arguments/6': default_value changed value in new API, from "7" to "32767".
371-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_resolve_multisample/arguments/2': default_value changed value in new API, from "7" to "32767".
372-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/buffer_update/arguments/4': default_value changed value in new API, from "7" to "32767".
373-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/buffer_clear/arguments/3': default_value changed value in new API, from "7" to "32767".
374-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/draw_list_end/arguments/0': default_value changed value in new API, from "7" to "32767".
375-
Validate extension JSON: Error: Hash changed for 'classes/RenderingDevice/methods/draw_list_end', from 19365687 to E9B4FA8E. This means that the function has changed and no compatibility function was provided.
376-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/compute_list_end/arguments/0': default_value changed value in new API, from "7" to "32767".
377-
Validate extension JSON: Error: Hash changed for 'classes/RenderingDevice/methods/compute_list_end', from 19365687 to E9B4FA8E. This means that the function has changed and no compatibility function was provided.
378-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/barrier/arguments/0': default_value changed value in new API, from "7" to "32767".
379-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/barrier/arguments/1': default_value changed value in new API, from "7" to "32767".
380-
Validate extension JSON: Error: Hash changed for 'classes/RenderingDevice/methods/barrier', from 0FE50041 to DD9E8DAB. This means that the function has changed and no compatibility function was provided.
381-
382-
Raster barrier was split into vertex and fragment barriers for use in mobile renderer.
383-
384-
385-
GH-79308
386-
--------
387-
Validate extension JSON: API was removed: classes/GraphEdit/methods/get_scroll_ofs
388-
Validate extension JSON: API was removed: classes/GraphEdit/methods/get_snap
389-
Validate extension JSON: API was removed: classes/GraphEdit/methods/get_zoom_hbox
390-
Validate extension JSON: API was removed: classes/GraphEdit/methods/is_using_snap
391-
Validate extension JSON: API was removed: classes/GraphEdit/methods/set_scroll_ofs
392-
Validate extension JSON: API was removed: classes/GraphEdit/methods/set_snap
393-
Validate extension JSON: API was removed: classes/GraphEdit/methods/set_use_snap
394-
Validate extension JSON: API was removed: classes/GraphEdit/properties/snap_distance
395-
Validate extension JSON: API was removed: classes/GraphEdit/properties/use_snap
396-
Validate extension JSON: API was removed: classes/GraphNode/methods/is_comment
397-
Validate extension JSON: API was removed: classes/GraphNode/methods/set_comment
398-
Validate extension JSON: API was removed: classes/GraphNode/properties/comment
399-
Validate extension JSON: Error: Field 'classes/GraphEdit/properties/scroll_offset': getter changed value in new API, from "get_scroll_ofs" to &"get_scroll_offset".
400-
Validate extension JSON: Error: Field 'classes/GraphEdit/properties/scroll_offset': setter changed value in new API, from "set_scroll_ofs" to &"set_scroll_offset".
401-
402-
Intentional compatibility breakage during refactoring of API marked as experimental.
403-
404-
FIXME: Still a WIP, review this list once the work is completed, especially if compatibility
405-
code is added.
406-
407-
408-
GH-73196
409-
--------
410-
Validate extension JSON: Error: Field 'classes/CodeEdit/methods/get_text_for_symbol_lookup': is_const changed value in new API, from false to true.
411-
412-
Function was made `const`. No adjustments should be necessary.
413-
414-
415-
GH-78328
416-
--------
417-
Validate extension JSON: Error: Field 'classes/TileMap/methods/get_used_rect': is_const changed value in new API, from false to true.
418-
419-
Function was made `const`. No adjustments should be necessary.
420-
421-
422-
GH-79606
423-
--------
424-
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/shader_create_from_bytecode/arguments': size changed value in new API, from 1 to 2.
425-
426-
Added optional argument. Compatibility method registered.
427-
428-
429-
GH-78266
430-
--------
431-
Validate extension JSON: API was removed: classes/FontFile/properties/fallbacks
432-
Validate extension JSON: API was removed: classes/FontVariation/properties/fallbacks
433-
Validate extension JSON: API was removed: classes/SystemFont/properties/fallbacks
434-
435-
The property was moved to their common base class Font.
436-
The setters and getters were already in Font, so this shouldn't affect compatibility.
437-
438-
439-
GH-36493
440-
--------
441-
Validate extension JSON: Error: Field 'classes/PopupMenu/methods/add_icon_shortcut/arguments': size changed value in new API, from 4 to 5.
442-
Validate extension JSON: Error: Field 'classes/PopupMenu/methods/add_shortcut/arguments': size changed value in new API, from 3 to 4.
443-
444-
Added optional argument. Compatibility methods registered.
445-
446-
447-
GH-80954
448-
--------
449-
Validate extension JSON: Error: Field 'classes/Font/methods/find_variation/arguments': size changed value in new API, from 4 to 8.
450-
451-
Added optional arguments. Compatibility method registered.
452-
453-
GH-80852
454-
--------
455-
456-
Validate extension JSON: API was removed: classes/GDScriptEditorTranslationParserPlugin
457-
Validate extension JSON: API was removed: classes/GDScriptNativeClass
458-
Validate extension JSON: API was removed: classes/GodotPhysicsServer2D
459-
Validate extension JSON: API was removed: classes/GodotPhysicsServer3D
460-
Validate extension JSON: API was removed: classes/IPUnix
461-
Validate extension JSON: API was removed: classes/MovieWriterMJPEG
462-
Validate extension JSON: API was removed: classes/MovieWriterPNGWAV
463-
Validate extension JSON: API was removed: classes/ResourceFormatImporterSaver
464-
Validate extension JSON: API was removed: classes/FramebufferCacheRD
465-
Validate extension JSON: API was removed: classes/UniformSetCacheRD
466-
467-
Excluded unexposed classes from extension_api.json.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
This file contains the expected output of --validate-extension-api when run against the extension_api.json of the
2+
4.1-stable tag (the basename of this file).
3+
4+
Only lines that start with "Validate extension JSON:" matter, everything else is considered a comment and ignored. They
5+
should instead be used to justify these changes and describe how users should work around these changes.
6+
7+
Add new entries at the end of the file.
8+
9+
## Changes between 4.1-stable and 4.2-stable
10+
11+
GH-79911
12+
--------
13+
Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/BarrierMask/values/BARRIER_MASK_RASTER': value changed value in new API, from 1.0 to 9.
14+
Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/BarrierMask/values/BARRIER_MASK_ALL_BARRIERS': value changed value in new API, from 7.0 to 32767.
15+
Validate extension JSON: Error: Field 'classes/RenderingDevice/enums/BarrierMask/values/BARRIER_MASK_NO_BARRIER': value changed value in new API, from 8.0 to 32768.
16+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_update/arguments/3': default_value changed value in new API, from "7" to "32767".
17+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_copy/arguments/9': default_value changed value in new API, from "7" to "32767".
18+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_clear/arguments/6': default_value changed value in new API, from "7" to "32767".
19+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/texture_resolve_multisample/arguments/2': default_value changed value in new API, from "7" to "32767".
20+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/buffer_update/arguments/4': default_value changed value in new API, from "7" to "32767".
21+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/buffer_clear/arguments/3': default_value changed value in new API, from "7" to "32767".
22+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/draw_list_end/arguments/0': default_value changed value in new API, from "7" to "32767".
23+
Validate extension JSON: Error: Hash changed for 'classes/RenderingDevice/methods/draw_list_end', from 19365687 to E9B4FA8E. This means that the function has changed and no compatibility function was provided.
24+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/compute_list_end/arguments/0': default_value changed value in new API, from "7" to "32767".
25+
Validate extension JSON: Error: Hash changed for 'classes/RenderingDevice/methods/compute_list_end', from 19365687 to E9B4FA8E. This means that the function has changed and no compatibility function was provided.
26+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/barrier/arguments/0': default_value changed value in new API, from "7" to "32767".
27+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/barrier/arguments/1': default_value changed value in new API, from "7" to "32767".
28+
Validate extension JSON: Error: Hash changed for 'classes/RenderingDevice/methods/barrier', from 0FE50041 to DD9E8DAB. This means that the function has changed and no compatibility function was provided.
29+
30+
Raster barrier was split into vertex and fragment barriers for use in mobile renderer.
31+
32+
33+
GH-79308
34+
--------
35+
Validate extension JSON: API was removed: classes/GraphEdit/methods/get_scroll_ofs
36+
Validate extension JSON: API was removed: classes/GraphEdit/methods/get_snap
37+
Validate extension JSON: API was removed: classes/GraphEdit/methods/get_zoom_hbox
38+
Validate extension JSON: API was removed: classes/GraphEdit/methods/is_using_snap
39+
Validate extension JSON: API was removed: classes/GraphEdit/methods/set_scroll_ofs
40+
Validate extension JSON: API was removed: classes/GraphEdit/methods/set_snap
41+
Validate extension JSON: API was removed: classes/GraphEdit/methods/set_use_snap
42+
Validate extension JSON: API was removed: classes/GraphEdit/properties/snap_distance
43+
Validate extension JSON: API was removed: classes/GraphEdit/properties/use_snap
44+
Validate extension JSON: API was removed: classes/GraphNode/methods/is_comment
45+
Validate extension JSON: API was removed: classes/GraphNode/methods/set_comment
46+
Validate extension JSON: API was removed: classes/GraphNode/properties/comment
47+
Validate extension JSON: Error: Field 'classes/GraphEdit/properties/scroll_offset': getter changed value in new API, from "get_scroll_ofs" to &"get_scroll_offset".
48+
Validate extension JSON: Error: Field 'classes/GraphEdit/properties/scroll_offset': setter changed value in new API, from "set_scroll_ofs" to &"set_scroll_offset".
49+
50+
Intentional compatibility breakage during refactoring of API marked as experimental.
51+
52+
FIXME: Still a WIP, review this list once the work is completed, especially if compatibility
53+
code is added.
54+
55+
56+
GH-73196
57+
--------
58+
Validate extension JSON: Error: Field 'classes/CodeEdit/methods/get_text_for_symbol_lookup': is_const changed value in new API, from false to true.
59+
60+
Function was made `const`. No adjustments should be necessary.
61+
62+
63+
GH-78328
64+
--------
65+
Validate extension JSON: Error: Field 'classes/TileMap/methods/get_used_rect': is_const changed value in new API, from false to true.
66+
67+
Function was made `const`. No adjustments should be necessary.
68+
69+
70+
GH-79606
71+
--------
72+
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/shader_create_from_bytecode/arguments': size changed value in new API, from 1 to 2.
73+
74+
Added optional argument. Compatibility method registered.
75+
76+
77+
GH-78266
78+
--------
79+
Validate extension JSON: API was removed: classes/FontFile/properties/fallbacks
80+
Validate extension JSON: API was removed: classes/FontVariation/properties/fallbacks
81+
Validate extension JSON: API was removed: classes/SystemFont/properties/fallbacks
82+
83+
The property was moved to their common base class Font.
84+
The setters and getters were already in Font, so this shouldn't affect compatibility.
85+
86+
87+
GH-36493
88+
--------
89+
Validate extension JSON: Error: Field 'classes/PopupMenu/methods/add_icon_shortcut/arguments': size changed value in new API, from 4 to 5.
90+
Validate extension JSON: Error: Field 'classes/PopupMenu/methods/add_shortcut/arguments': size changed value in new API, from 3 to 4.
91+
92+
Added optional argument. Compatibility methods registered.
93+
94+
95+
GH-80954
96+
--------
97+
Validate extension JSON: Error: Field 'classes/Font/methods/find_variation/arguments': size changed value in new API, from 4 to 8.
98+
99+
Added optional arguments. Compatibility method registered.
100+
101+
102+
GH-80852
103+
--------
104+
105+
Validate extension JSON: API was removed: classes/GDScriptEditorTranslationParserPlugin
106+
Validate extension JSON: API was removed: classes/GDScriptNativeClass
107+
Validate extension JSON: API was removed: classes/GodotPhysicsServer2D
108+
Validate extension JSON: API was removed: classes/GodotPhysicsServer3D
109+
Validate extension JSON: API was removed: classes/IPUnix
110+
Validate extension JSON: API was removed: classes/MovieWriterMJPEG
111+
Validate extension JSON: API was removed: classes/MovieWriterPNGWAV
112+
Validate extension JSON: API was removed: classes/ResourceFormatImporterSaver
113+
Validate extension JSON: API was removed: classes/FramebufferCacheRD
114+
Validate extension JSON: API was removed: classes/UniformSetCacheRD
115+
Validate extension JSON: API was removed: classes/GLTFDocumentExtensionPhysics
116+
Validate extension JSON: API was removed: classes/GLTFDocumentExtensionTextureWebP
117+
118+
Excluded unexposed classes from extension_api.json.

misc/scripts/validate_extension_api.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ if [ $# != 1 ]; then
1010
echo "Usage: @0 <path-to-godot-executable>"
1111
fi
1212

13+
api_validation_dir="$( dirname -- "$( dirname -- "${BASH_SOURCE[0]//\.\//}" )" )/extension_api_validation/"
14+
1315
has_problems=0
16+
warn_extra=0
17+
reference_tag=""
18+
expected_errors=""
1419

1520
make_annotation()
1621
{
@@ -27,34 +32,52 @@ make_annotation()
2732
fi
2833
}
2934

35+
get_expected_output()
36+
{
37+
local parts=()
38+
IFS='_' read -ra parts <<< "$(basename -s .expected "$1")"
39+
40+
if [[ "${#parts[@]}" == "2" ]]; then
41+
cat "$1" >> "$expected_errors"
42+
get_expected_output "$(find "$api_validation_dir" -name "${parts[1]}*.expected")"
43+
reference_tag="${parts[0]}"
44+
warn_extra=0
45+
else
46+
cat "$1" >> "$expected_errors"
47+
reference_tag="${parts[0]}"
48+
warn_extra=1
49+
fi
50+
}
51+
3052
while read -r file; do
3153
reference_file="$(mktemp)"
3254
validate="$(mktemp)"
3355
validation_output="$(mktemp)"
3456
allowed_errors="$(mktemp)"
57+
expected_errors="$(mktemp)"
58+
get_expected_output "$file"
3559

3660
# Download the reference extension_api.json
37-
reference_tag="$(basename -s .expected "$file")"
3861
wget -qcO "$reference_file" "https://raw.githubusercontent.com/godotengine/godot-cpp/godot-$reference_tag/gdextension/extension_api.json"
3962
# Validate the current API against the reference
4063
"$1" --headless --validate-extension-api "$reference_file" 2>&1 | tee "$validate" | awk '!/^Validate extension JSON:/' - || true
4164
# Collect the expected and actual validation errors
4265
awk '/^Validate extension JSON:/' - < "$validate" | sort > "$validation_output"
43-
awk '/^Validate extension JSON:/' - < "$file" | sort > "$allowed_errors"
66+
awk '/^Validate extension JSON:/' - < "$expected_errors" | sort > "$allowed_errors"
4467

4568
# Differences between the expected and actual errors
4669
new_validation_error="$(comm -23 "$validation_output" "$allowed_errors")"
4770
obsolete_validation_error="$(comm -13 "$validation_output" "$allowed_errors")"
4871

49-
if [ -n "$obsolete_validation_error" ]; then
72+
if [ -n "$obsolete_validation_error" ] && [ "$warn_extra" = "1" ]; then
5073
make_annotation "The following validation errors no longer occur (compared to $reference_tag):" "$obsolete_validation_error" warning "$file"
5174
fi
5275
if [ -n "$new_validation_error" ]; then
5376
make_annotation "Compatibility to $reference_tag is broken in the following ways:" "$new_validation_error" error "$file"
5477
has_problems=1
5578
fi
5679

57-
rm -f "$reference_file" "$validate" "$validation_output" "$allowed_errors"
58-
done <<< "$(find "$( dirname -- "$( dirname -- "${BASH_SOURCE[0]//\.\//}" )" )/extension_api_validation/" -name "*.expected")"
80+
rm -f "$reference_file" "$validate" "$validation_output" "$allowed_errors" "$expected_errors"
81+
done <<< "$(find "$api_validation_dir" -name "*.expected")"
5982

6083
exit $has_problems

0 commit comments

Comments
 (0)