Skip to content

Parallelize E2E store cleanup and add --force mode - #8311

Draft
isaacroldan wants to merge 3 commits into
mainfrom
isaac/parallelize-cleanup-stores
Draft

Parallelize E2E store cleanup and add --force mode#8311
isaacroldan wants to merge 3 commits into
mainfrom
isaac/parallelize-cleanup-stores

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Follow-up to #8292, which parallelized the E2E app cleanup script. The store cleanup script still processed stores serially, one admin page visit at a time, and its API discovery silently capped at one page of results.

WHAT is this pull request doing?

  • Applies the same worker-pool pattern from Parallelize E2E app cleanup with worker pool #8292 to cleanup-stores.ts: 5 workers, each with its own page from the shared browser context, pulling stores from a shared queue. Outcomes (succeeded/skipped/failed) are aggregated after the pool drains.
  • Prefixes every log line with [worker N] [i/total] store-name since output now interleaves, including the per-app uninstall logs.
  • Adds a --force mode that requests deletion for every matching store directly through the Business Platform deleteAppDevelopmentStore mutation — no per-store admin visit, no app check, no CLI subprocess, and none of the CLI's 5-minute deletion-confirmation polling. Deletions are requested and left to complete asynchronously. Since force mode is pure API calls, it runs 20 workers instead of 5.
  • Paginates API store discovery. The shared ListAppDevStores query fetches a single page of the server's default size and the script previously just warned when more pages existed. Discovery now uses a script-local paginated query (first: 100, cursor loop, 50-page safety cap) so a single run finds every matching store.
  • --list mode stays serial, matching the scope of Parallelize E2E app cleanup with worker pool #8292.

The full and delete modes keep using the CLI for deletion (per #8290). Force mode is a janitorial fast path: note that force-deleting a store that still has apps installed leaves those apps undeletable in the Dev Dashboard until their install records clear.

Concurrent CLI store deletions are already exercised by the E2E suite itself, where parallel Playwright workers create and delete stores through the CLI.

How to test your changes?

pnpm --filter e2e exec tsx scripts/cleanup-stores.ts --list
pnpm --filter e2e exec tsx scripts/cleanup-stores.ts          # full: uninstall + delete, now parallel
pnpm --filter e2e exec tsx scripts/cleanup-stores.ts --force  # API-only delete, no app check

Measuring impact

  • n/a — internal E2E tooling only

🤖 Generated with Claude Code

Mirrors the worker-pool pattern from cleanup-apps (#8292): 5 workers,
each with its own page, pulling stores from a shared queue. Adds a
--force mode that deletes stores without checking installed apps,
which skips the browser entirely for the per-store work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Aug 11, 2026
isaacroldan and others added 2 commits August 11, 2026 16:46
Instead of spawning a CLI process per store (which boots oclif,
re-authenticates, and polls up to 5 minutes for deletion confirmation),
force mode now fires the DeleteAppDevelopmentStore mutation directly
with a single shared token and runs 20 workers instead of 5.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The shared ListAppDevStores query fetches a single page of the server's
default size, so discovery silently capped at one page and only warned.
Use a script-local paginated query (first: 100, cursor loop, 50-page
safety cap) so a single run finds every matching store.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant