From a86129b9354a8ad2726ea815516930525645d686 Mon Sep 17 00:00:00 2001 From: Steve Loeppky Date: Tue, 13 Aug 2024 00:06:19 -0700 Subject: [PATCH] refactor: adjust PR Title Check workflow to reduce noise (#12373) * docs: update RELEASE_ISSUE_TEMPLATE.md base on v1.29.0 release execution This is accumulating improvements based on lessons learned from executing https://github.com/filecoin-project/lotus/issues/12343 * Update RELEASE_ISSUE_TEMPLATE.md * Update RELEASE_ISSUE_TEMPLATE.md * fix(ci): allow periods in PR title scope fix(ci): allow periods in PR title scope * fix: add delay before dismissing PR title check review Allows GitHub to properly register the review, addressing the issue where the review wasn't being dismissed despite the PR title being updated. * fix: PR title check workflow to dismiss review only on title edit PR title check workflow to dismiss review only on title edit --------- Co-authored-by: Phi --- .github/workflows/pr-title-check.yml | 7 ++++-- documentation/misc/RELEASE_ISSUE_TEMPLATE.md | 25 ++++++++++++-------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index 2bd937c889e..84c7cae525f 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -20,7 +20,7 @@ jobs: const title = context.payload.pull_request.title; // This should match https://github.com/filecoin-project/lotus/blob/master/README.md#pr-title-conventions // 202408: Beyond Conventional Commit conventions, we also optionally suport the "scope" outside of paranenthesis for a transitionary period from legacy conventions per https://github.com/filecoin-project/lotus/pull/12340 - const pattern = /^(\[skip changelog\]\s)?(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:?\s(\w+:)?\s?[a-z].+$/; + const pattern = /^(\[skip changelog\]\s)?(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w.]+\))?!?:?\s(\w+:)?\s?[a-z].+$/; if (!pattern.test(title)) { await github.rest.pulls.createReview({ @@ -30,7 +30,10 @@ jobs: event: 'REQUEST_CHANGES' }); core.setFailed('PR title does not match the required format'); - } else { + } else if (context.payload.action === 'edited' && context.payload.changes.title) { + // Only proceed with dismissal if the title was just edited + await new Promise(resolve => setTimeout(resolve, 5000)); // 5 second delay + const reviews = await github.rest.pulls.listReviews({ ...context.repo, pull_number: context.payload.pull_request.number diff --git a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md index 00c5970b104..3a4ec3259a1 100644 --- a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md +++ b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md @@ -3,12 +3,13 @@ # Lotus Node|Miner X.Y.Z Release [//]: # (Below are non-visible steps intended for the issue creator) -[//]: # (Start an issue with title "[WIP] Lotus Node|Miner vX.Y.Z" and adjust the title for whether it's a Node or Miner release.) +[//]: # (Start an issue with title "[WIP] Lotus Node|Miner vX.Y.Z Release" and adjust the title for whether it's a Node or Miner release.) [//]: # (Copy in the content of https://github.com/filecoin-project/lotus/blob/master/documentation/misc/RELEASE_ISSUE_TEMPLATE.md) +[//]: # (Find/Replace "X.Y.Z+1" with the actual values. This is intentinoally done before tbe find/replace X.Y.Z step because that will also match.) [//]: # (Find/Replace "X.Y.Z" with the actual values.) -[//]: # (Copy/paste the "Release Checklist > RCX" section to "Release Checklist > Stable \(non-RC\) Release" and apply the "diff" called out there.) -[//]: # (Find/Replace "RCX" with "RC1".) [//]: # (If this isn't a release tied to a network upgrade, remove all items with "\(network upgrade\)") +[//]: # (Copy/paste the "Release Checklist > RCX" section to "Release Checklist > Stable \(non-RC\) Release" and apply the "diff" called out there.) +[//]: # (Find/Replace case sensitive "RCX" with "RC1".) [//]: # (Adjust the "Meta" section values.) [//]: # (Apply the `tpm` label to the issue) [//]: # (Create the issue) @@ -17,7 +18,7 @@ ## πŸ˜Άβ€πŸŒ« Meta * Scope: Node|Miner * Is this linked with a network upgrade, and thus mandatory? Yes|No -* Related network upgrade version: n/a|nvXX +* Related network upgrade version: nvXX|n/a ## 🚒 Estimated shipping date @@ -52,7 +53,7 @@ - This will get merged in a `Post Release` step, but improvements are better done by collecting notes along the way rather than just thinking about it at the end. - [ ] Fork a new branch (`release/vX.Y.Z` or `release/miner/vX.Y.Z`) from `master` and make any further release-related changes to this branch. - `master` branch Version string updates - - [ ] bump the version(s) in `build/version.go` to `vX.Y.(Z+1)-dev`. + - [ ] bump the version(s) in `build/version.go` to `vX.Y.Z+1-dev`. - Ensure to update the appropriate version string based on whether you are creating a node release (`NodeBuildVersion`), a miner release (`MinerBuildVersion`), or both. - [ ] Run `make gen && make docsgen-cli` before committing changes. - [ ] Create a PR with title `build(vX.Y.Z+1): set initial version string` @@ -112,15 +113,19 @@ [//]: # (These comments ^^^ can be removed once the NOTE steps below are completed.) > [!NOTE] > Copy/paste in the `RCX` section above and then make these changes: -> 1. Change the version string text: +> 1. Under "Release PR > Update the version string...", edit: > > Update the version string in `build/version.go` to one **NOT** ending with '-rcX' > -> 2. Under "Changelog prep", add +> 2. Under "Release PR > Changelog prep...", add: > > (network upgrade) Ensure the Mainnet upgrade epoch is specified. -> -> 3. Remove this `[!Note]` and the related invisible comments. +> +> 3. Under "Release PR > Update the version string...", edit: +> +> Create a PR with title `build(vX.Y.Z): release vX.Y.Z` +> +> 4. Remove this `[!Note]` and the related invisible comments. ### Post-Release @@ -135,4 +140,4 @@ See the final release notes! ## ⁉️ Do you have questions? -Leave a comment in this ticket! \ No newline at end of file +Leave a comment in this ticket!