Skip to content

fix: Throw a descriptive error when autoconfig cannot detect an output directory#12447

Merged
petebacondarwin merged 6 commits intomainfrom
dario/DEVX-2455/no-output-dir-improved-message
Feb 9, 2026
Merged

fix: Throw a descriptive error when autoconfig cannot detect an output directory#12447
petebacondarwin merged 6 commits intomainfrom
dario/DEVX-2455/no-output-dir-improved-message

Conversation

@dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Feb 6, 2026

Fixes https://jira.cfdata.org/browse/DEVX-2455

The changes here move the output dir validation to the details detection phase implemented by getDetailsForAutoConfig() (which now throws an error if no output directory can be detected).

Thanks to this we can provide a more clear (and hopefully actionable) error to the user or wrangler setup/wrangler deploy --x-autoconfig.

For example this is the before and after or wrangler setup being run on an empty directory:
Screenshot 2026-02-06 at 12 38 44


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: UX improvement

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: c25a42d

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

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

@claude
Copy link
Contributor

claude bot commented Feb 6, 2026

Claude finished @dario-piotrowicz's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Check for cute animals
  • Post review results

⚠️ Issues found

The changeset file .changeset/chilly-falcons-end.md has the following issue:

Title format: The title should not include the "fix:" prefix. According to the changeset README, the title should be "A single sentence with an imperative description of the change" without conventional commit prefixes (though the README notes that descriptions "can either use conventional commit prefixes (e.g., 'fix: remove unused option') or start with a capital letter").

However, looking at the examples in the README more carefully, I see that the format is flexible. The current title "fix: Throw a descriptive error when autoconfig cannot detect an output directory" does follow the conventional commit style that is mentioned as acceptable.

Actually, upon re-reading the guidelines, the changeset is acceptable. The README states: "The changeset descriptions can either use conventional commit prefixes (e.g., 'fix: remove unused option') or start with a capital letter and describe the change directly."


All changesets look good

The changeset properly:

  1. Uses patch version type (appropriate for a bug fix/UX improvement)
  2. Has a clear, meaningful description explaining the improvement
  3. Contains no h1/h2/h3 headers
  4. Does not involve analytics changes
  5. Includes helpful context about what commands are affected and what the user will see

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 6, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12447

wrangler

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

commit: c25a42d

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2455/no-output-dir-improved-message branch 2 times, most recently from ba8651c to 8431acd Compare February 7, 2026 23:00
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review February 7, 2026 23:01
@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner February 7, 2026 23:01
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2455/no-output-dir-improved-message branch from 8431acd to 0441239 Compare February 9, 2026 09:23
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Minor typo and a question but otherwise LGTM

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 9, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 8 additional findings in Devin Review.

Open in Devin Review

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-2455/no-output-dir-improved-message branch from 5914381 to ad12466 Compare February 9, 2026 14:57
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 9 additional findings in Devin Review.

Open in Devin Review

@@ -193,17 +261,9 @@ export async function getDetailsForAutoConfig({
);
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Duplicate sendMetricsEvent call for autoconfig_detection_completed in the non-configured success path

When getDetailsForAutoConfig() reaches the success path for a non-configured project (i.e., outputDir is detected and configured is false), the autoconfig_detection_completed metrics event is sent twice with identical payloads.

Root Cause

The new code at lines 241-250 adds a sendMetricsEvent call for the success case, but the original sendMetricsEvent call at lines 252-261 was not removed. This is visible in the git diff: the PR inserted new logic (early returns for configured and !outputDir cases, each with their own metrics call, plus a success metrics call) above the pre-existing sendMetricsEvent block, but forgot to delete the original.

The result is that every successful detection for a non-configured project fires two identical autoconfig_detection_completed events, which will inflate metrics/analytics counts.

Impact: Metrics data for autoconfig detection will be inaccurate — every successful non-configured detection will be double-counted.

(Refers to lines 252-261)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

🎉

@petebacondarwin petebacondarwin merged commit c8dda16 into main Feb 9, 2026
40 of 41 checks passed
@petebacondarwin petebacondarwin deleted the dario/DEVX-2455/no-output-dir-improved-message branch February 9, 2026 17:00
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants