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

Tags not found #132

Closed
wellDan28 opened this issue Jan 29, 2018 · 12 comments · Fixed by #136
Closed

Tags not found #132

wellDan28 opened this issue Jan 29, 2018 · 12 comments · Fixed by #136
Labels

Comments

@wellDan28
Copy link
Contributor

Hey all,

I'm trying to run gren release against two specific tags and get the following error :

Getting all closed Pull RequestsTypeError: Cannot read property '1' of undefined

I think that this is happens because my repository have plenty of tags, and gren doesn't use paging when request tags from github api.

stacktrace:

at Gren._callee11$ (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\dist\Gren.js:1189:83)
at tryCatch (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\regenerator-runtime\runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\regenerator-runtime\runtime.js:114:21)
at step (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise ()
at new F (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\core-js\library\modules_export.js:35:28)
at Gren. (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12)
at Gren._getClosedIssues (C:\Users\dan\AppData\Roaming\nvm\v8.9.3\node_modules\github-release-notes\dist\Gren.js:1210:31)`

@alexcanessa
Copy link
Member

@wellDan28 actually gren does use pagination so that shouldn't really matter.
Let me look into this issue and I'll come back to you !

@wellDan28
Copy link
Contributor Author

I think that what causing this possibly bug is the following code(part of the '_getLastTags' function)

if (this.options.tags.indexOf('all') >= 0 && totalPages && +page < totalPages) {
return this._getLastTags(releases, page + 1).then(moreTags => moreTags.concat(filteredTags));
}

the this.options.tags.indexOf('all') >= 0 clause lets you use paging only if the tags parameter is 'all', so in my case where the tags parameter is two specific versions the paging is not working.
I tried to remove this clause and it fixed the problem.

@smira2000
Copy link

I seem to be experiencing this issue as well

$ gren release --tags="7.31.0..stage-7.31.0"

🤖  - Generate release notes:
===================================
✔ Releases found: 29
✔ Tags found:
⠋ Getting all closed IssuesTypeError: Cannot read property '1' of undefined
    at Gren._callee11$ (/usr/local/lib/node_modules/github-release-notes/dist/Gren.js:1189:83)
    at tryCatch (/usr/local/lib/node_modules/github-release-notes/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/github-release-notes/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/github-release-notes/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/usr/local/lib/node_modules/github-release-notes/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/local/lib/node_modules/github-release-notes/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/usr/local/lib/node_modules/github-release-notes/node_modules/core-js/library/modules/_export.js:35:28)
    at Gren.<anonymous> (/usr/local/lib/node_modules/github-release-notes/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
    at Gren._getClosedIssues (/usr/local/lib/node_modules/github-release-notes/dist/Gren.js:1210:31)

@alexcanessa
Copy link
Member

alexcanessa commented Feb 13, 2018

Mmh.. I see @wellDan28 how are you getting on? Are you actually trying to fix this one?

@alexcanessa
Copy link
Member

The paging shouldn't really be a problem, especially when you don't specify --tags=all.

I'll try and investigate a bit too.

@wellDan28
Copy link
Contributor Author

@alexcanessa I'll take a look at this issue today and tomorrow. I'll update you.

@wellDan28
Copy link
Contributor Author

I'm working on a fix.

@wellDan28
Copy link
Contributor Author

hey @alexcanessa I'm working on the tests to improve the coverage before we can merge this PR.
I've got a question about the following test:

it('_getLastTags', done => {
gren.options.ignoreTagsWith = ['11'];
gren.options.tags = ['0.12.0', '0.11.0'];
gren._getLastTags()
.then(tags => {
assert.notInclude(tags.map(({ name }) => name), '0.11.0', 'The ignored tag is not present');
done();
})
.catch(err => done(err));
});

I don't understand why is it possible to enter two tags and ignore one of them on the same time.

As far as I understand, if a user enter 2 tags he wants gren to have all the prs/issues/commit between these tags, and because of it he can't ignore a tag that he have asked for. What do you think?

@alexcanessa
Copy link
Member

@wellDan28 I know it's a bit of a paradox but if you think logic-wise it makes sense: ignoreTagsWith filters out tags that contain the specified string.

Are you saying that specifying exactly two tags should trump ignoreTagsWith?

@wellDan28
Copy link
Contributor Author

I find it's strange, IMO the only case for using ignoreTagsWith should be when --tags='all'.
I think that exception should be thrown in the case that I mention above.

I'l try to explain why this scenario interests me:
In the pr #136 I added a method to validate that in case a user request two tags then these tags are exists after _getLastTags fetched the tags from github.

@alexcanessa
Copy link
Member

I find it's strange, IMO the only case for using ignoreTagsWith should be when --tags='all'.
I think that exception should be thrown in the case that I mention above

Agreed 👍

@wellDan28
Copy link
Contributor Author

Ok, so I'll change the test in #136 and will open a issue for allow use ignoreTagsWith only when --tags='all'

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

Successfully merging a pull request may close this issue.

3 participants