generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
ci: adapt the post-merge-validation job to track progress in a sheet #98
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
edaed87
ci: add a post merge validation tracker
jvbriones 9dcffad
ci: add a post merge validation tracker
jvbriones 6e39195
ci: add a post merge validation tracker
jvbriones e41c67f
ci: add a post merge validation tracker
jvbriones d005d55
ci: add a post merge validation tracker
jvbriones 038d91f
ci: add a post merge validation tracker
jvbriones 011b6b8
ci: add a post merge validation tracker
jvbriones c3d91fe
ci: add a post merge validation tracker
jvbriones 92da9f0
ci: add a post merge validation tracker
jvbriones b6d50da
ci: adapt the post merge validation job to track progress in a google…
jvbriones 84bb913
ci: adapt the post merge validation job to track progress in a google…
jvbriones cf27931
ci: adapt the post merge validation job to track progress in a google…
jvbriones 4f585f4
ci: adapt the post merge validation job to track progress in a google…
jvbriones 9253949
ci: adapt the post merge validation job to track progress in a google…
jvbriones c32d620
ci: adapt the post merge validation job to track progress in a google…
jvbriones a17cc83
ci: adapt the post merge validation job to track progress in a google…
jvbriones b20cefd
ci: adapt the post merge validation job to track progress in a google…
jvbriones 3306f86
ci: adapt the post merge validation job to track progress in a google…
jvbriones abcef29
ci: adapt the post merge validation job to track progress in a google…
jvbriones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ci: adapt the post merge validation job to track progress in a google…
… sheet
- Loading branch information
commit b6d50dad9c642deac57d09d71bb79c7b501f0c2e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,102 +1,60 @@ | ||
| 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 | ||
| repo: | ||
| description: 'The repo owner/name to process (e.g. MetaMask/metamask-extension)'' | ||
| required: true | ||
| type: string | ||
| pr-title: | ||
| description: The PR title | ||
| start_hour_utc: | ||
| description: 'The hour of the day (UTC) to start processing the PRs merged in main' | ||
| required: true | ||
| type: number | ||
| spreadsheet_id: | ||
| description: 'Google Spreadsheet ID to update' | ||
| required: false | ||
| type: string | ||
| default: '1uSERA-Mczy0pjlrr1vvYG0FZwU65B7TMiQURJXY4tSs' | ||
| lookback_days: | ||
| description: 'Number of days to look back for PRs' | ||
| required: false | ||
| type: number | ||
| default: 2 | ||
| secrets: | ||
| github-token: | ||
| description: 'GitHub token with repo access' | ||
| required: true | ||
| google-application-creds-base64: | ||
| description: 'Base64 encoded Google service account credentials' | ||
| required: true | ||
|
|
||
| jobs: | ||
| post-merge-validation: | ||
| post-merge-validation-tracker: | ||
| 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}, | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| 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. | ||
|
|
||
| ### 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 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: ./.nvmrc | ||
| cache-dependency-path: ./yarn.lock | ||
| cache: yarn | ||
|
|
||
| <!-- AUTO-VALIDATION-CHECKLIST PR:${pull_number} -->`; | ||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| // 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}`); | ||
| } | ||
| - name: Install dependencies | ||
| run: yarn --immutable | ||
|
|
||
| // 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}`); | ||
| } | ||
| - name: Run post-merge-validation script | ||
| env: | ||
| SHEET_ID: ${{ inputs.spreadsheet_id }} | ||
| START_HOUR_UTC: ${{ inputs.start_hour_utc }} | ||
| LOOKBACK_DAYS: ${{ inputs.lookback_days }} | ||
| REPO: ${{ inputs.repo }} | ||
| GITHUB_TOKEN: ${{ secrets.github-token }} | ||
| GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.google-application-creds-base64 }} | ||
| run: node .github/scripts/post-merge-validation-tracker.mjs |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.