Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

ci: wrap yarn into a retrying loop#39454

Merged
jhchabran merged 4 commits into
mainfrom
main-dry-run/devx/ductape-yarn
Jul 27, 2022
Merged

ci: wrap yarn into a retrying loop#39454
jhchabran merged 4 commits into
mainfrom
main-dry-run/devx/ductape-yarn

Conversation

@jhchabran

@jhchabran jhchabran commented Jul 26, 2022

Copy link
Copy Markdown
Contributor

Behold, duct tape to the rescue.

This wraps yarn install commands within a loop that check for the presence of "unexpected errors ..." that are announcing that some network / 500 error / whatever happened when requesting stuff on the registry.

If such an error is found, the script will run yarn again. If we did not find such an error, the script will simply exit, like it would do without the loop.

If we go over $MAX_TIMEOUT_IN_SECONDS the script will simply abort.

@sourcegraph/frontend-platform I know that a possible fix is coming in a few weeks, but this could at least stop the bleeding until then.

Test plan

main-dry-run

To test this locally, I botched the registry url in yarn.lock to reproduce the kind of errors we've been seeing in CI. Remember to wipe your ./node_modules folder before doing so, otherwise it won't be taken in account.

@cla-bot cla-bot Bot added the cla-signed label Jul 26, 2022
@jhchabran jhchabran requested review from a team July 26, 2022 17:45
@jhchabran jhchabran marked this pull request as ready for review July 26, 2022 17:46
@sourcegraph-bot

sourcegraph-bot commented Jul 26, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 1da629b...125bea1.

Notify File(s)
@bobheadxi enterprise/dev/ci/internal/ci/operations.go
monitoring/definitions/postgres.go
@courier-new client/web/src/enterprise/batches/batch-spec/BatchSpecContext.tsx
client/web/src/enterprise/batches/batch-spec/edit/workspaces-preview/useWorkspacesPreview.ts
client/web/src/enterprise/batches/create/ConfigurationForm.tsx
client/web/src/enterprise/batches/create/backend.ts
cmd/frontend/graphqlbackend/batches.go
@efritz client/web/src/enterprise/codeintel/configuration/components/IndexingPolicyDescription.tsx
client/web/src/enterprise/codeintel/configuration/pages/CodeIntelConfigurationPage.module.scss
client/web/src/enterprise/codeintel/configuration/pages/CodeIntelConfigurationPage.tsx
doc/code_intelligence/explanations/rockskip.md
doc/code_intelligence/img/github-file.png
doc/code_intelligence/img/github-pr.png
doc/code_intelligence/img/hover-tooltip.png
enterprise/cmd/worker/internal/batches/workers/reconciler_worker_test.go
internal/database/migration/stitch/git.go
internal/database/migration/stitch/reader.go
internal/database/migration/stitch/rewriter.go
internal/database/migration/stitch/stitch.go
internal/database/migration/stitch/stitch_test.go
internal/oobmigration/upgrade.go
internal/oobmigration/upgrade_test.go
internal/oobmigration/version.go
@eseliger client/web/src/enterprise/batches/batch-spec/BatchSpecContext.tsx
client/web/src/enterprise/batches/batch-spec/edit/workspaces-preview/useWorkspacesPreview.ts
client/web/src/enterprise/batches/create/ConfigurationForm.tsx
client/web/src/enterprise/batches/create/backend.ts
cmd/frontend/graphqlbackend/batches.go
enterprise/cmd/worker/internal/batches/workers/reconciler_worker_test.go
enterprise/internal/batches/processor/bulk_processor_test.go
enterprise/internal/batches/reconciler/executor_test.go
enterprise/internal/batches/reconciler/reconciler_test.go
enterprise/internal/batches/service/service.go
enterprise/internal/batches/service/service_apply_batch_change_test.go
enterprise/internal/batches/service/service_test.go
enterprise/internal/batches/store/batch_specs.go
enterprise/internal/batches/store/batch_specs_test.go
enterprise/internal/batches/store/changeset_specs_test.go
enterprise/internal/batches/store/changesets_test.go
enterprise/internal/batches/testing/batch_spec.go
enterprise/internal/batches/types/batch_spec.go
internal/src-cli/consts.go
@keegancsmith internal/trace/context.go
@slimsag monitoring/definitions/postgres.go
@sourcegraph/code-insights-backend enterprise/internal/insights/query/querybuilder/builder.go
enterprise/internal/insights/query/querybuilder/builder_test.go
@sourcegraph/delivery doc/admin/deploy_executors.md
doc/admin/observability/dashboards.md
monitoring/definitions/postgres.go
@sourcegraph/dev-experience internal/trace/context.go
@unknwon enterprise/cmd/frontend/internal/auth/httpheader/middleware.go
enterprise/cmd/frontend/internal/auth/httpheader/testproxy.go

@sourcegraph-bot

sourcegraph-bot commented Jul 26, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in OWNERS files for diff 1da629b...125bea1.

Notify File(s)
@mrnugget dev/sg/internal/analytics/context.go
dev/sg/sg_migration.go
@sourcegraph/dev-experience dev/sg/internal/analytics/context.go
dev/sg/sg_migration.go
enterprise/dev/ci/internal/ci/operations.go

Comment thread dev/ci/yarn-test-separate.sh Outdated
Comment thread dev/licenses.sh Outdated
@jhchabran jhchabran enabled auto-merge (squash) July 26, 2022 18:31
@jhchabran jhchabran force-pushed the main-dry-run/devx/ductape-yarn branch from cd395ff to 125bea1 Compare July 27, 2022 08:12
@jhchabran jhchabran merged commit 09ee1f3 into main Jul 27, 2022
@jhchabran jhchabran deleted the main-dry-run/devx/ductape-yarn branch July 27, 2022 08:33
LawnGnome added a commit that referenced this pull request Jul 27, 2022
This fixes the `sourcegraph-async` breakage introduced in #39454: most
invocations of `yarn` that were replaced by `yarn-install-with-retry.sh`
did not disable lifecycle scripts, but the new unified
`yarn-install-with-retry.sh` script did globally. This moves the
`--ignore-scripts` flag back into the only script that actually used it,
which is `yarn-deduplicate.sh`.
LawnGnome added a commit that referenced this pull request Jul 27, 2022
This fixes the `sourcegraph-async` breakage introduced in #39454: most
invocations of `yarn` that were replaced by `yarn-install-with-retry.sh`
did not disable lifecycle scripts, but the new unified
`yarn-install-with-retry.sh` script did globally. This moves the
`--ignore-scripts` flag back into the only script that actually used it,
which is `yarn-deduplicate.sh`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants