Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Mar 29, 2024

Basic instructions and examples for using this feature

@AThousandShips AThousandShips added enhancement content:new page Issues and PRs related to creation of new documentation pages for new or undocumented features area:contributing Issues and PRs related to the Contributing/Development section of the documentation topic:buildsystem cherrypick:4.1 cherrypick:4.2 labels Mar 29, 2024
@AThousandShips AThousandShips requested review from a team March 29, 2024 18:42
Copy link

@Bromeon Bromeon left a 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.

@dsnopek
Copy link
Contributor

dsnopek commented Apr 2, 2024

Thanks for starting on this! I look forward to linking to it in the future :-)

@AThousandShips AThousandShips force-pushed the compat_doc branch 2 times, most recently from 63f7dbf to f3e28b0 Compare April 16, 2024 16:36
@AThousandShips
Copy link
Member Author

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

@AThousandShips AThousandShips marked this pull request as ready for review April 16, 2024 17:55
@AThousandShips AThousandShips requested a review from a team April 16, 2024 17:55
Copy link
Contributor

@dsnopek dsnopek left a 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.

Comment on lines +31 to +32
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));
Copy link
Contributor

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:

Suggested change
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);

Comment on lines +70 to +71
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
Copy link
Contributor

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:

Suggested change
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``:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Comment on lines +135 to +136
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:contributing Issues and PRs related to the Contributing/Development section of the documentation cherrypick:4.1 cherrypick:4.2 content:new page Issues and PRs related to creation of new documentation pages for new or undocumented features enhancement topic:buildsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants