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

Automatically crediting the author/contributor of the PR in the release notes #89

Open
ghuntley opened this issue Nov 3, 2016 · 11 comments · May be fixed by #541
Open

Automatically crediting the author/contributor of the PR in the release notes #89

ghuntley opened this issue Nov 3, 2016 · 11 comments · May be fixed by #541
Assignees
Labels
Milestone

Comments

@ghuntley
Copy link

ghuntley commented Nov 3, 2016

Let's discuss a potential feature/addition to GitReleaseManager!

image

Why? People like seeing their name up in lights, it a small gesture and a great way to encourage contributions. This functionality exists in GitReleaseNotes.

@gep13
Copy link
Member

gep13 commented Nov 4, 2016

@ghuntley yes, I like this idea. If you have a look at this blog post:

http://cakebuild.net/blog/2016/09/cake-v0-16-0-released

I have some working code to generate the list of contributors that you can see there. Adding that to an item in the release notes is "harder". An issue might have been created by one person, and fixed by another via a pull request. Stitching the two together is where it becomes hard. Not impossible, just not sure how much effort it will take.

The list of contributors is very simple to generate.

@ghuntley
Copy link
Author

ghuntley commented Nov 4, 2016

List of contributors, with a hyperlink to commits by author would suffice imho.

@gep13
Copy link
Member

gep13 commented Nov 4, 2016

@ghuntley yes, that sounds doable 😄

@ghuntley
Copy link
Author

Some other ideas which are kinda glamourous :)

https://twitter.com/RobertWPearce/status/910978463586074625

screenshot_20170922-081612

Why have a hyperlink when you can put someone's avatar in the release notes?

@gep13 gep13 added this to the 0.11.0 milestone Jan 6, 2020
@gep13 gep13 added the Feature label Jan 6, 2020
@gep13 gep13 modified the milestones: 0.11.0, 0.12.0 Mar 16, 2020
@gep13 gep13 modified the milestones: 0.12.0, Future Mar 22, 2021
@Jericho
Copy link
Contributor

Jericho commented Nov 3, 2023

Two things to keep in mind:

  • milestone can contain issues as well as PRs
  • Issues may or may not be linked to a PR and, similarly, PRs may or may not be linked to an issue

In my opinion, the ultimate solution for this feature would be something like this:

  1. Properly attribute each issue/PR and also display info about the linked issue/PR if possible. Like so:

    1. When issue is not linked to a PR: [#xxx](<issue URL>) <title of the issue> raised by [<author or the issue>](<issue author's GitHub profile URL>)
    2. When issue is linked to a PR: [#xxxx](<issue URL>) <title of the issue> raised by [<author or the issue>](<issue author's GitHub profile URL>) resolved in [#zzz](<PR URL>) by [<author or the PR>](<PR author's GitHub profile URL>)
    3. When PR is not linked to an issue: [#xxx](<PR URL>) <title of the PR> by [<author or the PR>](<PR author's GitHub profile URL>)
    4. When PR is linked to an issue: [#xxxx](<PR URL>) <title of the PR> by [<author or the PR>](<PR author's GitHub profile URL>) raised in [#zzz](<issue URL>) by [<author or the issue>](<issue author's GitHub profile URL>)
  2. Contributors summary
    Display a summary of all the users who contributed to the release. Something similar to this:
    image
    This screenshot was taken from the Octokit.net release notes here

I'm currently working on a proof of concept. If I'm successful I'll be happy to contribute a PR to implement this new feature.

@gep13
Copy link
Member

gep13 commented Nov 3, 2023

This would be a great addition!

@Jericho
Copy link
Contributor

Jericho commented Nov 4, 2023

Determining if an issue is linked to a PR (and vice-versa) is turning out to be much more difficult than I anticipated because the Github API does not return this info when an issue is retrieved. I did a lot of research and I found people offering two possible solutions:

  1. retrieve the events in the issue "timeline", attempt to figure out which even corresponds to "issue was linked to PR", and finally try to figure which issue/PR is being referenced
  2. parse the HTML from Github's web site for this particular issue and search an element with a specific CSS class name. If this element contains an anchor, the "href" property of this anchor will reveal the unique identifier of the issue/PR in question

The first option would be my preferred solution but, as I explained in this comment, I hit a dead end.

The second option (presented here) is very brittle since it relies on the presence of a HTML node with a specific CSS class. This can change at any moment if Github decides to make changes to their UI.

@Jericho
Copy link
Contributor

Jericho commented Nov 4, 2023

Maybe there's a third possible solution: use a GraphQL query to retrieve the desired data. I haven't explored Github GraphQL API, so this will be a learning experience for me. I'll spend some time researching/learning and report my findings.

@Jericho
Copy link
Contributor

Jericho commented Nov 5, 2023

Status update
I am able to figure out the linked issue/PR using a GraphQL query and I can generate release notes like this:
image

In the above example, the two highlighted issues have a linked PR. This works great in most cases!

However I discovered that in some case, for a reason I can't explain, the Github GraphQL API returns an empty array of events when fetching the timeline for a given issue which, obviously, prevents my logic from determining the given issue has a linked PR.

@Jericho
Copy link
Contributor

Jericho commented Nov 5, 2023

Status update
I am also able to generate a summary of people who made a contribution towards the release (meaning they either raised an issue or submitted a PR):
image

@Jericho
Copy link
Contributor

Jericho commented Nov 13, 2023

I didn't realize until yesterday that a single PR could be linked to more than one issue like in this example:
image

This also applies to issues: they can be linked to more than one PR.

I need to update my PR to account for this possibility.

Also, GitReleaseManager was recently updated to support GitLab in addition to GitHub. I need to modify my PR to also support GitLab.

@gep13 gep13 modified the milestones: Future, 0.17.0 Feb 12, 2024
@gep13 gep13 modified the milestones: 0.17.0, Future Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants