Skip to content

feat(webapp): show Vercel deployment links in UI#3094

Closed
0ski wants to merge 2 commits intomainfrom
oskar/feat-vercel-deployments-ui-improvements
Closed

feat(webapp): show Vercel deployment links in UI#3094
0ski wants to merge 2 commits intomainfrom
oskar/feat-vercel-deployments-ui-improvements

Conversation

@0ski
Copy link
Collaborator

@0ski 0ski commented Feb 19, 2026

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

Deployments UI page with and w/o Vercel installed


Changelog

Add Vercel integration lookup and expose a deployment URL so linked
Vercel deployments are discoverable from the app.

  • Import VercelProjectIntegrationDataSchema and query for
    organizationProjectIntegration to detect Vercel project data.
  • Parse integrationData and, when a vercelTeamSlug is present,
    look up the latest integrationDeployment for the deployment and
    construct a Vercel URL (vercel.com///).
  • Attach vercelDeploymentUrl to the DeploymentPresenter output.
  • Render the Vercel link in deployment detail and deployments list
    by using the VercelLink component where vercelDeploymentUrl exists.
  • Remove an unused tooltip import and swap VercelLogo usage to the
    VercelLink component in the list view.

This makes it easier for users to jump directly to the corresponding
Vercel deployment from the webapp.


Screenshots

Screenshot 2026-02-19 at 17 32 56 Screenshot 2026-02-19 at 17 33 06

💯


This is part 1 of 2 in a stack made with GitButler:

Add Vercel integration lookup and expose a deployment URL so linked
Vercel deployments are discoverable from the app.

- Import VercelProjectIntegrationDataSchema and query for
  organizationProjectIntegration to detect Vercel project data.
- Parse integrationData and, when a vercelTeamSlug is present,
  look up the latest integrationDeployment for the deployment and
  construct a Vercel URL (vercel.com/<team>/<project>/<id>).
- Attach vercelDeploymentUrl to the DeploymentPresenter output.
- Render the Vercel link in deployment detail and deployments list
  by using the VercelLink component where vercelDeploymentUrl exists.
- Remove an unused tooltip import and swap VercelLogo usage to the
  VercelLink component in the list view.

This makes it easier for users to jump directly to the corresponding
Vercel deployment from the webapp.
@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: b1e2931

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@0ski
Copy link
Collaborator Author

0ski commented Feb 19, 2026

@coderabbitai review

devin-ai-integration[bot]

This comment was marked as resolved.

Introduce buildVercelDeploymentUrl to centralize construction of
Vercel deployment URLs and replace inline URL building in presenters.

- Add buildVercelDeploymentUrl to vercelProjectIntegrationSchema.ts.
  It strips the "dpl_" prefix from integrationDeploymentId and returns
  the canonical Vercel URL.
- Update DeploymentListPresenter and DeploymentPresenter to import
  and use the new helper instead of duplicating string assembly.

This reduces duplicated logic, ensures consistent URL formatting,
and makes future URL-related changes easier to maintain.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Walkthrough

This pull request adds Vercel deployment URL display functionality across the deployment views. It introduces a new VercelLink component for rendering deployment links, a buildVercelDeploymentUrl helper function to construct URLs, and updates the DeploymentPresenter and DeploymentListPresenter to fetch Vercel integration data from the database and include the deployment URL in their responses. The deployment detail and list UI pages are then updated to conditionally render the VercelLink component when a Vercel deployment URL is available.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding Vercel deployment links to the UI. It is concise, specific, and directly reflects the changeset's primary objective.
Description check ✅ Passed The pull request description includes all required sections from the template with complete and well-documented information.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch oskar/feat-vercel-deployments-ui-improvements

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.

@0ski 0ski marked this pull request as ready for review February 19, 2026 17:05
Copy link

@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 3 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts (1)

205-212: Consider adding unit tests for buildVercelDeploymentUrl.

Both the dpl_-prefixed and non-prefixed ID cases should be verified.

Based on learnings: "Consider centralizing this logic in a small helper and add tests to verify both prefixed and non-prefixed inputs." The centralization is done here; the test coverage is still missing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts` around lines 205
- 212, Add unit tests for buildVercelDeploymentUrl that verify it strips a
"dpl_" prefix when present and leaves non-prefixed IDs unchanged: create tests
calling buildVercelDeploymentUrl with (1) integrationDeploymentId = "dpl_abc123"
and asserting the returned URL contains "abc123", and (2)
integrationDeploymentId = "abc123" and asserting the returned URL contains
"abc123"; include a vercelTeamSlug and vercelProjectName in both tests and
assert the full URL matches the expected string to ensure the function behaves
for both prefixed and non-prefixed inputs.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38981f5 and b1e2931.

📒 Files selected for processing (6)
  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Always import tasks from @trigger.dev/sdk, never use @trigger.dev/sdk/v3 or deprecated client.defineJob pattern
Every Trigger.dev task must be exported and have a unique id property with no timeouts in the run function

Files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Import from @trigger.dev/core using subpaths only, never import from root

Files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
apps/webapp/app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

Access all environment variables through the env export of env.server.ts instead of directly accessing process.env in the Trigger.dev webapp

Files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, use subpath exports from the package.json instead of importing from the root path
Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Access environment variables via env export from apps/webapp/app/env.server.ts, never use process.env directly

Files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier before committing

Files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
🧠 Learnings (14)
📓 Common learnings
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/presenters/v3/BranchesPresenter.server.ts:45-45
Timestamp: 2026-02-03T18:27:05.229Z
Learning: In the Vercel integration feature, the GitHub app is responsible for builds and provides git metadata (using source: "trigger_github_app"). The Vercel integration is only for linking deployments between platforms, not for triggering builds or providing git metadata.
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts:233-237
Timestamp: 2026-02-06T19:53:46.849Z
Learning: Vercel dashboard URLs for deployments use the format `https://vercel.com/${teamSlug}/${projectName}/${deploymentId}` where the deploymentId should NOT include the `dpl_` prefix. When constructing Vercel dashboard links from API deployment IDs (which include the `dpl_` prefix), the prefix must be stripped using `.replace(/^dpl_/, "")`.
📚 Learning: 2026-02-03T18:27:05.229Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/presenters/v3/BranchesPresenter.server.ts:45-45
Timestamp: 2026-02-03T18:27:05.229Z
Learning: In the Vercel integration feature, the GitHub app is responsible for builds and provides git metadata (using source: "trigger_github_app"). The Vercel integration is only for linking deployments between platforms, not for triggering builds or providing git metadata.

Applied to files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
📚 Learning: 2026-02-11T16:37:32.429Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3019
File: apps/webapp/app/components/primitives/charts/Card.tsx:26-30
Timestamp: 2026-02-11T16:37:32.429Z
Learning: In projects using react-grid-layout, avoid relying on drag-handle class to imply draggability. Ensure drag-handle elements only affect dragging when the parent grid item is configured draggable in the layout; conditionally apply cursor styles based on the draggable prop. This improves correctness and accessibility.

Applied to files:

  • apps/webapp/app/components/integrations/VercelLink.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
📚 Learning: 2026-02-03T18:27:40.429Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables/route.tsx:553-555
Timestamp: 2026-02-03T18:27:40.429Z
Learning: In apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables/route.tsx, the menu buttons (e.g., Edit with PencilSquareIcon) in the TableCellMenu are intentionally icon-only with no text labels as a compact UI pattern. This is a deliberate design choice for this route; preserve the icon-only behavior for consistency in this file.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
📚 Learning: 2025-12-08T15:19:56.823Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2760
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx:278-281
Timestamp: 2025-12-08T15:19:56.823Z
Learning: In apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx, the tableState search parameter uses intentional double-encoding: the parameter value contains a URL-encoded URLSearchParams string, so decodeURIComponent(value("tableState") ?? "") is required to fully decode it before parsing with new URLSearchParams(). This pattern allows bundling multiple filter/pagination params as a single search parameter.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
📚 Learning: 2026-02-06T19:53:46.849Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts:233-237
Timestamp: 2026-02-06T19:53:46.849Z
Learning: Vercel dashboard URLs for deployments use the format `https://vercel.com/${teamSlug}/${projectName}/${deploymentId}` where the deploymentId should NOT include the `dpl_` prefix. When constructing Vercel dashboard links from API deployment IDs (which include the `dpl_` prefix), the prefix must be stripped using `.replace(/^dpl_/, "")`.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts
📚 Learning: 2025-11-27T16:26:58.661Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-11-27T16:26:58.661Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
📚 Learning: 2026-02-04T16:34:48.876Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/routes/vercel.connect.tsx:13-27
Timestamp: 2026-02-04T16:34:48.876Z
Learning: In apps/webapp/app/routes/vercel.connect.tsx, configurationId may be absent for "dashboard" flows but must be present for "marketplace" flows. Enforce this with a Zod superRefine and pass installationId to repository methods only when configurationId is defined (omit the field otherwise).

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx
  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
📚 Learning: 2026-02-11T16:50:14.167Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3019
File: apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboards.$dashboardId.widgets.tsx:126-131
Timestamp: 2026-02-11T16:50:14.167Z
Learning: In apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboards.$dashboardId.widgets.tsx, MetricsDashboard entities are intentionally scoped to the organization level, not the project level. The dashboard lookup should filter by organizationId only (not projectId), allowing dashboards to be accessed across projects within the same organization. The optional projectId field on MetricsDashboard serves other purposes and should not be used as an authorization constraint.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
📚 Learning: 2025-11-27T16:26:58.661Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-11-27T16:26:58.661Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `trigger.dev/core` in the webapp, use subpath exports from the package.json instead of importing from the root path

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx
📚 Learning: 2026-02-06T19:53:38.843Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts:233-237
Timestamp: 2026-02-06T19:53:38.843Z
Learning: When constructing Vercel dashboard URLs from deployment IDs, always strip the dpl_ prefix from the ID. Implement this by transforming the ID with .replace(/^dpl_/, "") before concatenating into the URL: https://vercel.com/${teamSlug}/${projectName}/${cleanedDeploymentId}. Consider centralizing this logic in a small helper (e.g., getVercelDeploymentId(id) or a URL builder) and add tests to verify both prefixed and non-prefixed inputs.

Applied to files:

  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
📚 Learning: 2025-11-27T16:26:58.661Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-11-27T16:26:58.661Z
Learning: Applies to apps/webapp/app/v3/presenters/**/*.server.{ts,tsx} : Organize presenters in the webapp following the pattern `app/v3/presenters/*/*.server.ts` to move complex loader code into classes

Applied to files:

  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
📚 Learning: 2025-08-14T12:13:20.455Z
Learnt from: myftija
Repo: triggerdotdev/trigger.dev PR: 2392
File: packages/cli-v3/src/utilities/gitMeta.ts:195-218
Timestamp: 2025-08-14T12:13:20.455Z
Learning: In the GitMeta schema (packages/core/src/v3/schemas/common.ts), all fields are intentionally optional to handle partial data from various deployment contexts (local, GitHub Actions, GitHub App). Functions like getGitHubAppMeta() are designed to work with missing environment variables rather than validate their presence.

Applied to files:

  • apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts
  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
📚 Learning: 2025-09-03T14:35:52.384Z
Learnt from: myftija
Repo: triggerdotdev/trigger.dev PR: 2464
File: apps/webapp/app/utils/pathBuilder.ts:144-146
Timestamp: 2025-09-03T14:35:52.384Z
Learning: In the trigger.dev codebase, organization slugs are safe for URL query parameters and don't require URL encoding, as confirmed by the maintainer in apps/webapp/app/utils/pathBuilder.ts.

Applied to files:

  • apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
🧬 Code graph analysis (5)
apps/webapp/app/components/integrations/VercelLink.tsx (3)
apps/webapp/app/components/primitives/Tooltip.tsx (1)
  • SimpleTooltip (141-141)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • LinkButton (335-403)
apps/webapp/app/components/integrations/VercelLogo.tsx (1)
  • VercelLogo (1-12)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx (1)
apps/webapp/app/components/integrations/VercelLink.tsx (1)
  • VercelLink (5-22)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx (1)
apps/webapp/app/components/integrations/VercelLink.tsx (1)
  • VercelLink (5-22)
apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts (1)
apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts (1)
  • buildVercelDeploymentUrl (205-212)
apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts (1)
apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts (2)
  • VercelProjectIntegrationDataSchema (67-75)
  • buildVercelDeploymentUrl (205-212)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (27)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: sdk-compat / Deno Runtime
🔇 Additional comments (5)
apps/webapp/app/components/integrations/VercelLink.tsx (1)

1-22: LGTM!

Clean, minimal component. The LinkButton correctly routes the https://vercel.com/… URL through the ExtLink branch, and the tooltip/label pairing is consistent with other external link buttons in the codebase.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx (1)

18-18: LGTM!

The VercelLink import and the conditional "Linked" property row are correct. The negative-margin div wrapper mirrors the existing GitMetadata pattern, maintaining visual consistency.

Also applies to: 520-529

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx (1)

22-22: LGTM!

e.stopPropagation() is a sensible guard even though the parent TableCell has no to prop. VercelLink receives the URL as a non-optional string because the outer condition already narrows the type.

Also applies to: 316-323

apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts (1)

13-16: LGTM!

The import refactor cleanly delegates URL construction to buildVercelDeploymentUrl. The existing guard at line 237 (&& vercelTeamSlug && vercelProjectName) ensures neither value is undefined or empty before the call, so the inline SQL LEFT JOIN LATERAL + this function remain consistent.

Also applies to: 238-242

apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts (1)

15-18: LGTM!

The two sequential queries are appropriate for a single-deployment detail view. The guard parsed.success && parsed.data.vercelTeamSlug (line 191) ensures the integrationDeployment query only runs when the integration is valid and team-scoped, and buildVercelDeploymentUrl is never called with an undefined slug. The orderBy: { createdAt: "desc" } on findFirst correctly returns the most recent integration deployment record.

Also applies to: 169-214, 282-282

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts`:
- Around line 205-212: The function buildVercelDeploymentUrl accepts
vercelTeamSlug as string | undefined which lets callers pass undefined and
produce URLs containing the literal "undefined"; change the parameter to
vercelTeamSlug: string (remove | undefined) so the type enforces callers to pass
a real slug, update any call sites that rely on undefined (they should already
guard per the review) and keep the body using vercelTeamSlug.replace(...) and
the same template; ensure TypeScript compiles and no call sites pass undefined
anymore.

---

Nitpick comments:
In `@apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts`:
- Around line 205-212: Add unit tests for buildVercelDeploymentUrl that verify
it strips a "dpl_" prefix when present and leaves non-prefixed IDs unchanged:
create tests calling buildVercelDeploymentUrl with (1) integrationDeploymentId =
"dpl_abc123" and asserting the returned URL contains "abc123", and (2)
integrationDeploymentId = "abc123" and asserting the returned URL contains
"abc123"; include a vercelTeamSlug and vercelProjectName in both tests and
assert the full URL matches the expected string to ensure the function behaves
for both prefixed and non-prefixed inputs.

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

Comments