Skip to content

Route QStash workflows to the PR deployment URL#4023

Open
pepeladeira wants to merge 1 commit into
mainfrom
workflow-pr-deployment-url
Open

Route QStash workflows to the PR deployment URL#4023
pepeladeira wants to merge 1 commit into
mainfrom
workflow-pr-deployment-url

Conversation

@pepeladeira

@pepeladeira pepeladeira commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Chores
    • Improved preview environment support for workflow triggering to enhance the reliability of preview deployments.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Jun 10, 2026 8:43pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates domain constant resolution and QStash workflow integration to support Vercel preview deployments. The APP_DOMAIN_WITH_NGROK constant now prefers process.env.VERCEL_URL in preview environments, and the QStash workflow trigger is updated to use this enhanced constant for callback URL construction.

Changes

Vercel Preview Domain Support

Layer / File(s) Summary
Domain constant Vercel preview resolution
packages/utils/src/constants/main.ts
APP_DOMAIN_WITH_NGROK now checks for process.env.VERCEL_URL in preview environments and uses it as the preferred domain; otherwise falls back to the previous https://preview.${NEXT_PUBLIC_APP_DOMAIN} logic.
QStash workflow domain constant integration
apps/web/lib/cron/qstash-workflow.ts
QStash workflow trigger endpoint is updated to import and use APP_DOMAIN_WITH_NGROK instead of APP_DOMAIN for constructing the callback URL.

🎯 2 (Simple) | ⏱️ ~8 minutes

🐰 A bunny hops through Vercel's preview lands,
With URLs from environment commands,
QStash workflows now know the right way,
To reach the domain where deployments play! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: routing QStash workflows to use the PR deployment URL instead of the standard app domain.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch workflow-pr-deployment-url

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/utils/src/constants/main.ts`:
- Around line 24-26: APP_HOSTNAMES is out of sync with APP_DOMAIN_WITH_NGROK
which can resolve to `https://${process.env.VERCEL_URL}`; update the allowlist
so it includes both `preview.${process.env.NEXT_PUBLIC_APP_DOMAIN}` and the
hostname derived from `process.env.VERCEL_URL` (and fallback behavior when
VERCEL_URL is unset). Locate APP_DOMAIN_WITH_NGROK and APP_HOSTNAMES in the file
and add the VERCEL-derived hostname to APP_HOSTNAMES (or compute APP_HOSTNAMES
from APP_DOMAIN_WITH_NGROK) so host-dependent checks accept both preview.* and
*.vercel.app hosts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0e403e67-0b47-4998-b7b0-11d74b2854bb

📥 Commits

Reviewing files that changed from the base of the PR and between 094072a and 656a8f1.

📒 Files selected for processing (2)
  • apps/web/lib/cron/qstash-workflow.ts
  • packages/utils/src/constants/main.ts

Comment thread packages/utils/src/constants/main.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant