Skip to content

feat(ui): Route the bench logs dialog so the 500 page can link to it - #7257

Merged
balamurali27 merged 3 commits into
developfrom
route-bench-logs-dialog
Aug 18, 2026
Merged

feat(ui): Route the bench logs dialog so the 500 page can link to it#7257
balamurali27 merged 3 commits into
developfrom
route-bench-logs-dialog

Conversation

@balamurali27

Copy link
Copy Markdown
Contributor

Problem

The sidebar's Benches entry points at /groups, and its isActive set contains only Release Group * routes. /benches/:name (Bench Detail, which hosts LogPage.vue) is reachable only by clicking a bench row inside a group — nothing in the nav goes there.

That matters because the new 500 error page in frappe/agent#581 links a broken site's owner straight to that bench's web.error.log. The link pointed at a page users can't otherwise reach.

Change

The logs dialog on the group's Sites tab is the maintained log viewer, so route to that instead.

  • ReleaseGroupBenchSites.vuemounted() opens the dialog from ?bench=&log=. The dialog-opening code moved into showBenchLogs(), which the existing View Logs row action now calls too.
  • BenchLogsDialog.vue — new initialLog prop opens that log directly instead of showing the list first. Also scrolls to the newest entries on load, since these files run to megabytes.
  • objects/bench.ts — the Bench Log route is now a redirect rather than a component.
  • objects/common/types.tsRouteDetail.component is optional, redirect added.

Resulting URL:

/dashboard/groups/bench-0004/sites?bench=bench-0004-000023-f1&log=web.error.log

No agent-side change needed

/dashboard/benches/<bench>/logs/<log> now redirects into the dialog, so agent#581 needs no edit and every nginx config already serving that link keeps working.

The redirect derives the group with bench-${name.split('-')[1]} — the same derivation LogPage.vue and BenchLogsDialog.vue already rely on, not a new assumption.

Notes for review

Formatting churn. biome.json sets semicolons: "asNeeded", but these files were written with semicolons, so the pre-commit hook rewrote all four on contact. The first commit is therefore ~390 lines for ~45 lines of logic. Reviewing commit-by-commit, or with -w, will not help — it is a semicolon and import-order rewrite. Happy to rebase onto pristine files if you would rather take the logic alone.

Supersedes #7235, which added scroll-to-bottom to LogPage.vue. That page is no longer where the bench link lands, so the behaviour moved into the dialog. LogPage.vue is still the viewer for site logs and no longer scrolls to the bottom for them; say if that should be restored separately.

Testing

vue-tsc reports no errors in any of the four changed files (the codebase has many pre-existing ones elsewhere), and vite build passes. Not click-tested in a browser — worth confirming mounted fires with the query on a hard page load, since that is the deep-link path.

🤖 Generated with Claude Code

balamurali27 and others added 2 commits August 18, 2026 15:06
Benches now live under their group, so the bench detail page is off the
sidebar and LogPage.vue was reachable only by typing a URL. The 500 error
page links straight there.

Open the existing BenchLogsDialog from a query on the group's Sites tab
(?bench=&log=), and redirect the old /benches/<bench>/logs/<log> route to
it, so links already baked into served nginx configs keep working without
an agent-side change.

The dialog derives the group from the bench name itself, so the deep link
needs the bench name only.

Note: biome rewrote the touched files. biome.json sets semicolons
"asNeeded" but these files predate it, so the hook reformats on contact.
The logic is in ReleaseGroupBenchSites.vue (mounted + showBenchLogs),
BenchLogsDialog.vue (initialLog prop) and objects/bench.ts (redirect).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The 500 page's link now lands in this dialog rather than LogPage, so the
scroll-to-bottom behaviour has to live here too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@balamurali27
balamurali27 requested a review from siduck as a code owner August 18, 2026 09:56
@balamurali27
balamurali27 enabled auto-merge August 18, 2026 09:58
@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The generated router preserves the redirect, hard-loaded deep links mount the target component, and backend authorization scopes log retrieval to the selected team-owned release group and bench.

Reviews (1): Last reviewed commit: "Merge branch 'develop' into route-bench-..." | Re-trigger Greptile

@balamurali27
balamurali27 merged commit 1ce333a into develop Aug 18, 2026
12 checks passed
@balamurali27
balamurali27 deleted the route-bench-logs-dialog branch August 18, 2026 10:07
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.96774% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.30%. Comparing base (e630392) to head (62d1874).
⚠️ Report is 13 commits behind head on develop.

Files with missing lines Patch % Lines
dashboard/src/pages/ReleaseGroupBenchSites.vue 70.96% 27 Missing ⚠️

❌ Your patch status has failed because the patch coverage (70.96%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #7257       +/-   ##
============================================
+ Coverage    58.71%   87.30%   +28.58%     
============================================
  Files         1024      126      -898     
  Lines        94135    22968    -71167     
  Branches      1216     1218        +2     
============================================
- Hits         55273    20052    -35221     
+ Misses       38839     2893    -35946     
  Partials        23       23               
Flag Coverage Δ
dashboard 87.30% <70.96%> (+2.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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