Repository navigation
chore: 2.2 Add pnpmInstallWithRetries sibling action - W-24093892 #187
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
Open
mshanemc
wants to merge
2
commits into
main
Choose a base branch
from
sm/W-24093892
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: pnpm-install-with-retries | ||
| description: 'wraps `pnpm install --frozen-lockfile` with retries/timeout to handle network failures' | ||
| inputs: | ||
| ignore-scripts: | ||
| default: 'false' | ||
| description: 'Skip pre/post install scripts' | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: pnpm install | ||
| uses: salesforcecli/github-workflows/.github/actions/retry@main | ||
| with: | ||
| command: pnpm install --frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }} |
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
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 |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # W-24093892 — 2.2 Add pnpmInstallWithRetries sibling action | ||
|
|
||
| ## Context | ||
|
|
||
| `setupNodeAndInstall` already installs npm and Yarn through sibling composite actions, and resolves the default pnpm install to `pnpm install --frozen-lockfile`. That pnpm command still runs through the generic `retry` step (`.github/actions/setupNodeAndInstall/action.yml`). | ||
|
|
||
| Add `.github/actions/pnpmInstallWithRetries/action.yml` next to: | ||
|
|
||
| - `.github/actions/npmInstallWithRetries/action.yml` — `npm ci` via `retry`, `ignore-scripts` input | ||
| - `.github/actions/yarnInstallWithRetries/action.yml` — `yarn install --network-timeout 600000` via `retry`, `ignore-scripts` input | ||
|
|
||
| Route the default pnpm command in `setupNodeAndInstall` through the new action. Custom `install-command` values stay on the generic `retry` step. | ||
|
|
||
| ## Phases | ||
|
|
||
| ### 1. Add the pnpm sibling and call it from setupNodeAndInstall | ||
|
|
||
| Commit: `Add pnpmInstallWithRetries for the default frozen-lockfile install` | ||
|
|
||
| Files: | ||
|
|
||
| - `.github/actions/pnpmInstallWithRetries/action.yml` (new) | ||
| - `.github/actions/setupNodeAndInstall/action.yml` | ||
|
|
||
| `pnpmInstallWithRetries` is a composite action: | ||
|
|
||
| - `name`: `pnpm-install-with-retries` | ||
| - `description`: wraps `pnpm install --frozen-lockfile` with retries/timeout to handle network failures | ||
| - input `ignore-scripts`, default `'false'`, same description as the npm and yarn actions | ||
| - one step, `pnpm install`, `uses: salesforcecli/github-workflows/.github/actions/retry@main` | ||
| - `command`: `pnpm install --frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }}` | ||
|
|
||
| In `setupNodeAndInstall`, after the Yarn install step, add: | ||
|
|
||
| - name `Install pnpm dependencies` | ||
| - `if: inputs.package-manager == 'pnpm' && steps.install-command.outputs.value == 'pnpm install --frozen-lockfile'` | ||
| - `uses: salesforcecli/github-workflows/.github/actions/pnpmInstallWithRetries@main` | ||
|
|
||
| Extend the existing custom-install `if` with `(inputs.package-manager != 'pnpm' || steps.install-command.outputs.value != 'pnpm install --frozen-lockfile')` so the default pnpm command is only installed by the sibling. Rename that step from `Install custom or pnpm dependencies` to `Install custom dependencies`. | ||
|
|
||
| `setupNodeAndInstall` does not pass `ignore-scripts` into the npm or yarn actions; the pnpm call matches that. | ||
|
|
||
| ## Skills to apply | ||
|
|
||
| Follow the composite-action shape already in `npmInstallWithRetries` and `yarnInstallWithRetries`: shared `retry` action, `ignore-scripts` input, install command equal to the string `setupNodeAndInstall` already resolves for that package manager (`pnpm install --frozen-lockfile` at the `Resolve install command` step). | ||
|
|
||
| ## Verification | ||
|
|
||
| - New action inputs and `retry` usage match the npm and yarn siblings, with the install command `pnpm install --frozen-lockfile`. | ||
| - `setupNodeAndInstall` default paths are exclusive: `npm` + `npm ci` → `npmInstallWithRetries`; `yarn` + `yarn install --network-timeout 600000` → `yarnInstallWithRetries`; `pnpm` + `pnpm install --frozen-lockfile` → `pnpmInstallWithRetries`; every other resolved command → `retry`. | ||
| - Direct `npmInstallWithRetries` and `yarnInstallWithRetries` workflow uses stay unchanged. | ||
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.