Skip to content

Resolve dockerfile path based on original, non-redirected config path#10005

Merged
emily-shen merged 1 commit intomainfrom
emily/dockerfile-resolution-again
Jul 22, 2025
Merged

Resolve dockerfile path based on original, non-redirected config path#10005
emily-shen merged 1 commit intomainfrom
emily/dockerfile-resolution-again

Conversation

@emily-shen
Copy link
Copy Markdown
Contributor

userConfigPath is the path of the original wrangler config, while configPath could point to a redirected wrangler config. We should resolve the dockerfile and build context based on the original config's path. This makes sure containers can be deployed if the app has been built by the vite plugin.

  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: preemptive bugfix
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: not in v3

@emily-shen emily-shen requested review from a team as code owners July 17, 2025 16:37
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 17, 2025

🦋 Changeset detected

Latest commit: 4d4646b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/containers-shared Patch
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main emily/dockerfile-resolution-again might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-10005
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jul 17, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10005

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10005

miniflare

npm i https://pkg.pr.new/miniflare@10005

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10005

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10005

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10005

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10005

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10005

wrangler

npm i https://pkg.pr.new/wrangler@10005

commit: 4d4646b

@emily-shen emily-shen force-pushed the emily/dockerfile-resolution-again branch from 0d98db5 to db182fd Compare July 18, 2025 14:07
@emily-shen emily-shen force-pushed the emily/dockerfile-resolution-again branch from db182fd to 4d4646b Compare July 18, 2025 14:08
Copy link
Copy Markdown
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks good to me 😄

(just left a couple of very minor comments 🙂)

imageTag: string,
dryRun: boolean,
pathToDocker: string,
/** The original (non-redirected) user config path */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about renaming the parameter userConfigPath to avoid possible future confusion? 🤔

Copy link
Copy Markdown
Contributor Author

@emily-shen emily-shen Jul 22, 2025

Choose a reason for hiding this comment

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

ah that's probably better, but this needs to go out in the next release so i'm just going to kick this one through as is - sorry!

expect(std.warn).toMatchInlineSnapshot(`""`);
});

it("resolve the dockerfile based on the non-redirected userConfigPath rather than the actual config path", async () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
it("resolve the dockerfile based on the non-redirected userConfigPath rather than the actual config path", async () => {
it("resolve the dockerfile based on the non-redirected userConfigPath rather than the redirected config path", async () => {

🤔 ?

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jul 21, 2025
@emily-shen emily-shen merged commit 64d71b1 into main Jul 22, 2025
42 of 46 checks passed
@emily-shen emily-shen deleted the emily/dockerfile-resolution-again branch July 22, 2025 06:37
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jul 22, 2025
emily-shen added a commit that referenced this pull request Jul 22, 2025
emily-shen added a commit that referenced this pull request Jul 22, 2025
pombosilva added a commit that referenced this pull request Jul 24, 2025
…name matches its own Worker name

removing try catch since error gets thrown either way

use userConfigPath instead of redirected one (#10005)

Revert "use userConfigPath instead of redirected one (#10005)"

This reverts commit 5c11fe7504a0b16a963c726cc63748426fd8bab6.

fix deep import

prettier run

fix: make vitest-pool-workers not break if Workflow binding's script_name matches its own Worker name
pombosilva added a commit that referenced this pull request Jul 24, 2025
…hes its own Worker name (#10033)

* fix: make vitest-pool-workers not break if Workflow binding's script_name matches its own Worker name

removing try catch since error gets thrown either way

use userConfigPath instead of redirected one (#10005)

Revert "use userConfigPath instead of redirected one (#10005)"

This reverts commit 5c11fe7504a0b16a963c726cc63748426fd8bab6.

fix deep import

prettier run

fix: make vitest-pool-workers not break if Workflow binding's script_name matches its own Worker name

* apply suggestions from code review

* code review suggestion: delete script_name instead of replacing it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants