500 error when add back deleted PR reviewer via RESTful api #2719
Travis Blasingame opened 3 months ago

I have run into an odd situation. I am trying to use the API to automate some workflows. One thing I want to do is automatically assign reviewers to a pull request as needed. I noticed that I was getting a 500 error when trying to assign a user to the review. Looking in the server logs showed a duplicate entry error. The API for /pull/ID/reviewers didn't show the user on the pull request.

By going through the /pull-request-reviews one by one I finally found the user with the EXCLUDED status. I assume this happens when the user is removed from the review by someone.

My question is this. Since that review doesn't show on the list of reviewers for the pull request, and there is no flag or query to include them, how are we supposed to find the ID to update the review to PENDING?

Thank you

Additional note: Our OneDev version is 11.11.4

EDIT: It seems like the way to do this is from the user side with users/ID/pull-request-reviews. This will work, but it feels odd that the pull requests do not have a way to find their own excluded reviews.

  • Robin Shen commented 3 months ago

    This is a bug, the API should change user from EXCLUDED to PENDING this this case.

  • Robin Shen changed fields 3 months ago
    Name Previous Value Current Value
    Type
    Question
    Bug
    Affected Versions
    empty
    All Versions
  • Robin Shen changed title 2 months ago
    Previous Value Current Value
    API: Issue with excluded reviewers
    500 error when add back deleted PR reviewer via RESTful api
  • OneDev commented 2 months ago

    State changed as build OD-7256 (15.0.0) is successful

  • OneDev changed state to 'Closed' 2 months ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
All Versions
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2719
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover