algolia / shipjs

Take control of what is going to be your next release.
https://community.algolia.com/shipjs/
MIT License
766 stars 30 forks source link

pullRequestReviewers octokit deprecation error #956

Closed vinayakkulkarni closed 3 years ago

vinayakkulkarni commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. install ship.js 0.23.3
  2. in ship.config.js, add pullRequestReviewers: ['vinayakkulkarni']
  3. npm run release

Expected behavior A new automated PR should be created with default reviewers.

Screenshots

remote:
remote: Create a pull request for 'releases/v0.1.0' on GitHub by visiting:
remote:      https://github.com/<redacted>/pull/new/releases/v0.1.0
remote:
To https://github.com/<redacted>
 * [new branch]      releases/v0.1.0 -> releases/v0.1.0
› Creating a pull request.
$ git remote prune origin
octokit.pulls.createReviewRequest() has been renamed to octokit.pulls.requestReviewers()
Deprecation: [@octokit/request-error] `error.code` is deprecated, use `error.status`.
    at RequestError.get (/Users/vinayak/Development/Work/OSS/<redacted>/node_modules/@octokit/request-error/dist-node/index.js:57:21)
    at Proxy.cli (/Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/src/cli.js:50:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/bin/shipjs:7:5
RequestError [HttpError]: Review cannot be requested from pull request author.
    at /Users/vinayak/Development/Work/OSS/<redacted>/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/src/step/prepare/createPullRequest.js:82:7
    at async default (/Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/src/step/prepare/createPullRequest.js:20:3)
    at async prepare (/Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/src/flow/prepare.js:112:30)
    at async Proxy.cli (/Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/src/cli.js:48:5)
    at async /Users/vinayak/Development/Work/OSS/<redacted>/node_modules/shipjs/bin/shipjs:7:5 {
  status: 422,

Environment (please complete the following information):

Additional context This is due to octokit's deprecation of createReviewRequest, instead it's requestReviewers

eunjae-lee commented 3 years ago

Hello @vinayakkulkarni, Although your PR seems correct, I don't think it will fix your issue. That's just a warning, but the real error that stopped your release process was:

RequestError [HttpError]: Review cannot be requested from pull request author.

You're assigning yourself as a reviewer and GitHub doesn't allow it. That's why it failed.

eunjae-lee commented 3 years ago

Feel free to reopen if needed :)