Skip to content

[wrangler] Add debug logs for git branch detection in pages deploy#12468

Merged
petebacondarwin merged 1 commit intomainfrom
fix/3073-git-branch-debug-logs
Feb 9, 2026
Merged

[wrangler] Add debug logs for git branch detection in pages deploy#12468
petebacondarwin merged 1 commit intomainfrom
fix/3073-git-branch-debug-logs

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Feb 7, 2026

Fixes #3073.

When running wrangler pages deploy, the command automatically detects git information (branch, commit hash, commit message, dirty state) from the local repository. Previously, when this detection failed, there was no way to troubleshoot the issue.

Now, running with WRANGLER_LOG=debug will output detailed information about:

  • Whether a git repository is detected
  • Each git command being executed and its result
  • The detected values (branch, commit hash, commit message, dirty status)
  • Any errors that occur during detection

Example usage:

WRANGLER_LOG=debug wrangler pages deploy ./dist --project-name=my-project

This also adds debug logging to git detection in:

  • pages deploy (for deployment git metadata)
  • pages deploy (for production branch suggestion during project creation)
  • pages project create (for production branch suggestion)

  • 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: This is an internal debugging feature that users enable via environment variable, documented in the changeset.

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


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 7, 2026

🦋 Changeset detected

Latest commit: 65bc4bc

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
Copy Markdown
Contributor

claude Bot commented Feb 7, 2026

Claude finished @petebacondarwin's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Validate against criteria
  • Post feedback

✅ All changesets look good

The changeset for this PR follows all the guidelines:

  • Version type: Correctly uses patch for adding debug logging (an internal debugging feature)
  • Changelog quality: Clear, descriptive title and comprehensive body explaining the feature, when to use it, and what information it provides
  • Markdown headers: No problematic h1/h2/h3 headers (uses bullet points appropriately)
  • Code example: Includes helpful usage example showing how to enable the debug logs
  • Format: Follows the title + body structure with good detail

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 7, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 65bc4bc

@petebacondarwin petebacondarwin marked this pull request as ready for review February 7, 2026 15:12
@petebacondarwin petebacondarwin requested review from a team as code owners February 7, 2026 15:12
Copy link
Copy Markdown
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

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Feb 7, 2026
When running `wrangler pages deploy`, the command automatically detects
git information (branch, commit hash, commit message, dirty state) from
the local repository. Previously, when this detection failed, there was
no way to troubleshoot the issue.

Now, running with `WRANGLER_LOG=debug` will output detailed information
about:
- Whether a git repository is detected
- Each git command being executed and its result
- The detected values (branch, commit hash, commit message, dirty status)
- Any errors that occur during detection

This also adds debug logging to the git detection in:
- pages deploy (for deployment git metadata)
- pages deploy (for production branch suggestion during project creation)
- pages project create (for production branch suggestion)

Fixes #3073
@petebacondarwin petebacondarwin force-pushed the fix/3073-git-branch-debug-logs branch from 5f466c8 to 65bc4bc Compare February 8, 2026 14:11
@petebacondarwin petebacondarwin merged commit 5d56487 into main Feb 9, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Feb 9, 2026
@petebacondarwin petebacondarwin deleted the fix/3073-git-branch-debug-logs branch February 9, 2026 11:05
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.

🐛 BUG: Please add debug logs for git branch detection in wrangler pages deployment create command

3 participants