Skip to content

Add automated QA flow: packages/qa runner + qa-flow workflow - #8215

Draft
alfonso-noriega wants to merge 2 commits into
mainfrom
qa-doc-runner
Draft

Add automated QA flow: packages/qa runner + qa-flow workflow#8215
alfonso-noriega wants to merge 2 commits into
mainfrom
qa-doc-runner

Conversation

@alfonso-noriega

Copy link
Copy Markdown
Contributor

What

Automates the human-free steps of the CLI Pre-release QA flow doc as a CI job, so release QA gardeners only run the checks that genuinely need a human.

Two pieces:

  • packages/qa — a standalone runner (no Playwright, no test framework) that drives the CLI directly: non-interactive commands via execa, interactive ones (app config link, hydrogen init/dev) via node-pty with the same keypresses the doc describes (Enter through defaults, CTRL+C). Every checklist item of the doc is represented in order and reported — automated (auto), needing a human (manual, includes the whole app dev block by team decision), or owned by the themes team (delegated). Nothing is silently dropped.
  • .github/workflows/qa-flow.yml — non-blocking job on PRs / merge queue testing the CLI built from the branch, plus workflow_dispatch testing a published version (default nightly). Publishes a summary that mirrors the doc structure into the run summary, ending with the "Remaining manual checklist" for gardeners. macOS first; ubuntu/windows are follow-up matrix flips.

What gets automated

Local run (macOS, repo build): 16 passed · 0 failed in ~2m40s.

Section Automated Manual (reported, not run)
Preparation shopify version matches expected make nightly release, review changes
General Lockdown toggle (n/a on runners)
Apps app init (reactRouter), 5× generate extension (admin_action, theme_app_extension, discount+ts, flow_action, admin_block), function build, function run (doc's JSON via stdin), deploy --version v1, versions list, config link → create new app (pty), second deploy --config staging entire shopify app dev block (dev console, admin action, GraphiQL, theme extension, q/dev clean)
Theme — (delegated to themes team per the doc)
Hydrogen hydrogen init (pty, default answers ⇒ Mock.shop), build, dev + storefront HTTP probe + CTRL+C visual storefront confirmation

Notable traps the runner handles (all found empirically)

  • pnpm strips the exec bit from node-pty's spawn-helper (posix_spawnp failed) — chmod'ed at startup
  • pnpm sets INIT_CWD, and cli-kit's cwd() prefers it over the real cwd — scrubbed and re-pointed per invocation
  • CI=1 makes pnpm default to frozen-lockfile, breaking generate extension installs — the runner appends frozen-lockfile=false to the app .npmrc (same fix as packages/e2e)
  • MiniOxygen may bind IPv6 ::1 only — the probe tries both families; hydrogen dev is pinned to a free --port
  • dev servers leave workerd/vite orphans holding ports — pty kill now kills the process group
  • NPM_CONFIG_NODE_VERSION from exotic environments poisons pnpm engine checks — scrubbed

CI setup needed before enabling

Two new repo secrets (Genghis e2e org, mirroring the E2E_* pattern):

  • QA_ORG_ID — org for the throwaway qa-ci-* apps
  • QA_APP_AUTOMATION_TOKEN — exported as SHOPIFY_APP_AUTOMATION_TOKEN for headless auth

⚠️ Validation status: everything above is verified locally against a real org with a browser-session auth. The automation-token path is not yet validated (no token available locally) — first CI run will tell. The runner is fail-fast: unexpected prompts time out and dump the captured output into the report.

Running locally

pnpm nx run-many --all --target=build
cd packages/qa && pnpm install
QA_ORG_ID=<org-id> pnpm qa           # full flow (needs `shopify auth login` session)
QA_ONLY=hydrogen pnpm qa             # no-auth subset

Follow-ups (not in this PR)

  • Enable ubuntu-latest, then windows-latest in the matrix once macOS is stable
  • Scheduled cleanup of qa-ci-* apps in the e2e org (runner names them predictably)
  • Consider label-gating the PR job if macOS minutes become a concern

Automates the QA doc steps that need no human interaction by driving the
CLI directly: execa for non-interactive commands, node-pty for interactive
ones (app dev, app config link, hydrogen init). Emits a summary that mirrors
the QA doc structure, with manual/delegated items reported as skipped.

Verified locally so far: Preparation (version), Hydrogen init + build
(hydrogen dev blocked locally by Santa denying workerd; fine on CI runners).

Assisted-By: devx/2410058d-4b68-49a7-ba23-7233a4497d19
- app dev block reclassified as manual (interactive session, team decision):
  no store/password needed by the runner at all
- config link driven like the e2e helper: --config + --organization-id skip
  prompts; create-new-app + app name answered over the pty
- exec runs with CI=1 (fail fast on unexpected prompts) and app init writes
  frozen-lockfile=false, matching GitHub Actions behavior
- pty kill() now kills the process group (workerd/vite orphans kept ports)
- hydrogen dev pinned to a free port; storefront probe tries IPv4 and IPv6
- qa-flow.yml: non-blocking PR/merge_group job (repo build) + dispatch
  (published version, default nightly), macOS first

Assisted-By: devx/2410058d-4b68-49a7-ba23-7233a4497d19
@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 Jul 30, 2026
Comment thread packages/qa/src/report.ts
}

function escapeCell(text: string): string {
return text.replace(/\|/g, '\\|').replace(/\n/g, ' ')
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.

2 participants