Skip to content

chore(deployments): Add link to failed jobs#1107

Merged
jsbroks merged 3 commits intomainfrom
jsingleton/add-failed-job-link
May 5, 2026
Merged

chore(deployments): Add link to failed jobs#1107
jsbroks merged 3 commits intomainfrom
jsingleton/add-failed-job-link

Conversation

@jsingleton-dev
Copy link
Copy Markdown
Collaborator

@jsingleton-dev jsingleton-dev commented May 5, 2026

When checking the failed jobs on the UI, it's currently a bit cumbersome to go from the list of failures to find the job agent run with the link to the run you want to see. This PR makes the failed job name a link to the failed deployment target so it's a bit easier to know where to look and faster to get there

Screen.Recording.2026-05-05.at.5.28.48.PM.mov

Summary by CodeRabbit

  • New Features
    • Failed deployments are now clickable links. Click any failed deployment to navigate directly to the release-targets page, which opens in a new tab for streamlined investigation and management of deployment issues.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@jsingleton-dev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 42 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c2ab4500-a410-434a-9bd4-ba905d48d05c

📥 Commits

Reviewing files that changed from the base of the PR and between a74a4cf and 6a78067.

📒 Files selected for processing (1)
  • apps/web/app/routes/ws/deployments/_components/versioncard/VersionCard.tsx
📝 Walkthrough

Walkthrough

The PR refactors the failed deployment popover to render clickable links to the release-targets page instead of plain text, and renames the URL search parameter from "resource" to "query" for consistency across both the link constructor and the parameter consumer.

Changes

Deployment Status Link Navigation

Layer / File(s) Summary
Link Construction
apps/web/app/routes/ws/deployments/_components/versioncard/VersionCard.tsx
FailedPopoverContent is refactored to render failed deployments as Link components pointing to the release-targets page. Each link includes a query parameter derived from the resource name, opens in a new tab, and prevents event propagation. Displays bold resource name, formatted status, and optional message.
Parameter Alignment
apps/web/app/routes/ws/deployments/page.$deploymentId.release-targets.tsx
The useResource hook now reads the "query" parameter instead of "resource" for initial search state, aligning with the parameter key used by the VersionCard links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • ctrlplanedev/ctrlplane#468: Aligns with the "query" parameter naming convention for filtering resources in the release-targets context.

Suggested reviewers

  • jsbroks

Poem

🐰 A popover's dance, from text to link so bright,
Failed deployments now guide users to the light,
Query params aligned, from "resource" to "query,"
Navigation swift, no more search to worry!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(deployments): Add link to failed jobs' directly matches the main change: making failed job names clickable links in the deployment UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jsingleton/add-failed-job-link

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.


function useResource() {
const [searchParams, setSearchParams] = useSearchParams();
const query = searchParams.get("resource") ?? "";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is fixing an existing bug. The code was reading from resource but writing to the query param

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
apps/web/app/routes/ws/deployments/_components/versioncard/VersionCard.tsx (1)

244-263: 💤 Low value

Consider adding rel="noopener noreferrer" to the new Link.

React Router v7 does not automatically add rel="noopener noreferrer" for target="_blank" links. While browsers since 2021 implicitly set rel=noopener for any target="_blank" link making this low-risk in practice (especially for same-origin navigation), it's a zero-cost best practice worth following — and it avoids any potential lint warnings from react/jsx-no-target-blank.

🛡️ Suggested fix
  <Link
    key={rt.releaseTarget.resourceId}
    to={`/${workspace.slug}/deployments/${deployment.id}/release-targets?query=${encodeURIComponent(rt.resource.name)}`}
    target="_blank"
+   rel="noopener noreferrer"
    className="block text-xs hover:underline"
    onClick={(e) => e.stopPropagation()}
  >
🤖 Prompt for 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.

In `@apps/web/app/routes/ws/deployments/_components/versioncard/VersionCard.tsx`
around lines 244 - 263, The Link rendering the release target list (the Link
element in VersionCard / the JSX using rt.releaseTarget.resourceId) opens in a
new tab via target="_blank" but doesn't include rel="noopener noreferrer";
update that Link to add rel="noopener noreferrer" alongside target="_blank" to
prevent window.opener issues and satisfy react/jsx-no-target-blank linting while
keeping onClick={(e) => e.stopPropagation()} and other props intact.
🤖 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.

Nitpick comments:
In `@apps/web/app/routes/ws/deployments/_components/versioncard/VersionCard.tsx`:
- Around line 244-263: The Link rendering the release target list (the Link
element in VersionCard / the JSX using rt.releaseTarget.resourceId) opens in a
new tab via target="_blank" but doesn't include rel="noopener noreferrer";
update that Link to add rel="noopener noreferrer" alongside target="_blank" to
prevent window.opener issues and satisfy react/jsx-no-target-blank linting while
keeping onClick={(e) => e.stopPropagation()} and other props intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5daabf8a-a971-4020-a744-7a3cf4b2df25

📥 Commits

Reviewing files that changed from the base of the PR and between c32246b and a74a4cf.

📒 Files selected for processing (2)
  • apps/web/app/routes/ws/deployments/_components/versioncard/VersionCard.tsx
  • apps/web/app/routes/ws/deployments/page.$deploymentId.release-targets.tsx

@jsbroks
Copy link
Copy Markdown
Member

jsbroks commented May 5, 2026

Amazing! ty

@jsbroks jsbroks merged commit 00823d0 into main May 5, 2026
9 checks passed
@jsbroks jsbroks deleted the jsingleton/add-failed-job-link branch May 5, 2026 23:14
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.

2 participants