[WIP] Create a new Review Request after creating a PR on Github

Review Request #8437 — Created Sept. 25, 2016 and updated

finaiized
Review Board
master
a3f64e2...
reviewboard

This is mainly exploratory code.

Add support for automatically creating a review request
from a pull request.

Step one in integrating pull requests with Reviewboard is
to first create the review request when a PR happens.
For now, we provide support only for Github.

To set up the webhook, first make sure your repository
is linked to Reviewboard. Then, in your repo's settings on Github,
select 'Webhooks' and add
repos/{repo_num}/github/hooks/close-submitted/.
Make sure to unselect 'Push' and select 'Pull Request' for the event
you'd like to know about.

A new review request should now be created, and the ID of the pull request
that the review request was created from should be displayed on the
"Information" panel.

Note that if you're testing locally, you should
set up localtunnel
to foward your request.

Now when you make a commit, a review request should
be created automatically.

Still to do
Sync more data like branch info
Import diffs from the PR
* Link user from Github to Reviewboard (and handle cases where it doesn't exist)



Description From Last Updated

Col: 80 E501 line too long (85 > 79 characters)

reviewbotreviewbot

local variable 'e' is assigned to but never used

reviewbotreviewbot

Col: 80 E501 line too long (82 > 79 characters)

reviewbotreviewbot

local variable 'e' is assigned to but never used

reviewbotreviewbot

Col: 80 E501 line too long (100 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (81 > 79 characters)

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/hostingsvcs/github.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/hostingsvcs/github.py
    
    
  2. reviewboard/hostingsvcs/github.py (Diff revision 1)
     
     
    Col: 80
     E501 line too long (85 > 79 characters)
    
  3. reviewboard/hostingsvcs/github.py (Diff revision 1)
     
     
     local variable 'e' is assigned to but never used
    
  4. 
      
FI
FI
Review request changed

Change Summary:

  • Listen for Github's pull request webhook and create a new RR from it.
  • Show the pull request ID in the "Information" panel when the RR is created from a RR.
  • Set the summary and description of the RR from the PR's title and details.

Description:

   

This is mainly exploratory code.

   
   

Add support for automatically creating a review request

    from a pull request.

   
   

Step one in integrating pull requests with Reviewboard is

    to first create the review request when a PR happens.
~   For now, we provide support only for Github. Instead of
  ~ For now, we provide support only for Github.

-   listening for pull requests, we currently listen for commits,
-   because that is easier to test.

   
   

To set up the webhook, first make sure your repository

    is linked to Reviewboard. Then, in your repo's settings on Github,
    select 'Webhooks' and add
    repos/{repo_num}/github/hooks/close-submitted/.
~   Note that if you're testing locally, you should
  ~ Make sure to unselect 'Push' and select 'Pull Request' for the event
  + you'd like to know about.

  +
  +

A new review request should now be created, and the ID of the pull request

  + that the review request was created from should be displayed on the
  + "Information" panel.

  +
  +

Note that if you're testing locally, you should

    set up localtunnel
    to foward your request.

   
   

Now when you make a commit, a review request should

    be created automatically.

   
   

Still to do

~   Switch over to listening for PR creation over commits
  ~ Sync more data like branch info
-   Sync more data like branch info
-   Add a PR field that links back to the PR that created the review request
    Import diffs from the PR
    * Link user from Github to Reviewboard (and handle cases where it doesn't exist)

Commit:

-f9f515b04932853eefc5e466032d0bc5327ae36b
+a3f64e2779a65bef14568d21b80b6ad7999926e5

Diff:

Revision 2 (+95 -4)

Show changes

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/hostingsvcs/github.py
        reviewboard/reviews/models/review_request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/hostingsvcs/github.py
        reviewboard/reviews/models/review_request.py
    
    
  2. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Col: 80
     E501 line too long (82 > 79 characters)
    
  3. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
     local variable 'e' is assigned to but never used
    
  4. reviewboard/hostingsvcs/github.py (Diff revision 2)
     
     
    Col: 80
     E501 line too long (100 > 79 characters)
    
  5. reviewboard/reviews/builtin_fields.py (Diff revision 2)
     
     
    Col: 80
     E501 line too long (81 > 79 characters)
    
  6. 
      
Loading...