Skip to content

Fix app env pull absolute env-file paths#7705

Merged
isaacroldan merged 1 commit into
mainfrom
06-03-fix_app_env_pull_absolute_env-file_paths
Jun 3, 2026
Merged

Fix app env pull absolute env-file paths#7705
isaacroldan merged 1 commit into
mainfrom
06-03-fix_app_env_pull_absolute_env-file_paths

Conversation

@isaacroldan
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan commented Jun 3, 2026

WHY are these changes introduced?

Fixes https://github.com/shop/issues/issues/47828

app env pull --env-file doubled absolute paths because it joined the supplied file path onto the app directory, causing ENOENT errors on Windows-style paths.

WHAT is this pull request doing?

Uses resolvePath for the env file path so absolute paths are preserved and relative paths still resolve from the app directory. Adds command-level regression coverage and a patch changeset.

How to test your changes?

  • pnpm vitest run packages/app/src/cli/commands/app/env/pull.test.ts packages/app/src/cli/services/app/env/pull.test.ts
  • git diff --check

pnpm nx type-check app was attempted, but failed before app type-check in the dependent organizations:build task due unresolved @shopify/cli-kit / @graphql-typed-document-node/core imports.

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 — patch changeset added

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Jun 3, 2026
@isaacroldan isaacroldan marked this pull request as ready for review June 3, 2026 10:22
@isaacroldan isaacroldan requested review from a team as code owners June 3, 2026 10:22
Copilot AI review requested due to automatic review settings June 3, 2026 10:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a path-handling bug in the app env pull --env-file command where absolute env-file paths were incorrectly “doubled” by being joined onto the app directory, causing ENOENT (notably for Windows drive-letter paths). It updates the command to resolve the env-file path correctly and adds regression coverage plus a patch changeset.

Changes:

  • Switch --env-file path handling from joinPath to resolvePath so absolute paths are preserved and relative paths resolve from the app directory.
  • Add command-level tests covering both absolute and relative --env-file inputs.
  • Add a patch changeset for @shopify/app.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/app/src/cli/commands/app/env/pull.ts Uses resolvePath to correctly compute envFile without breaking absolute paths.
packages/app/src/cli/commands/app/env/pull.test.ts Adds regression tests ensuring absolute paths are passed through and relative paths resolve from app.directory.
.changeset/fix-app-env-pull-absolute-path.md Patch changeset documenting the user-facing fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@isaacroldan isaacroldan added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit c01fea6 Jun 3, 2026
30 checks passed
@isaacroldan isaacroldan deleted the 06-03-fix_app_env_pull_absolute_env-file_paths branch June 3, 2026 10:37
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.

3 participants