microsoft / mu_devops

Project Mu Developer Operations
https://microsoft.github.io/mu/
Other
27 stars 25 forks source link

Add N, N-1, and main branch release drafting support [Rebase & FF] #201

Closed makubacki closed 1 year ago

makubacki commented 1 year ago

Resolves #197

Two commits.

Add N, N-1, and main branch release drafting

Updates the ReleaseDrafter.yml workflow to filter the base ref to use when composing the release draft based on the GitHub trigger context. This allows simultaneous release drafting in repos that use release branches while repos with non-release branches (e.g. main branch) are not impacted.

Adds a variable to Version.njk to track the previous Mu release branch name. This files continues to serve as a single location where the release branches are defined.

Updates the file sync process to sync the release drafter config file as needed for the corresponding repo.

.sync/Version.njk: Update Mu repos to Mu DevOps v5.0.0

Changes since last release: https://github.com/microsoft/mu_devops/compare/v4.0.5...v5.0.0

General release info: https://github.com/microsoft/mu_devops/releases

A major release is being made because of a change in the file names of config files passed to the release drafter workflow.

Note: v5.0.0 is used in anticipation of the version created by this change (since it will roll the major version).


How This Supports Ongoing Mu Release Branches

As of this PR, the following branches are N and N-1:

Each of those branches in each repo currently has a synced release-drafter.yml file that sets up a branch push trigger for its branch name. This will cause pushes (PR completions) to that branch to trigger the ReleaseDrafter.yml workflow here in Mu DevOps.

This workflow compares the latest values for latest_mu_release_branch and previous_mu_release_branch in .sync/Version.njk to the triggering branch (github.ref) to determine if there's a match. If there is, either the release-draft-config-n.yml or release-draft-config-n-1.yml is respectively used. This means, if a branch (like release/202208) eventually becomes "N-2", it will simply not match and no longer have release notes/versioning auto drafted.

Those release drafter config files are specially templatized during syncing to specify commitish base refs (the branch name) to filter for drafting the notes. This means a release/202208 submission will filter to release/202208 changes.

Since the file sync is always active for the "current branch" in a repo. This means that over time, each release branch in a repo will have its own relative N and N-1 release drafter config files that stay in the branch. ReleaseDrafter.yml uses the default branch config files so the N and N-1 config files should match the latest and previous values in .sync/Version.njk.

makubacki commented 1 year ago

Note: Sync file results tested on forks. Simultaneous release/202208 and release/202302 drafting testing on my mu_basecore fork.