Docs-website: Enhance github releases with full changelog, usernames

Created on 14 May 2021  路  24Comments  路  Source: newrelic/docs-website

Is your feature request related to a problem? Please describe

It'd be nice to have the site changelog include all changes, and credit contributors

Describe the solution you'd like

  • Automatically include all commits in a release (right now https://github.com/newrelic/docs-website/releases seems to only include two commits)
  • Ideally, attribute each commit to its author
  • Ideally, link the commits

Describe why this important to you

We ran into our first situation this week where we needed to refer back to an earlier version of the site due to some taxonomy errors we'd introduced, and a full changelog would make this a little easier. It would also be nice to be able to scan a history of changes to the site, and see who's contributing and when their contributions went live.

All that said, though, this is not a high-priority request.

eng enhancement gatsbysites 3

All 24 comments

@austin-schaefer can you not get this info by clicking into the release number > commits?

Screen Shot 2021-05-18 at 5 18 51 PM

Yep @jpvajda , it's possible with a couple of clicks. So this is more of a quality of life improvement, not a top priority.

I included usernames in here, because I think with the addition of usernames we have a way to better recognize contributors. Right now contribution info is quite buried in releases.

@austin-schaefer i'm not sure how customizable this is, as it's default Github behavior but it seems you can edit the releases so perhaps there is an action we could setup to do this. There is a lot of data in the pulse reports which may help you https://github.com/newrelic/docs-website/pulse as well.

Did you set this up for an example?

Screen Shot 2021-05-18 at 5 29 52 PM

@jpvajda : You're too quick! :D Yeah, just mocked up that one as an example of how it could look

image

@rudouglas this could be another learning task to take on, what do you think?

you betcha @jpvajda i do love to learn 馃挊

Leaving some notes on what I have so far:

I'm enhancing the current workflow to include additional details in each release https://github.com/newrelic/docs-website/edit/develop/.github/workflows/release.yml

Here are the steps:

gh pr list -B main -s merged --search "closed:>2021-02-28" -L 9999 | wc -l | awk '{print $1 - 1}'

This essentially gets the 2nd most recent release so that we only include commits since then

git log release-${{ steps.get-last-tag.outputs.last }}..HEAD --pretty="@%an - %b (%s)" --merges | sed -e 's!Merge pull request !!'

This uses that release variable to pull commits since then, and then tidy up the results into the following format example:

@zuluecho9 - Assorted changes related to pricing (#2365 from newrelic/Add-link-to-'remove-apps'-to-cancel/delete-doc)

There are more complex solutions that require scripting, or other prebuilt actions like this that we could look into in future:

https://github.com/marketplace/actions/release-drafter

@rudouglas can u provide a point estimate for this work? This is super dope. 馃殌

Super nifty @rudouglas , I'd love to see a preview/example as we get closer!

I'm gonna reopen this for now until the next Release, there's not really any way to test this @austin-schaefer so we kinda just need to wait and see 馃

the first run did not work 馃檲
https://github.com/newrelic/docs-website/runs/2643360319?check_suite_focus=true

the workflow stops on Create release but its actually the previous step that fails Get release notes and causes the subsequent step to error out. in Get release notes the error is:

fatal: ambiguous argument 'release-159..HEAD': unknown revision or path not in the working tree.

i think that is due to the actions/checkout step, and its default fetch depth. If we increase the fetch depth, i think this will pass.

Oooh did not realise that, i've set the fetch-depth: '0' as per instructions here

https://github.com/newrelic/docs-website/pull/2417

the workflow still fails, but different error now 馃檲
https://github.com/newrelic/docs-website/pull/2423/checks?check_run_id=2660281252

it looks like we successfully create notes now, so we got past the previous problem. current error is:

 gh release create release-162 -t release-162 -n @Rob Siebens - Noon merge to main on 5/24/2021 (#2423 from newrelic/develop)[ebd394a7a] 
/home/runner/work/_temp/24599c2e-9d32-48ed-a036-adc860fe6043.sh: line 1: syntax error near unexpected token `('

if i had to take a guess, i think the argument for -n needs to be wrapped in quotes, but im not confident about that.

additionally, to try and test this before another merge, we might be able to use either the draft or pre-release options:

  -d, --draft             Save the release as a draft instead of publishing it
  -n, --notes string      Release notes
  -F, --notes-file file   Read release notes from file
  -p, --prerelease        Mark the release as a prerelease
      --target branch     Target branch or full commit SHA (default: main branch)
  -t, --title string      Release title

we can also delete releases, so it might be worth just running through the workflow steps locally, publishing a release, then deleting the release.

so a few options to investigate so that we dont have to wait for a merge to main (even though those are fairly frequent for this repo).

@nr-kkenney you beat me to it. my first inkling was adding quotes around the -n option.

Yass @nr-kkenney @roadlittledawn this was part of the problem, it also looks like there are some issues with variables that are multiline so i had to do a bit of regex to maintain the newlines.

The work is in #2437

At the moment it only shows the Authors full name, i'll have to do further enhancement to pull the username from GitHub and use that so it is @ed properly in the notes.

Action Items left:

  • [x] Remove merge to main commits from list
  • [x] Get GitHub usernames instead of Author names to @ correctly

Just wanted to say @rudouglas that this is awesome and I'm enjoying following along!

Reopening until the next release to confirm it's working correctly

Hey @zstix @rudouglas , for me the last two releases just show a heading and no other content?

image

Hi @austin-schaefer thanks ye noticed that, should be fixed with the latest Push :D

Yaaass this looks like it should now @austin-schaefer 馃コ
https://github.com/newrelic/docs-website/releases/tag/release-178
Screenshot 2021-06-03 at 20 27 07

This is great work @rudouglas! 馃コ

Was this page helpful?
0 / 5 - 0 ratings