Modernize code in rbintegratons.

Review Request #12483 — Created July 21, 2022 and submitted

Information

rbintegrations
release-3.x

Reviewers

When we updated rbintegrations to work with Review Board 5.0, we only
really did the minimum required to make things work. Because
rbintegrations 3.0+ will only be used with Review Board 5.0+ / Django
3.2+ / Python 3.7+, we can do a lot more. This change updates the
codebase to handle some additional modernization tasks:

  • Remove __future__ imports.
  • Switch from django.conf.urls to django.urls and swap out url() for
    the new path().
  • Move from ugettext to gettext.
  • Eliminate fallback imports and conditional logic for handling various
    versions of Review Board.
  • Ran unit tests.
  • Did some superficial testing setting up various integration
    configurations.
Summary ID
Modernize code in rbintegratons.
When we updated rbintegrations to work with Review Board 5.0, we only really did the minimum required to make things work. Because rbintegrations 3.0+ will only be used with Review Board 5.0+ / Django 3.2+ / Python 3.7+, we can do a lot more. This change updates the codebase to handle some additional modernization tasks: - Remove `__future__` imports. - Switch from `django.conf.urls` to `django.urls` and swap out `url()` for the new `path()`. - Move from `ugettext` to `gettext`. - Eliminate fallback imports and conditional logic for handling various versions of Review Board. Testing Done: - Ran unit tests. - Did some superficial testing setting up various integration configurations.
a4fa4da30a4bba53ab187a7cf710e3fd4fdaa187
Description From Last Updated

'django.utils.translation.gettext' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

include lines need to be indented 1.

chipx86chipx86

Maybe just return response.data now.

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

flake8

david
chipx86
  1. 
      
  2. rbintegrations/extension.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
    Show all issues

    include lines need to be indented 1.

  3. rbintegrations/jenkinsci/api.py (Diff revision 2)
     
     
     
     
     
     
     
     
    Show all issues

    Maybe just return response.data now.

  4. 
      
maubin
  1. Ship It!
  2. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.x (533053b)