This pr adds a new POST route api/simulate/:owner/:repo/:number. This route requires a GitHub bearer token with access to read the the underlying pull request.
When called, policy-bot will re-evaluate the policy of the referenced pr and return a simulated result back to the caller. The result does NOT get written back to the pull request as a STATUS.
A request body can be included specifying a number of options which can modify how the simulation runs. These should be relatively easy to extend with additional options in the future.
Today this supports:
Simulating new comments.
Simulating new reviews.
Simulating ignoring existing reviews and comments.
Simulating a change of the base branch.
The route can also be used without any options to trigger policy-bot to re-evaluate the pull request as is.
The returned simulated result does not currently contain all of the fields of the base result but it should be easy to extend as needed.
This pr adds a new
POST
routeapi/simulate/:owner/:repo/:number
. This route requires a GitHub bearer token with access to read the the underlying pull request.When called, policy-bot will re-evaluate the policy of the referenced pr and return a
simulated
result back to the caller. The result does NOT get written back to the pull request as aSTATUS
.A request body can be included specifying a number of options which can modify how the simulation runs. These should be relatively easy to extend with additional options in the future.
Today this supports:
base
branch.The route can also be used without any options to trigger policy-bot to re-evaluate the pull request as is.
The returned simulated result does not currently contain all of the fields of the base
result
but it should be easy to extend as needed.