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

Missing version numbers in generated changelog #186

Closed
jackocnr opened this issue Sep 28, 2018 · 9 comments · Fixed by #187
Closed

Missing version numbers in generated changelog #186

jackocnr opened this issue Sep 28, 2018 · 9 comments · Fixed by #187

Comments

@jackocnr
Copy link
Contributor

Hey thanks for the great tool!

So all I want to do is generate my changelog.md file from my github release notes. I installed github-release-notes, added my GREN_GITHUB_TOKEN, and ran gren changelog --override as I already have a changelog.md in my project.

Everything worked perfectly (it is correctly adding an entry for each of my github releases, with the correct date, and the correct release notes), except the version numbers are missing. If I generate a config file, and add a "template" section with a "release" string e.g. "release": "## TEST {{release}} ({{date}})\n{{body}}", - I can see it's working (I can see my TEST string, along with the date and body), but {{release}} always evaluates to empty string.

Any ideas? Any more details I can provide? Thanks for the help.

@alexcanessa
Copy link
Member

🤔 Mmh. This is weird.

As I can see the release names are present in your repo, and that's the data that gren's getting.

Looks like, if I request the information for your latest release, the name is actually empty:

https://api.github.com/repos/jackocnr/intl-tel-input/releases/tags/v14.0.0

{
  "url": "https://api.github.com/repos/jackocnr/intl-tel-input/releases/13046325",
  "assets_url": "https://api.github.com/repos/jackocnr/intl-tel-input/releases/13046325/assets",
  "upload_url": "https://uploads.github.com/repos/jackocnr/intl-tel-input/releases/13046325/assets{?name,label}",
  "html_url": "https://github.com/jackocnr/intl-tel-input/releases/tag/v14.0.0",
  "id": 13046325,
  "node_id": "MDc6UmVsZWFzZTEzMDQ2MzI1",
  "tag_name": "v14.0.0",
  "target_commitish": "master",
  "name": "",
  "draft": false,
  "author": {
    "login": "jackocnr",
    "id": 1186883,
    "node_id": "MDQ6VXNlcjExODY4ODM=",
    "avatar_url": "https://avatars0.githubusercontent.com/u/1186883?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/jackocnr",
    "html_url": "https://github.com/jackocnr",
    "followers_url": "https://api.github.com/users/jackocnr/followers",
    "following_url": "https://api.github.com/users/jackocnr/following{/other_user}",
    "gists_url": "https://api.github.com/users/jackocnr/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/jackocnr/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/jackocnr/subscriptions",
    "organizations_url": "https://api.github.com/users/jackocnr/orgs",
    "repos_url": "https://api.github.com/users/jackocnr/repos",
    "events_url": "https://api.github.com/users/jackocnr/events{/privacy}",
    "received_events_url": "https://api.github.com/users/jackocnr/received_events",
    "type": "User",
    "site_admin": false
  },
  "prerelease": false,
  "created_at": "2018-09-23T18:09:17Z",
  "published_at": "2018-09-23T18:15:08Z",
  "assets": [

  ],
  "tarball_url": "https://api.github.com/repos/jackocnr/intl-tel-input/tarball/v14.0.0",
  "zipball_url": "https://api.github.com/repos/jackocnr/intl-tel-input/zipball/v14.0.0",
  "body": "We finally removed the jQuery dependency! This changes how you initialise and use the plugin - see readme for details. All of the tests are currently passing on Chrome/Firefox/Safari/IE11.\r\n\r\n- You can no longer initialise the plugin on multiple inputs at once, but other than that AFAICS it should be feature complete\r\n- Instead of jQuery deferred objects we now use ES6 promises (if available)\r\n- `dropdownContainer` option has changed from taking a jQuery selector string, to a node e.g. `document.body`\r\n\r\nI also simplified the CSS media queries in this release, so let me know if you notice any problems with that."
}

Could you try and edit the release and see if is actually empty?

At this point i think gren could default to tag_name if release.name is missing.

@jackocnr
Copy link
Contributor Author

jackocnr commented Sep 28, 2018

Thanks for the speedy reply :)

A ha! That'll be it - I had assumed it would display the version numbers, but it seems it's displaying the "name" value, which I guess comes from the "Release title" field when you're creating a new release in Github. Yeah so I never fill in that title field - that'll be the problem.

At this point i think gren could default to tag_name if release.name is missing.

Yeah if that isn't too much trouble that would be exactly what I need. Thank you so much!

@jackocnr
Copy link
Contributor Author

jackocnr commented Sep 28, 2018

From a cursory glance, would it just be a case of updating this line in lib/src/Gren.js:

https://github.com/github-tools/github-release-notes/blob/master/lib/src/Gren.js#L451

to something like:

release: release.name || release.tag_name,

Tho I'm not sure if this would affect any other functionality?

@alexcanessa
Copy link
Member

This would be it, you're welcome to contribute 🎉

@alexcanessa
Copy link
Member

Will be in next release this weekend

@jackocnr
Copy link
Contributor Author

jackocnr commented Oct 3, 2018

Hey @alexcanessa, any chance of a release soon?

@jackocnr
Copy link
Contributor Author

Hi @alexcanessa, I still really need this - any idea when it is likely to be released? Thank you :)

@alexcanessa
Copy link
Member

@jackocnr sorry, for personal reasons I wasn't able to release (or work on gren) during the past weeks.

Now I only need to get #190 in before releasing. I'm anticipating a release between today and tomorrow.

@alexcanessa
Copy link
Member

@jackocnr released. github-release-notes@0.17.0 has the fix (and works with node 10 🎉)

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

Successfully merging a pull request may close this issue.

2 participants