Add stub functionality for base resources and implement review request.
Review Request #14337 — Created Feb. 10, 2025 and submitted — Latest diff uploaded
This change adds support for
@api_stub
for the base resource class,
used for "special" links (create/update/delete/etc) as well as for any
resource-specific links.This also adds a new decorator,
@request_method_returns
, which works
like@request_method
, but can plumb through a specific return type.
This has been used to makeResourceLinkField
generic, so that calls to
aResourceLinkField.get()
method can specify their return type as a
specific resource subclass.Stubs for common special methods have been added to Resource,
ItemResource, and ListResource. This change also adds resource-specific
stubs to ReviewRequestItemResource, for those links where we have
existing resource classes to reference. I've also added type hints for
the review request attributes.
- Ran unit tests.
- Smoke tested rbt commands.
- Ran a test script with debug logging to see that the stub debug info
looked as expected.
Diff Revision 2 (Latest)
Commits
Files
rbtools/api/resource/base.py |
---|
rbtools/api/resource/diff.py |
---|
rbtools/api/resource/diff_commit.py |
---|
rbtools/api/resource/diff_file_attachment.py |
---|
rbtools/api/resource/draft_diff_commit.py |
---|
rbtools/api/resource/draft_file_attachment.py |
---|
rbtools/api/resource/draft_screenshot.py |
---|
rbtools/api/resource/file_attachment.py |
---|
rbtools/api/resource/file_diff.py |
---|
rbtools/api/resource/mixins.py |
---|
rbtools/api/resource/review_request.py |
---|
rbtools/api/resource/root.py |
---|
rbtools/api/resource/screenshot.py |
---|