Skip to content

Commit

Permalink
refactor: adjust PR Title Check workflow to reduce noise (#12373)
Browse files Browse the repository at this point in the history
* docs: update RELEASE_ISSUE_TEMPLATE.md base on v1.29.0 release execution

This is accumulating improvements based on lessons learned from executing #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 <[email protected]>
  • Loading branch information
BigLep and rjan90 authored Aug 13, 2024
1 parent 0b94fee commit a86129b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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
Expand Down
25 changes: 15 additions & 10 deletions documentation/misc/RELEASE_ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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

Expand All @@ -135,4 +140,4 @@ See the final release notes!

## ⁉️ Do you have questions?

Leave a comment in this ticket!
Leave a comment in this ticket!

0 comments on commit a86129b

Please sign in to comment.