Skip to content

Explain recovery after cleaning up failed function generation - #8490

Closed
amcaplan wants to merge 2 commits into
mainfrom
fix/function-generation-recovery
Closed

Explain recovery after cleaning up failed function generation#8490
amcaplan wants to merge 2 commits into
mainfrom
fix/function-generation-recovery

Conversation

@amcaplan

@amcaplan amcaplan commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Related to https://github.com/shop/issues-develop/issues/23837.

When function dependency installation or GraphQL type generation fails, developers need to know that the incomplete extension was removed and how to retry. This is particularly relevant when pnpm blocks dependency build scripts.

WHAT is this pull request doing?

Keep recursive cleanup of the entire failed extension directory, including partial node_modules. Report the original setup error with confirmation that the directory was removed and instructions to resolve the error and rerun shopify app generate extension using the same name. For pnpm projects, include conditional guidance for pnpm approve-builds.

Add regression coverage for cleanup and successful regeneration after workspace installation, function runtime installation, and type-generation failures, including npm projects without workspaces. Includes a patch changeset.

The reported leftover node_modules directory has not been reproduced. Existing recursive cleanup passes the simulated failure tests; this PR improves recovery guidance and protects that cleanup behavior with tests.

How to test your changes?

Validated locally:

  • pnpm test packages/app/src/cli/services/generate/extension.test.ts — 29 tests pass.
  • pnpm exec eslint packages/app/src/cli/services/generate/extension.ts packages/app/src/cli/services/generate/extension.test.ts --fix
  • pnpm exec tsc --noEmit from packages/app
  • git diff --check

Tests use real temporary files and simulate dependency/type-generation failures. An actual pnpm build-approval failure has not been reproduced end to end.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing and includes a patch changeset

Assisted-By: devx/d54f9bfe-5e29-4147-aea5-071dbb6add71
@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Sep 7, 2026
Assisted-By: devx/d54f9bfe-5e29-4147-aea5-071dbb6add71
@amcaplan amcaplan changed the title Preserve generated functions when setup fails Explain recovery after cleaning up failed function generation Sep 7, 2026
@amcaplan

amcaplan commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #8491

@amcaplan amcaplan closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant