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

Gren fails when used on first release #255

Closed
donmahallem opened this issue Jan 9, 2020 · 9 comments
Closed

Gren fails when used on first release #255

donmahallem opened this issue Jan 9, 2020 · 9 comments
Labels

Comments

@donmahallem
Copy link
Contributor

Hi.

I ran into an issue when using gren for the very first release.
It will crash due to undefined being inside the selectedTags array.

loaded(`Tags found: ${selectedTags.map(({ name }) => name).join(', ')}`);

This is due to releaseDates only containing one item in these lines:
const releaseDates = this._sortReleasesByDate(await Promise.all(this._getTagDates(tags)));
const selectedTags = (this._getSelectedTags(releaseDates) || [releaseDates[0], releaseDates[1]]);

and trying to retrieve two which leads to selectedTags to contain an undefined as second element which will cause an

TypeError: Cannot read property 'name' of undefined

in line 1132 as referenced above.

donmahallem added a commit to donmahallem/github-release-notes that referenced this issue Jan 9, 2020
@alexcanessa alexcanessa added the bug label Jan 9, 2020
@alexcanessa
Copy link
Member

Good catch, thanks

alexcanessa pushed a commit that referenced this issue Jan 9, 2020
* fix issue #255

* added test to _getReleaseBlocks to handle just one tag too
@brettcurtis
Copy link

When can we expect this to be released ? I'm hoping to use this in some of our pipelines and having same issue.

@alexcanessa
Copy link
Member

@brettcurtis the release that includes this should be rolled out on Monday. I'll keep you posted on this issue.

@alexcanessa
Copy link
Member

@brettcurtis release done https://github.com/github-tools/github-release-notes/releases/tag/0.17.2

Please let me know if it's all fixed :)

@brettcurtis
Copy link

brettcurtis commented Apr 27, 2020

Hmm, still failing - it's highly possible I'm doing something wrong:

gren release
Getting gren config from local file /home/brett/repos/my-org/terraform-google-billing-budget/.grenrc.js

🤖  - Generate release notes:
===================================
✔ Releases found: 0
⠸ Getting tagsTypeError: Cannot read property 'name' of undefined
    at /usr/local/lib/node_modules/github-release-notes/dist/Gren.js:1936:55
    at Array.map (<anonymous>)
    at Gren._callee18$ (/usr/local/lib/node_modules/github-release-notes/dist/Gren.js:1935:70)
    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:28:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

I can get it to run when I add the tag:

gren release --tags=1.0
Getting gren config from local file /home/brett/repos/my-org/terraform-google-billing-budget/.grenrc.js

🤖  - Generate release notes:
===================================
✔ Releases found: 0
✔ Tags found: 1.0
✔ Issues found: 1
✔ v1.0 has been successfully created!
See the results here: https://github.com/my-org/terraform-google-billing-budget/releases/tag/1.0```

@donmahallem
Copy link
Contributor Author

I just did a quick test with a new clean repo and 0.17.2.

It does appear that the fix isn't included in this release. If I look into the distributed source it doesn't appear to be there.

grenissue

@alexcanessa
Copy link
Member

🤦 my bad.

Please check 0.17.3

@brettcurtis
Copy link

Looks good thanks!

@donmahallem
Copy link
Contributor Author

I guess the issue can be closed now.

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

No branches or pull requests

3 participants