Skip to content

Commit 1597b4d

Browse files
release(runway): cherry-pick ci: GitHub Actions time usage optimizations (#36896)
- ci: GitHub Actions time usage optimizations (#36629) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> - [Add `concurrency` field to `update-lavamoat-policies`.](a20025f) - Saves approx. 20 minutes of billable time (=runtime of `update-lavamoat-policies`) for each `@metamaskbot update-policies` comment. - Cancels CI run when the comment is posted, instead of waiting for the `update-lavamoat-policies` workflow to complete. - Excluded release branches, where even an incomplete CI run might provide useful info. - Set `timeout-minutes` for all jobs to 30 (instead of default of 360). - Example of 6-hour run: https://github.com/MetaMask/metamask-extension/actions/runs/18155641151/job/51675026463?pr=33539 > All jobs should set [timeout-minutes](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes). > ... > By default, GitHub Actions kills workflows after 6 hours if they have not finished by then. Many workflows don't need nearly as much time to finish, but sometimes unexpected errors occur or a job hangs until the workflow run is killed 6 hours after starting it. Therefore it's recommended to specify a shorter timeout. > ... > This has the following advantages: > > PRs won't be pending CI for half the day, issues can be caught early or workflow runs can be restarted. The number of overall parallel builds is limited, hanging jobs will not cause issues for other PRs if they are cancelled early. > > -- [`ghalint`](https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/012.md#job_timeout_minutes_is_required) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/36629?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Sets 30-minute timeouts across GitHub Actions jobs and adds concurrency to `update-lavamoat-policies` to cancel superseded runs (excluding `release/*`). > > - **CI/GitHub Actions** > - **Job timeouts**: Add `timeout-minutes: 30` to jobs across workflows (e.g., `main.yml`, tests, builds, e2e, releases, checks) to cap runtime. > - **Concurrency control**: Add `concurrency` to `update-lavamoat-policies.yml` to cancel in-progress runs for the same ref, excluding `release/*` branches. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8169786. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [8453e5e](8453e5e) Co-authored-by: Jongsun Suh <[email protected]>
1 parent 8ae39c5 commit 1597b4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+70
-0
lines changed

.github/workflows/auto-create-release-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
extract:
88
if: ${{ github.ref_type == 'branch' && (startsWith(github.ref, 'refs/heads/Version-v') || startsWith(github.ref, 'refs/heads/release/')) }}
99
runs-on: ubuntu-latest
10+
timeout-minutes: 30
1011
outputs:
1112
semver: ${{ steps.out.outputs.semver }}
1213
steps:

.github/workflows/auto-update-pr-targeting-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
auto-update:
1111
name: Auto-update
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 30
1314
env:
1415
YARN_ENABLE_IMMUTABLE_INSTALLS: false
1516
YARN_ENABLE_HARDENED_MODE: false

.github/workflows/build-storybook.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
build-storybook:
1111
name: Build storybook
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 30
1314
env:
1415
# For a `pull_request` event, the branch is `github.head_ref``.
1516
# For a `push` event, the branch is `github.ref_name`.

.github/workflows/build-ts-migration-dashboard.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
build-ts-migration-dashboard:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 30
1213
env:
1314
# For a `pull_request` event, the branch is `github.head_ref``.
1415
# For a `push` event, the branch is `github.ref_name`.

.github/workflows/check-attributions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
check-attributions:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 30
1213
steps:
1314
- name: Checkout and setup environment
1415
uses: MetaMask/action-checkout-and-setup@v1

.github/workflows/check-pr-labels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ concurrency:
1717
jobs:
1818
check-pr-labels:
1919
runs-on: ubuntu-latest
20+
timeout-minutes: 30
2021
permissions:
2122
pull-requests: read
2223

.github/workflows/check-release-tag.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
# Only run on PRs targeting stable
1818
if: github.base_ref == 'stable'
1919
runs-on: ubuntu-latest
20+
timeout-minutes: 30
2021
permissions:
2122
contents: read
2223
pull-requests: read

.github/workflows/check-template-and-add-labels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
jobs:
1111
check-template-and-add-labels:
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 30
1314
if: ${{ github.event_name != 'merge_group' }} # Skip this step for merge_group events
1415
steps:
1516
- name: Checkout and setup environment

.github/workflows/cla.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
CLABot:
1414
if: github.event_name == 'pull_request_target' || contains(github.event.comment.html_url, '/pull/')
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 30
1617
permissions:
1718
pull-requests: write
1819
contents: write

.github/workflows/close-bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
jobs:
1111
close-bug-report:
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 30
1314
if: github.event.pull_request.merged == true && ( startsWith(github.event.pull_request.head.ref, 'Version-v') || startsWith(github.event.pull_request.head.ref, 'release/') )
1415
steps:
1516
- name: Checkout and setup environment

0 commit comments

Comments
 (0)