New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to handle compatibility breakages #9158
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Sounds good so far, my feedback is very nitpicky 😅
Regarding an example, maybe we should use a real one that occurred? Then we don't need to make up things. It probably illustrates the principle better than an abstract one with "arg1", "arg2" etc.
Thanks for starting on this! I look forward to linking to it in the future :-) |
63f7dbf
to
f3e28b0
Compare
Added a concrete example, will go back over the style review as well, and the wording in the new example code isn't perfect, any feedback would be appreciated there |
f3e28b0
to
dcb5533
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is looking really great so far.
ClassDB::bind_method(D_METHOD("my_method", "arg1", "arg2"), &MyClass::my_method); | ||
ClassDB::bind_compatibility_method(D_METHOD("my_method", "arg1", "arg2", "arg3"), &MyClass::_my_method_bind_compat_1234, DEFVAL(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is a totally valid example of an argument being removed, I feel like the reverse case is more common: adding a new argument to method. So, I'd personally reverse these:
ClassDB::bind_method(D_METHOD("my_method", "arg1", "arg2"), &MyClass::my_method); | |
ClassDB::bind_compatibility_method(D_METHOD("my_method", "arg1", "arg2", "arg3"), &MyClass::_my_method_bind_compat_1234, DEFVAL(0)); | |
ClassDB::bind_method(D_METHOD("my_method", "arg1", "arg2", "arg3"), &MyClass::my_method, DEFVAL(0)); | |
ClassDB::bind_compatibility_method(D_METHOD("my_method", "arg1", "arg2"), &MyClass::_my_method_bind_compat_1234); |
Note the ``88047`` at the end of the method names should match the PR number, they should also start with a ``_`` to | ||
indicate that they are internal, and end with ``_bind_compat`` followed by the PR number. These compatibility methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This redundantly mentions the "PR number" twice in the same sentence. Maybe:
Note the ``88047`` at the end of the method names should match the PR number, they should also start with a ``_`` to | |
indicate that they are internal, and end with ``_bind_compat`` followed by the PR number. These compatibility methods | |
They should start with a ``_`` to indicate that they are internal, and end with ``_bind_compat`` followed by the PR number that introduced the change (``88047`` in this example). These compatibility methods |
|
||
Note the ``88047`` at the end of the method names should match the PR number, they should also start with a ``_`` to | ||
indicate that they are internal, and end with ``_bind_compat`` followed by the PR number. These compatibility methods | ||
need to be defined as well, and these were added in a dedicated file, in this case ``core/math/a_star_grid_2d.compat.inc``: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to be defined as well, and these were added in a dedicated file, in this case ``core/math/a_star_grid_2d.compat.inc``: | |
need to be implemented in a dedicated file, like ``core/math/a_star_grid_2d.compat.inc`` in this case: |
And finally the changes reported by the API validation step should be added to the relevant validation file, which because this was | ||
done during the development of 4.3 would be ``misc/extension_api_validation/4.2-stable.expected`` (including changes not shown in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And finally the changes reported by the API validation step should be added to the relevant validation file, which because this was | |
done during the development of 4.3 would be ``misc/extension_api_validation/4.2-stable.expected`` (including changes not shown in | |
And finally, the changes reported by the API validation step should be added to the relevant validation file. Because this was | |
done during the development of 4.3, this would be ``misc/extension_api_validation/4.2-stable.expected`` (including changes not shown in |
Added optional "allow_partial_path" argument to get_id_path and get_point_path methods in AStar classes. | ||
Compatibility methods registered. | ||
|
||
The instructions for how to add to that file are at the top of the file itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either here, or in the forth-coming instructions above, we should mention that in 99.99% of cases, we shouldn't be ignore the "hash changed" messages. If those don't go away on their own, then the developer will know they did something wrong with the compatibility methods.
Basic instructions and examples for using this feature