Skip to content

Fetch multiple pages of tags#40

Closed
nylen wants to merge 1 commit intolalitkapoor:masterfrom
nylen:tags-multi-pages
Closed

Fetch multiple pages of tags#40
nylen wants to merge 1 commit intolalitkapoor:masterfrom
nylen:tags-multi-pages

Conversation

@nylen
Copy link
Copy Markdown
Contributor

@nylen nylen commented Oct 24, 2014

Over at request/request#1206 and request/request#1207 we're trying to update the changelog using github-changes. The issue I was running into was that only 1 page of tags is fetched (30 items by default).

This PR is an attempt to fetch all pages of tags from the GitHub API, but it's not quite working and I'm not sure why. I left per_page: 30 rather than setting per_page: 100 like you'd probably want, so that you can see the failure by running this command:

bin/index.js -o mikeal -r request \
  --auth --verbose \
  --file CHANGELOG.md \
  --only-pulls --use-commit-body
error [TypeError: Cannot call method 'utc' of undefined]
stack TypeError: Cannot call method 'utc' of undefined
    at /media/250/code/node/github-changes/bin/index.js:368:39
    at Array.forEach (native)
    at commitFormatter (/media/250/code/node/github-changes/bin/index.js:342:8)
    at formatter (/media/250/code/node/github-changes/bin/index.js:419:39)
    at /media/250/code/node/github-changes/bin/index.js:480:35
    at tryCatch1 (/media/250/code/node/github-changes/node_modules/bluebird/js/main/util.js:86:19)
    at Promise$_callHandler [as _callHandler] (/media/250/code/node/github-changes/node_modules/bluebird/js/main/promise.js:681:13)
    at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/media/250/code/node/github-changes/node_modules/bluebird/js/main/promise.js:697:18)
    at Promise$_settlePromiseAt [as _settlePromiseAt] (/media/250/code/node/github-changes/node_modules/bluebird/js/main/promise.js:879:14)
    at Promise$_fulfillPromises [as _fulfillPromises] (/media/250/code/node/github-changes/node_modules/bluebird/js/main/promise.js:981:14)

@lalitkapoor
Copy link
Copy Markdown
Owner

Thanks for pointing this out. I will look into this tomorrow afternoon.

@nylen
Copy link
Copy Markdown
Contributor Author

nylen commented Oct 26, 2014

@lalitkapoor ping? we have someone asking for a new version of request, and I can use my local version of github-changes for now, but I'd like to have something like this incorporated for future versions. (For now, just setting per_page : 100 should meet our needs - we currently have about 60 tagged releases.)

@lalitkapoor
Copy link
Copy Markdown
Owner

@nylen can you shoot a PR w/that and I'll accept?

@nylen
Copy link
Copy Markdown
Contributor Author

nylen commented Oct 26, 2014

Done, see #42.

@lalitkapoor lalitkapoor closed this Nov 8, 2017
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

Successfully merging this pull request may close these issues.

2 participants