Add new resources, part 4/7.

Review Request #14377 — Created March 20, 2025 and updated

Information

RBTools
master

Reviewers

This change adds the following new resource implementations:
- DiffCommentItemResource
- DiffCommentListResource
- GeneralCommentItemResource
- GeneralCommentListResource
- ReviewItemResource
- ReviewListResource
- ReviewReplyItemResource
- ReviewReplyListResource
- ScreenshotCommentItemResource
- ScreenshotCommentListResource

  • Ran unit tests.
  • Used the new resources from a test script and saw that everything
    worked as expected.
Summary ID
Add new resources, part 4/7.
This change adds the following new resource implementations: - DiffCommentItemResource - DiffCommentListResource - GeneralCommentItemResource - GeneralCommentListResource - ReviewItemResource - ReviewListResource - ReviewReplyItemResource - ReviewReplyListResource - ScreenshotCommentItemResource - ScreenshotCommentListResource Testing Done: - Ran unit tests. - Used the new resources from a test script and saw that everything worked as expected.
6fba8adcbfcb7cd6a29fdda4d9e3f36e9cee76bd
Description From Last Updated

too many blank lines (2) Column: 5 Error code: E303

reviewbotreviewbot

blank line at end of file Column: 1 Error code: W391

reviewbotreviewbot

This needs to be removed.

maubinmaubin

This needs to be removed.

maubinmaubin

This needs to be removed.

maubinmaubin

This needs to be removed.

maubinmaubin

This needs to be removed.

maubinmaubin

This should be "GeneralCommentListResource"

maubinmaubin

Should say "list resource"

maubinmaubin

Just a suggestion, but might be nice to format this like: issue_status: Optional[Literal[ 'dropped', 'open', 'resolved', ... ]] Keeps it …

chipx86chipx86

Typo: contont -> content

chipx86chipx86

Feel this reads better as "... only to the owner ..."

chipx86chipx86

We should be explicit about what the line number refers to (the line of the generated diff, not of a …

chipx86chipx86

These should be swapped.

chipx86chipx86

Typo: "when" -> "that".

chipx86chipx86

Can we list the version range? Same below.

chipx86chipx86

"file attachment"? Same below.

chipx86chipx86

This probably applies broadly, but given the "if present," I feel like I as the reader need to know what …

chipx86chipx86

"file attachment"

chipx86chipx86
There are no open issues
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
maubin
  1. 
      
  2. rbtools/api/resource/root.py (Diff revision 2)
     
     
     
    Show all issues

    This needs to be removed.

  3. rbtools/api/resource/root.py (Diff revision 2)
     
     
     
    Show all issues

    This needs to be removed.

  4. rbtools/api/resource/root.py (Diff revision 2)
     
     
     
    Show all issues

    This needs to be removed.

  5. rbtools/api/resource/root.py (Diff revision 2)
     
     
     
    Show all issues

    This needs to be removed.

  6. rbtools/api/resource/root.py (Diff revision 2)
     
     
     
    Show all issues

    This needs to be removed.

  7. rbtools/api/resource/root.py (Diff revision 2)
     
     
    Show all issues

    This should be "GeneralCommentListResource"

  8. rbtools/api/resource/screenshot.py (Diff revision 2)
     
     
    Show all issues

    Should say "list resource"

  9. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/resource/base_comment.py (Diff revision 3)
     
     
     
    Show all issues

    Just a suggestion, but might be nice to format this like:

    issue_status: Optional[Literal[
        'dropped',
        'open',
        'resolved',
        ...
    ]]
    

    Keeps it a bit more readable, and easier to keep in a nice alphabetical order.

  3. rbtools/api/resource/base_review.py (Diff revision 3)
     
     
    Show all issues

    Typo: contont -> content

  4. rbtools/api/resource/base_review.py (Diff revision 3)
     
     
    Show all issues

    Feel this reads better as "... only to the owner ..."

  5. rbtools/api/resource/diff_comment.py (Diff revision 3)
     
     
    Show all issues

    We should be explicit about what the line number refers to (the line of the generated diff, not of a file).

    Same below.

  6. rbtools/api/resource/file_attachment.py (Diff revision 3)
     
     
     
    Show all issues

    These should be swapped.

  7. Show all issues

    Typo: "when" -> "that".

  8. rbtools/api/resource/root.py (Diff revision 3)
     
     
    Show all issues

    Can we list the version range? Same below.

  9. rbtools/api/resource/root.py (Diff revision 3)
     
     
    Show all issues

    "file attachment"?

    Same below.

  10. rbtools/api/resource/root.py (Diff revision 3)
     
     
    Show all issues

    This probably applies broadly, but given the "if present," I feel like I as the reader need to know what I should expect if it's not present. The exceptions look like actual errors, and this doesn't return None.

    1. Hmm, let me think about this. Something being not found results in an APIError, which is documented in this method, but maybe there's a way to make that clearer across the board.

      Will add this to my notes for future changes.

  11. rbtools/api/resource/root.py (Diff revision 3)
     
     
    Show all issues

    "file attachment"

  12. 
      
david
Review request changed
Commits:
Summary ID
Add new resources, part 4/7.
This change adds the following new resource implementations: - DiffCommentItemResource - DiffCommentListResource - GeneralCommentItemResource - GeneralCommentListResource - ReviewItemResource - ReviewListResource - ReviewReplyItemResource - ReviewReplyListResource - ScreenshotCommentItemResource - ScreenshotCommentListResource Testing Done: - Ran unit tests. - Used the new resources from a test script and saw that everything worked as expected.
2ed3c0a7cc644a6610a15aa3a4548faaa9f14270
Add new resources, part 4/7.
This change adds the following new resource implementations: - DiffCommentItemResource - DiffCommentListResource - GeneralCommentItemResource - GeneralCommentListResource - ReviewItemResource - ReviewListResource - ReviewReplyItemResource - ReviewReplyListResource - ScreenshotCommentItemResource - ScreenshotCommentListResource Testing Done: - Ran unit tests. - Used the new resources from a test script and saw that everything worked as expected.
6fba8adcbfcb7cd6a29fdda4d9e3f36e9cee76bd
Diff:

Revision 4 (+4236 -68)

Show changes

rbtools/api/resource/__init__.py
rbtools/api/resource/base_comment.py
rbtools/api/resource/base_review.py
rbtools/api/resource/diff_comment.py
rbtools/api/resource/file_attachment.py
rbtools/api/resource/file_attachment_comment.py
rbtools/api/resource/file_diff.py
rbtools/api/resource/general_comment.py
7 more

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
maubin
  1. Ship It!
  2. 
      
Loading...