Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listPullRequests({ state: 'all' }) does not return all pull requests. #593

Open
sustained opened this issue Oct 7, 2019 · 3 comments
Open

Comments

@sustained
Copy link

Reproduction

const assert = require('assert')
const Github = require('github-api')

const github = new Github()

;(async () => {
  const repo = github.getRepo('vuejs', 'rfcs')

  const all = (await repo.listPullRequests({ state: 'all' })).data.length
  const open = (await repo.listPullRequests({ state: 'open' })).data.length
  const closed = (await repo.listPullRequests({ state: 'closed' })).data.length

  assert.equal(all, open + closed)
})()

See

https://github.com/vuejs/rfcs/pulls

@sustained
Copy link
Author

Ah. It's relating to all these pagination issues.

Workaround

  const all = await repo._requestAllPages(
    `/repos/${repo.__fullname}/pulls?state=all`,
  )

@j-rewerts
Copy link
Member

Is this related to pagination? This just seems like an options-passing issue.

@sustained
Copy link
Author

I don't know.

But I found the _requestAllPages workaround in another issue relating to pagination.

So presumed it was that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants