Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 7
feat: post validation bot to add a checklist in feat and perf PRs#94
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
642f36493dc3ee02de9fb277a0956697ad6247c1c0b05aa135f7e738b61dc229404b2c8070cd520f6bb2df959415ee283adcb253b5fee504File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: Post Merge Validation | ||
| permissions: | ||
| pull-requests: write | ||
| contents: read | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| repo-owner: | ||
| description: The repo owner | ||
| required: true | ||
| type: string | ||
| repo-name: | ||
| description: The repo name | ||
| required: true | ||
| type: string | ||
| pr-number: | ||
| description: The number of the merged PR | ||
| required: true | ||
| type: string | ||
| pr-author: | ||
| description: The PR author username | ||
| required: true | ||
| type: string | ||
| pr-title: | ||
| description: The PR title | ||
| required: true | ||
| type: string | ||
| jobs: | ||
| post-merge-validation: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Post Feature Validation Checklist | ||
| uses: actions/github-script@v7 | ||
| env: | ||
| OWNER_NAME: ${{ inputs.repo-owner }} | ||
| REPO_NAME: ${{ inputs.repo-name }} | ||
| PR_NUMBER: ${{ inputs.pr-number }} | ||
| PR_AUTHOR: ${{ inputs.pr-author }} | ||
| PR_TITLE: ${{ inputs.pr-title }} | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const { | ||
| OWNER_NAME: owner, | ||
| REPO_NAME: repo, | ||
| PR_NUMBER: prNumStr, | ||
| PR_AUTHOR: author, | ||
| PR_TITLE: title, | ||
| } = process.env; | ||
| const pull_number = parseInt(prNumStr, 10); | ||
| // Check if PR title starts with "feat" or "perf" (conventional commits) | ||
| const titleLower = title.toLowerCase(); | ||
| if (!titleLower.startsWith('feat:') && !titleLower.startsWith('feat(') && | ||
| !titleLower.startsWith('perf:') && !titleLower.startsWith('perf(')) { | ||
| console.log(`❌ PR #${pull_number} title doesn't start with feat or perf - skipping.`); | ||
| return; | ||
| } | ||
| const body = `Hi @${author}, | ||
| on the day following \`feat\` or \`perf\` PR merge, PM and author to test changes on main (feature + exploratory around the edges) using the latest [nightly build](https://consensys.slack.com/archives/C093JQSEPJL) with [casual user persona](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085221547/Mobile+User+Persona+Definition) and also a [power user persona](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085221547/Mobile+User+Persona+Definition) where performance might be a challenge. Please record the testing in a video, check the relevant post-merge checklist box below, and post the video in a comment at the bottom of this PR. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| ### Author validation checklist | ||
| - [ ] Validated the changes in main branch using the nightly build | ||
| - [ ] Video shared | ||
| ### PM validation checklist | ||
| - [ ] Validated the changes in main branch using the nightly build | ||
| - [ ] Video shared | ||
| <!-- AUTO-VALIDATION-CHECKLIST PR:${pull_number} -->`; | ||
| // Post the comment | ||
| try { | ||
| await github.rest.issues.createComment({ | ||
| owner, | ||
| repo, | ||
| issue_number: pull_number, | ||
| body | ||
| }); | ||
| console.log(`✅ Validation checklist posted on PR #${pull_number}`); | ||
| } catch (error) { | ||
| console.log(`⚠️ Could not post comment: ${error.message}`); | ||
| } | ||
| // Add the needs-validation label | ||
| try { | ||
| await github.rest.issues.addLabels({ | ||
| owner, | ||
| repo, | ||
| issue_number: pull_number, | ||
| labels: ['needs-validation'] | ||
| }); | ||
| console.log(`✅ Added 'needs-validation' label to PR #${pull_number}`); | ||
| } catch (error) { | ||
| console.log(`⚠️ Could not add label: ${error.message}`); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: PR Title Validation Inconsistently Skips Valid PRs
The post-merge validation workflow's PR title check is inconsistent and misleading. It only checks for
feat(andchore:, missing commonfeat:andchore(conventional commit formats, whileperfchecks for both. This causes valid PRs to be incorrectly skipped. Additionally, the log message inaccurately states that only 'feat' or 'perf' prefixes are checked, aschore:is also allowed.