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

Create release with template and release notes #22622

Merged
merged 6 commits into from
Sep 4, 2024
Merged

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Aug 30, 2024

Fixes: https://mozilla-hub.atlassian.net/browse/AMOENG-616

Description

Adds a workflow to trigger the creation of a draft release. This allows us to have a standardized template for the information in our releases.

Context

Previously we created release documentation manually and updated with commit diffs of tags and info related to a given release. Now that we can release via github releases we should automate creation of release docs in the same way.

Testing

The criteria for the release is:

  • the release hero is set to the current actor. It can be updated post release but typically the release hero will trigger this workflow
  • the tag is based on an input parameter which is validated:
  • date YYYY.MM.DD with or without the -X suffix indicating a cherry-pick release.
  • The tag is validated to not match the tag of an existing release. Cannot release the same tag twice (you can deploy the same tag twice, but that is different)
  • Link to the latest published release is included.

NOTE: Release notes with commits and diffs are only created when we click the "generate notes" button. we should only do that when we actually roll out to stage.

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind force-pushed the release-template branch 15 times, most recently from ec6499f to b0da8e1 Compare August 30, 2024 15:47
@KevinMind
Copy link
Contributor Author

@KevinMind KevinMind requested review from a team and eviljeff and removed request for a team September 2, 2024 07:58
@KevinMind KevinMind marked this pull request as ready for review September 2, 2024 07:58
Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things I'm not clear on:

  • how we're going to handle addons-frontend releases - will we just manually add the diff link in here, or something else?
  • How the generated full changelog can work when there is an existing release note, with potentially important information that can't be overwritten with an entirely freshly generated release notes.

.github/workflows/draft_release.yml Outdated Show resolved Hide resolved
Comment on lines 28 to 33
#Validate the tag is formatted correctly YYYY.MM.DD or YYYY.MM.DD-rcX
# where rcX is a whole number greater than zero
if [[ ! $tag =~ ^[0-9]{4}\.[0-9]{2}\.[0-9]{2}(-rc[0-9]+)?$ ]]; then
echo "Invalid tag format. Must be YYYY.MM.DD or YYYY.MM.DD-rcX"
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the YYYY.MM.DD-rcX for? It's new.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to support cherry pick releases. 2024.09.05-23 for example. Good catch though, I accidentally included rc in the regex.. will remove.

.github/release-template.md Outdated Show resolved Hide resolved
.github/release-template.md Show resolved Hide resolved
@KevinMind
Copy link
Contributor Author

How the generated full changelog can work when there is an existing release note, with potentially important information that can't be overwritten with an entirely freshly generated release notes.

You generate the changelog when publishing the release. It appends the commits after any other content already on the release doc. It won't override anything.

Because releases are essentially immutable, you never change the tag on a release but create a new one, you never should need to update the changelog.

Does that clarify?

@diox
Copy link
Member

diox commented Sep 2, 2024

You generate the changelog when publishing the release. It appends the commits after any other content already on the release doc. It won't override anything.
Because releases are essentially immutable, you never change the tag on a release but create a new one, you never should need to update the changelog.

There are 2 kinds of cherry-picks though:

  1. Before the push to prod happened. In this scenario we tagged and deployed release A to prod 2 weeks ago, then tagged release B, deployed it to stage, but then cherry-picked before deploying B to prod. Let's call that new tag B-1. When B-1 is created, we want the companion doc to contain the diff link between the tag from A to B-1, and all previous info that was in the original doc for B. Original B tag then no longer matters and will never be deployed to prod.
  2. After the push to prod happened. In this scenario we already deployed B to prod, then cherry-picked, creating B-1. The release notes should be an entirely new doc with no previous text and diff link between B and B-1.

@eviljeff
Copy link
Member

eviljeff commented Sep 2, 2024

It appends the commits after any other content already on the release doc. It won't override anything.

👍

@KevinMind
Copy link
Contributor Author

@diox both of your proposed diffs are achievable. I don't think it will be possible to get this granular with the automation, but that is probably okay. If you are making a cherry pick release I think it is up to you to verify your target and compare tags are correct, and you can update or remove the link as you wish.

I have included info like this in the PR updating our push duty docs. Do you think this is sufficient? Or would you suggest removing the link? Or trying to make the automation support more complex linking?

Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ if @diox concurs

@KevinMind KevinMind requested a review from diox September 3, 2024 18:07
.github/workflows/draft_release.yml Outdated Show resolved Hide resolved
@KevinMind KevinMind merged commit d63e7e7 into master Sep 4, 2024
31 checks passed
@KevinMind KevinMind deleted the release-template branch September 4, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants