Prevent Non Collaborator Aliases Version 2: Using Permission API and Batch Call #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a previous PR (#5), the
request reviewer
call was converted from a batch call to multiple individual calls in order to support cases where an alias no longer has access to the repo.In very rare circumstances, it has been reported that the action will actually remove add (and then automatically get removed) from the pull request. Since the action doesn't invoke any
remove reviewer
APIs, the only theory so far is that making multiple edit request simultaneously has exposed a rare syncronous problem, usually when combined with auto assignment. This scenario is rare enough that it has been difficult to get reproductions of the issue in test environments.The proposed solution is to instead async request the permission status of every alias the action will attempt to add. After locally filtering out all aliases that do not have permissions, make a batch request with all of the remaining aliases. This adds 1 extra network call compared to the solution in 5, but reduces the number of network calls attempting to edit the PR down to 1.