Remove deprecated code from Review Board.

Review Request #12885 — Created March 14, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

This change removes all RemovedInReviewBoard60 things from our codebase.
The only complicated part of this is that the mercurial diff parsers
were still using the old get_orig_commit_id method, so those have been
updated to set the data correctly on the ParsedDiffChange.

This also makes one small fix to the filediff API resource to handle a
deprecation removal in Djblets.

Ran unit tests.

Summary ID
Remove deprecated code from Review Board.
This change removes all RemovedInReviewBoard60 things from our codebase. The only complicated part of this is that the mercurial diff parsers were still using the old `get_orig_commit_id` method, so those have been updated to set the data correctly on the `ParsedDiffChange`. This also makes one small fix to the filediff API resource to handle a deprecation removal in Djblets. Testing Done: Ran unit tests.
525fa710400876f37a63e803e137a56aa7fefad0
Description From Last Updated

Can you verify if rbintegrations, Power Pack, and Review Bot tests pass?

chipx86chipx86

I think we need to add this here: * Made ``diff_settings`` mandatory.

maubinmaubin

Same comment here and below about adding the * Made ``diff_settings`` mandatory.

maubinmaubin

I think in Christian's review he mentioned that these should all be keyword only, and to add the decorator.

maubinmaubin

line too long (82 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

While here, can you fix up the ordering of these imported classes?

chipx86chipx86

Given the "diff_settings will be required," and diff_settings being keyword-only, we can remove the None and callers will have to …

chipx86chipx86

This could also be removed once the above is changed.

chipx86chipx86

We don't explicitly state this (oops), but as the old argument is deprecated, we can remove enable_syntax_highlighting here and probably …

chipx86chipx86

The docs state that parsed_diff_change is mandatory in 6.0. Since this is a keyword argument, I propose: Making all arguments …

chipx86chipx86

While here and impacting keyword argument order, let's make all these keyword-only arguments and use the decorator to deprecate positional …

chipx86chipx86

This should also be removed.

chipx86chipx86

Since we're affecting keyword argument order now, let's make these keyword-only and add the decorator.

chipx86chipx86

Same comment re: keyword-only arguments and decorator.

chipx86chipx86

line too long (81 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

line too long (85 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
maubin
  1. Ship It!
  2. 
      
david
chipx86
  1. The change as-is looks great.

    Many of the changing function signatures should also be made keyword-only while we're changing them. I commented on the major locations. This could all be done separately from this change though.

  2. Show all issues

    Can you verify if rbintegrations, Power Pack, and Review Bot tests pass?

    1. Looks like rbintegrations needs a quick fix. Everything else is good.

  3. reviewboard/admin/widgets.py (Diff revision 3)
     
     
    Show all issues

    While here, can you fix up the ordering of these imported classes?

  4. reviewboard/diffviewer/chunk_generator.py (Diff revision 3)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Given the "diff_settings will be required," and diff_settings being keyword-only, we can remove the None and callers will have to provide it (will need a re-run of the test suite though).

  5. reviewboard/diffviewer/chunk_generator.py (Diff revision 3)
     
     
     
     
     
     
    Show all issues

    This could also be removed once the above is changed.

  6. reviewboard/diffviewer/diffutils.py (Diff revision 3)
     
     
     
     
    Show all issues

    We don't explicitly state this (oops), but as the old argument is deprecated, we can remove enable_syntax_highlighting here and probably make diff_settings mandatory.

  7. reviewboard/diffviewer/parser.py (Diff revision 3)
     
     
    Show all issues

    The docs state that parsed_diff_change is mandatory in 6.0. Since this is a keyword argument, I propose:

    1. Making all arguments keyword-only, and documenting that.
    2. Use the @deprecate_non_keyword_only_args arguments.
    3. Assert parsed_diff_change until 7.

    That will also let us remove the conditional below.

  8. reviewboard/diffviewer/renderers.py (Diff revision 3)
     
     
     
     
     
     
    Show all issues

    While here and impacting keyword argument order, let's make all these keyword-only arguments and use the decorator to deprecate positional use.

    As per docs, diff_settings is also now required, so we can remove the None.

  9. reviewboard/diffviewer/renderers.py (Diff revision 3)
     
     
     
     
    Show all issues

    This should also be removed.

  10. reviewboard/reviews/managers.py (Diff revision 3)
     
     
     
    Show all issues

    Since we're affecting keyword argument order now, let's make these keyword-only and add the decorator.

  11. reviewboard/scmtools/managers.py (Diff revision 3)
     
     
     
    Show all issues

    Same comment re: keyword-only arguments and decorator.

  12. 
      
david
Review request changed
Commits:
Summary ID
Remove deprecated code from Review Board.
This change removes all RemovedInReviewBoard60 things from our codebase. The only complicated part of this is that the mercurial diff parsers were still using the old `get_orig_commit_id` method, so those have been updated to set the data correctly on the `ParsedDiffChange`. This also makes one small fix to the filediff API resource to handle a deprecation removal in Djblets. Testing Done: Ran unit tests.
8ddd63cc917721bd5c693b816097a5d7de1e275a
Remove deprecated code from Review Board.
This change removes all RemovedInReviewBoard60 things from our codebase. The only complicated part of this is that the mercurial diff parsers were still using the old `get_orig_commit_id` method, so those have been updated to set the data correctly on the `ParsedDiffChange`. This also makes one small fix to the filediff API resource to handle a deprecation removal in Djblets. Testing Done: Ran unit tests.
fccadb70734d3e6e1d94faa0ff3f554ab4ea6eac

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
maubin
  1. 
      
  2. reviewboard/diffviewer/chunk_generator.py (Diff revisions 1 - 5)
     
     
     
    Show all issues

    I think we need to add this here:
    * Made ``diff_settings`` mandatory.

  3. reviewboard/diffviewer/diffutils.py (Diff revisions 1 - 5)
     
     
    Show all issues

    Same comment here and below about adding the
    * Made ``diff_settings`` mandatory.

  4. reviewboard/diffviewer/renderers.py (Diff revisions 1 - 5)
     
     
    Show all issues

    I think in Christian's review he mentioned that these should all be keyword only, and to add the decorator.

  5. 
      
david
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (5924fdf)