Skip to content

[Workers] Fix Preview URL jq path in Previews examples - #33641

Merged
yomna-shousha merged 2 commits into
cloudflare:productionfrom
jahands:workers-preview-jq-path
Sep 23, 2026
Merged

yomna-shousha merged 2 commits into
cloudflare:productionfrom
jahands:workers-preview-jq-path

Conversation

@jahands

@jahands jahands commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

wrangler preview --json prints JSON.stringify({ preview, deployment }) to stdout (packages/deploy-helpers/src/preview/preview.ts#L1114-L1117, unchanged since cloudflare/workers-sdk#12983). PreviewResource has urls?: string[] (api.ts#L68-L72), so the Preview URL is at .preview.urls[0].

A top-level preview_urls key only exists in the WRANGLER_OUTPUT_FILE_PATH NDJSON entry (packages/wrangler/src/preview/preview.ts#L135-L145, cloudflare/workers-sdk#13197), never on stdout. The .preview_urls[0] branch in the GitHub Actions example (added in #31775) is dead code; the expression only works because jq's // falls through on null.

This PR simplifies the jq filter in the GitHub Actions example to .preview.urls[0].

Documentation checklist

Co-authored-by: Cursor <cursoragent@cursor.com>
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

AI Review

✅ Reviewed d9338a7 · 0 findings · incremental

Commands
  • /review Run a review now.
  • /full-review Review the entire PR diff.
  • /disable-auto-review Stop automatic reviews.
  • /rebase Rebase against production.

```

Use the JSON output to post the Preview URL to your review tool.
The output is a JSON object with `preview` and `deployment` keys. Read the Preview URL from `.preview.urls[0]` and post it to your review tool.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The changes to this line seem needlessly verbose - your'e just duplicating the example above (which agents will already be reading).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From Cursor agent, not jahands:

Reverted this line to the original in d9338a7. The PR now only changes the jq filter in the GitHub Actions example.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yomna-shousha
yomna-shousha enabled auto-merge (squash) September 23, 2026 22:22
@yomna-shousha
yomna-shousha merged commit c73972d into cloudflare:production Sep 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants