Deeper Bug Tracker Integrations

Review Request #9544 — Created Jan. 27, 2018 and discarded

Information

Review Board
master

Reviewers

Added options to the Github repository form to enable posting
to a Github issue when a bug is first mentioned or when a
review request referencing a bug is updated and closing a
Github issue when a Review Request is closed.
Added properties to Repository for the new bug tracker
integration options.
Added new methods to HostingService that are called when the
review request is closed or updated to take care of these
deeper bug tracking options.
Added the ability to post to bug on first reference.
Added a bug tracker form to HostingService.
Updated RepositoryForm to use the new bug tracker form in the
bug tracker section if it exists.

Created unit tests in reviewboard.hostingsvcs.tests.test_github.py
Tested everything with a private GitHub repo and a local reviewboard instance.

Description From Last Updated

E501 line too long (81 > 79 characters)

reviewbotreviewbot

"Enable ..." is a little bit passive. How about: "Post an update to the bug tracker when review requests or …

daviddavid

How is this different from the posting/closing bits? Can we just use those and skip this one?

daviddavid

Same sort of comment here: "Close related bugs when the review request is closed."

daviddavid

Missing a docstring (I know the others don't have them--that's older code)

daviddavid

Missing a docstring (I know the others don't have them--that's older code)

daviddavid

Missing a docstring.

daviddavid

Missing a docstring.

daviddavid

E501 line too long (80 > 79 characters)

reviewbotreviewbot

This should refer to commenting on the issue, not editing

daviddavid

Should "enables" be "enable"? On second thought, is this used at all?

daviddavid

Needs a docstring.

daviddavid

E722 do not use bare except'

reviewbotreviewbot

Needs a docstring.

daviddavid

"Review Board" should always have a space. We also tend to prefer wrapping the whole thing in parens instead of …

daviddavid

E501 line too long (106 > 79 characters)

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

Docstring should explain what the args/returns are.

daviddavid

E722 do not use bare except'

reviewbotreviewbot

In addition to Review Bot's complaint about line length, r comes before s.

daviddavid

E501 line too long (87 > 79 characters)

reviewbotreviewbot

Missing a docstring.

daviddavid

Add a blank line between these two.

daviddavid

We should probably create a property in the hosting service that wraps this extra_data access.

daviddavid

Add another blank line here.

daviddavid

E302 expected 2 blank lines, found 1

reviewbotreviewbot

Missing a docstring.

daviddavid

Add a blank line between these two.

daviddavid

We should probably create a property in the hosting service that wraps this extra_data access.

daviddavid

E722 do not use bare except'

reviewbotreviewbot

W503 line break before binary operator

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

F401 'reviewboard.reviews.models.ReviewRequest' imported but unused

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

W503 line break before binary operator

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (81 > 79 characters)

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E501 line too long (87 > 79 characters)

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

Just an empty line in the function docstring.

JT jtrang

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

For someone who is unfamiliar with the project, I think it would be useful to add a comment about why …

JT jtrang

Same comment as above to add a comment or TODO note.

JT jtrang

I see that after the first and, there is a check for (<expr> and <expr>) or (<expr> and <expr>). For …

JT jtrang

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E722 do not use bare except'

reviewbotreviewbot

E127 continuation line over-indented for visual indent

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

flake8

JC
Review request changed
Description:
   

Added boolean flags to HostingServices to see whether the repository

    supports posting to a bug tracker when a change is posted, closing a bug
    when a reviw request is closed, or notifying a bug tracker when there's
    new reviews or review requests for the bug.

   
   

Added a couple extra checkboxes to the Github repository form to enable

    these options.

  +
  +
  +
  +

Added a new method to HostingService that is called when the

  + review_request_closed signal is sent.

  +
  +

  +
  +

Added a field to the Private Github repository fields to get the value

  + from an extra checkbox to enable the new options for configuring a bug
  + tracker.

  +
  +
  +
  +

Modified review_request_closed method to close the bug when the Review

  + Request is closed if enable_closing_remote_bug is set to True.

  +
  +

  +
  +

Added methods to github.py and hostingservices.py to enable sending an

  + HTTP Patch request in order to allow closing a Github Issue.

  +
  +
  +
  +

Added a method to post to a github issue when a ReviewRequest is

  + updated.

Commit:
98c280f00197e0c99a751a5fcb70e226f002f4e6
d34e02768cbc4cd2dfc9e5e6c077563b115e5f23

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
david
  1. 
      
  2. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
     
    Show all issues

    "Enable ..." is a little bit passive. How about:

    "Post an update to the bug tracker when review requests or reviews are published."

  3. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    How is this different from the posting/closing bits? Can we just use those and skip this one?

  4. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Same sort of comment here:

    "Close related bugs when the review request is closed."

  5. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Missing a docstring (I know the others don't have them--that's older code)

  6. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Missing a docstring (I know the others don't have them--that's older code)

  7. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Missing a docstring.

  8. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Missing a docstring.

  9. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    This should refer to commenting on the issue, not editing

  10. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Should "enables" be "enable"?

    On second thought, is this used at all?

    1. No it isn't. It was one of my first attemps to access the values of the new fields. I'll remove it.

  11. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Needs a docstring.

  12. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Needs a docstring.

  13. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    "Review Board" should always have a space. We also tend to prefer wrapping the whole thing in parens instead of using the continuation character.

  14. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Show all issues

    Docstring should explain what the args/returns are.

  15. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
     
    Show all issues

    In addition to Review Bot's complaint about line length, r comes before s.

  16. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
    Show all issues

    Missing a docstring.

  17. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
     
    Show all issues

    Add a blank line between these two.

  18. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
    Show all issues

    We should probably create a property in the hosting service that wraps this extra_data access.

  19. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
    Show all issues

    Add another blank line here.

  20. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
    Show all issues

    Missing a docstring.

  21. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
     
    Show all issues

    Add a blank line between these two.

  22. reviewboard/hostingsvcs/service.py (Diff revision 2)
     
     
    Show all issues

    We should probably create a property in the hosting service that wraps this extra_data access.

  23. 
      
JC
Review request changed
Commit:
d34e02768cbc4cd2dfc9e5e6c077563b115e5f23
a7c49e4a20c12bd22a4d13acace19c86b7b75eb6

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
Review request changed
Summary:
[WIP] Added a method to post to a Github issue when a ReviewRequest is updated
[WIP] Added docstrings and post to bug on first reference
Description:
   

Added boolean flags to HostingServices to see whether the repository

    supports posting to a bug tracker when a change is posted, closing a bug
    when a reviw request is closed, or notifying a bug tracker when there's
    new reviews or review requests for the bug.

   
   

Added a couple extra checkboxes to the Github repository form to enable

    these options.

   
   
   
   

Added a new method to HostingService that is called when the

    review_request_closed signal is sent.

   
   

   
   

Added a field to the Private Github repository fields to get the value

    from an extra checkbox to enable the new options for configuring a bug
    tracker.

   
   
   
   

Modified review_request_closed method to close the bug when the Review

    Request is closed if enable_closing_remote_bug is set to True.

   
   

   
   

Added methods to github.py and hostingservices.py to enable sending an

    HTTP Patch request in order to allow closing a Github Issue.

   
   
   
   

Added a method to post to a github issue when a ReviewRequest is

    updated.

  +
  +
  +
  +

Added docstrings and post to bug on first reference

Commit:
a7c49e4a20c12bd22a4d13acace19c86b7b75eb6
f1f4d66339a505b6dec4dc90e14ec7901a84aa47

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
Review request changed
Description:
   

Added boolean flags to HostingServices to see whether the repository

    supports posting to a bug tracker when a change is posted, closing a bug
    when a reviw request is closed, or notifying a bug tracker when there's
    new reviews or review requests for the bug.

   
   

Added a couple extra checkboxes to the Github repository form to enable

    these options.

   
   
   
   

Added a new method to HostingService that is called when the

    review_request_closed signal is sent.

   
   

   
   

Added a field to the Private Github repository fields to get the value

    from an extra checkbox to enable the new options for configuring a bug
    tracker.

   
   
   
   

Modified review_request_closed method to close the bug when the Review

    Request is closed if enable_closing_remote_bug is set to True.

   
   

   
   

Added methods to github.py and hostingservices.py to enable sending an

    HTTP Patch request in order to allow closing a Github Issue.

   
   
   
   

Added a method to post to a github issue when a ReviewRequest is

    updated.

   
   
   
~  

Added docstrings and post to bug on first reference

  ~

Added docstrings and post to bug on first reference.

  +
  +

  +
  +
  +
  +

Added a bug tracker form to HostingService.

  + Updated RepositoryForm to use the new Bug tracker form in the Bug tracker section if it exists.

Commit:
f1f4d66339a505b6dec4dc90e14ec7901a84aa47
9576897c151d96d8078044e3032f635cc1898dfd

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
Review request changed
Description:
   

Added boolean flags to HostingServices to see whether the repository

    supports posting to a bug tracker when a change is posted, closing a bug
    when a reviw request is closed, or notifying a bug tracker when there's
    new reviews or review requests for the bug.

   
   

Added a couple extra checkboxes to the Github repository form to enable

    these options.

   
   
   
   

Added a new method to HostingService that is called when the

    review_request_closed signal is sent.

   
   

   
   

Added a field to the Private Github repository fields to get the value

    from an extra checkbox to enable the new options for configuring a bug
    tracker.

   
   
   
   

Modified review_request_closed method to close the bug when the Review

    Request is closed if enable_closing_remote_bug is set to True.

   
   

   
   

Added methods to github.py and hostingservices.py to enable sending an

    HTTP Patch request in order to allow closing a Github Issue.

   
   
   
   

Added a method to post to a github issue when a ReviewRequest is

    updated.

   
   
   
   

Added docstrings and post to bug on first reference.

   
   

   
   
   
   

Added a bug tracker form to HostingService.

    Updated RepositoryForm to use the new Bug tracker form in the Bug tracker section if it exists.

  +
  +
  +
  +

Added properties to Repository, and fixed any issues I found.

Commit:
9576897c151d96d8078044e3032f635cc1898dfd
d7d59b077cba78e09e60c4ed789fdcdc6d87711e

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
Review request changed
Summary:
[WIP] Added docstrings and post to bug on first reference
[WIP] Fixed a bunch of test failures caused by changes made
Description:
   

Added boolean flags to HostingServices to see whether the repository

    supports posting to a bug tracker when a change is posted, closing a bug
    when a reviw request is closed, or notifying a bug tracker when there's
    new reviews or review requests for the bug.

   
   

Added a couple extra checkboxes to the Github repository form to enable

    these options.

   
   
   
   

Added a new method to HostingService that is called when the

    review_request_closed signal is sent.

   
   

   
   

Added a field to the Private Github repository fields to get the value

    from an extra checkbox to enable the new options for configuring a bug
    tracker.

   
   
   
   

Modified review_request_closed method to close the bug when the Review

    Request is closed if enable_closing_remote_bug is set to True.

   
   

   
   

Added methods to github.py and hostingservices.py to enable sending an

    HTTP Patch request in order to allow closing a Github Issue.

   
   
   
   

Added a method to post to a github issue when a ReviewRequest is

    updated.

   
   
   
   

Added docstrings and post to bug on first reference.

   
   

   
   
   
   

Added a bug tracker form to HostingService.

    Updated RepositoryForm to use the new Bug tracker form in the Bug tracker section if it exists.

   
   
   
   

Added properties to Repository, and fixed any issues I found.

  +
  +
  +
  +

Fixed a bunch of test failures caused by changes made.

Commit:
d7d59b077cba78e09e60c4ed789fdcdc6d87711e
9e396e93938f978372ac480678f427c6015b0e30

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
Review request changed
Description:
   

Added boolean flags to HostingServices to see whether the repository

    supports posting to a bug tracker when a change is posted, closing a bug
    when a reviw request is closed, or notifying a bug tracker when there's
    new reviews or review requests for the bug.

   
   

Added a couple extra checkboxes to the Github repository form to enable

    these options.

   
   
   
   

Added a new method to HostingService that is called when the

    review_request_closed signal is sent.

   
   

   
   

Added a field to the Private Github repository fields to get the value

    from an extra checkbox to enable the new options for configuring a bug
    tracker.

   
   
   
   

Modified review_request_closed method to close the bug when the Review

    Request is closed if enable_closing_remote_bug is set to True.

   
   

   
   

Added methods to github.py and hostingservices.py to enable sending an

    HTTP Patch request in order to allow closing a Github Issue.

   
   
   
   

Added a method to post to a github issue when a ReviewRequest is

    updated.

   
   
   
   

Added docstrings and post to bug on first reference.

   
   

   
   
   
   

Added a bug tracker form to HostingService.

    Updated RepositoryForm to use the new Bug tracker form in the Bug tracker section if it exists.

   
   
   
   

Added properties to Repository, and fixed any issues I found.

   
   
   
~  

Fixed a bunch of test failures caused by changes made.

  ~

Fixed a bunch of test failures caused by changes made.

  + Fixed Review Bot issues.

Commit:
9e396e93938f978372ac480678f427c6015b0e30
02f519019115a982677a661bb9b9d8c8daad30d4

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JT
  1. 
      
  2. reviewboard/hostingsvcs/github.py (Diff revision 8)
     
     
    Show all issues

    Just an empty line in the function docstring.

  3. reviewboard/hostingsvcs/service.py (Diff revision 8)
     
     
    Show all issues

    For someone who is unfamiliar with the project, I think it would be useful to add a comment about why the function is not implemented, or a TODO comment if the implementation is expected down the line (or in a separate project).

  4. reviewboard/hostingsvcs/service.py (Diff revision 8)
     
     
    Show all issues

    Same comment as above to add a comment or TODO note.

  5. reviewboard/hostingsvcs/service.py (Diff revision 8)
     
     
    Show all issues

    I see that after the first and, there is a check for (<expr> and <expr>) or (<expr> and <expr>). For readability, I think it might be useful to extract these booleans into separate variables with meaningful names.

  6. 
      
JC
Review request changed
Summary:
[WIP] Fixed a bunch of test failures caused by changes made
[WIP] Deeper Bug Tracker Integrations
Description:
~  

Added boolean flags to HostingServices to see whether the repository

~   supports posting to a bug tracker when a change is posted, closing a bug
~   when a reviw request is closed, or notifying a bug tracker when there's
~   new reviews or review requests for the bug.

~  
~  

Added a couple extra checkboxes to the Github repository form to enable

~   these options.

~  
~  
~  
~  

Added a new method to HostingService that is called when the

~   review_request_closed signal is sent.

~  
  ~

Added options to the Github repository form to enable posting

  ~ to a Github issue when a bug is first mentioned or when a
  ~ review request referencing a bug is updated and closing a
  ~ Github issue when a Review Reques is closed.
  ~ Added properties to Repository for the new bug tracker
  ~ integration options.
  ~ Added new methods to HostingService that are called when the
  ~ review request is closed or updated to take care of these
  ~ deeper bug tracking options.
  ~ Added the ability to post to bug on first reference.
  ~ Added a bug tracker form to HostingService.
  ~ Updated RepositoryForm to use the new bug tracker form in the
  ~ bug tracker section if it exists.

-  

-  
-  

Added a field to the Private Github repository fields to get the value

-   from an extra checkbox to enable the new options for configuring a bug
-   tracker.

-  
-  
-  
-  

Modified review_request_closed method to close the bug when the Review

-   Request is closed if enable_closing_remote_bug is set to True.

-  
-  

-  
-  

Added methods to github.py and hostingservices.py to enable sending an

-   HTTP Patch request in order to allow closing a Github Issue.

-  
-  
-  
-  

Added a method to post to a github issue when a ReviewRequest is

-   updated.

-  
-  
-  
-  

Added docstrings and post to bug on first reference.

-  
-  

-  
-  
-  
-  

Added a bug tracker form to HostingService.

-   Updated RepositoryForm to use the new Bug tracker form in the Bug tracker section if it exists.

-  
-  
-  
-  

Added properties to Repository, and fixed any issues I found.

-  
-  
-  
-  

Fixed a bunch of test failures caused by changes made.

-   Fixed Review Bot issues.

Commit:
02f519019115a982677a661bb9b9d8c8daad30d4
419968a97078679c63077231efb5cf48ceb2601a

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

JC
david
Review request changed
Status:
Discarded