-
Notifications
You must be signed in to change notification settings - Fork 0
fix(baseball): Fairway routing + Helm Bridge observability (unified) #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b133e8a
fix(baseball): complete Fairway shell routing and route-contract wiring
d200f53
merge: unify Helm Bridge observability with Fairway routing
c845f06
fix: audit pass — mobile nav parity, lint, errors.ts const
b66a598
fix(ci): harden soft-failure logging and update nav-manifest test
fab1d09
fix(ci): unblock business contracts and CodeQL on PR 787
57e0de1
fix(baseball): address CodeRabbit polish on Fairway routing
4f3e653
fix(security): satisfy CodeQL on server-error-logger Sentry path
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| import Link from 'next/link'; | ||
| import { GitPullRequest, Rocket } from 'lucide-react'; | ||
| import { | ||
| fetchBenLeahIssueBoard, | ||
| type BenLeahTrackStatus, | ||
| } from '@/lib/admin/ben-leah-issues'; | ||
| import { PanelNoData, PanelStale } from '../_components/PanelStates'; | ||
| import { StatusPill, StatTile, type FwStatusTone } from '@/components/fairway'; | ||
| import { BenLeahIssueTable } from './BenLeahIssueTable'; | ||
|
|
||
| const TRACK_META: Record< | ||
| BenLeahTrackStatus, | ||
| { label: string; tone: FwStatusTone; description: string } | ||
| > = { | ||
| open: { | ||
| label: 'Open', | ||
| tone: 'warning', | ||
| description: 'Still open on GitHub — waiting for work.', | ||
| }, | ||
| in_progress: { | ||
| label: 'In progress', | ||
| tone: 'info', | ||
| description: 'Label status:in-progress or status:triaged on the issue.', | ||
| }, | ||
| in_production: { | ||
| label: 'In production', | ||
| tone: 'success', | ||
| description: 'Closed and shipped, or label status:in-production.', | ||
| }, | ||
| fixed_pending_deploy: { | ||
| label: 'Fixed · pending deploy', | ||
| tone: 'warning', | ||
| description: 'Closed on GitHub; production has not deployed since the fix.', | ||
| }, | ||
| fixed: { | ||
| label: 'Fixed', | ||
| tone: 'success', | ||
| description: 'Closed on GitHub (deploy timing unknown).', | ||
| }, | ||
| wont_fix: { | ||
| label: "Won't fix", | ||
| tone: 'neutral', | ||
| description: 'Label status:wontfix on the issue.', | ||
| }, | ||
| }; | ||
|
|
||
| function formatWhen(iso: string): string { | ||
| return new Date(iso).toLocaleString(undefined, { | ||
| month: 'short', | ||
| day: 'numeric', | ||
| hour: 'numeric', | ||
| minute: '2-digit', | ||
| }); | ||
| } | ||
|
|
||
| function githubIntegrationTone(status: string): FwStatusTone { | ||
| if (status === 'ok') return 'success'; | ||
| if (status === 'unconfigured') return 'warning'; | ||
| return 'danger'; | ||
| } | ||
|
|
||
| export async function BenLeahIssueBoard() { | ||
| const board = await fetchBenLeahIssueBoard(); | ||
|
|
||
| if (board.status === 'unconfigured') { | ||
| return ( | ||
| <PanelNoData | ||
| label="GitHub issue tracker not configured" | ||
| description="Set GITHUB_ISSUES_TOKEN in production so Helm Bridge can list ben-leah issues." | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| if (board.status === 'error' || !board.data) { | ||
| return <PanelStale label="Ben + Leah issue tracker" error={board.error} />; | ||
| } | ||
|
|
||
| const { issues, counts, repoLabel, repoIssuesUrl, productionCommitSha, productionReadyAt, fetchedAt } = { | ||
| ...board.data, | ||
| fetchedAt: board.fetchedAt, | ||
| }; | ||
|
|
||
| const openCount = counts.open + counts.in_progress; | ||
| const shippedCount = counts.in_production; | ||
| const pendingDeployCount = counts.fixed_pending_deploy; | ||
|
|
||
| return ( | ||
| <div className="space-y-4"> | ||
| <div className="flex flex-wrap items-center justify-between gap-3"> | ||
| <div className="flex flex-wrap gap-2"> | ||
| <StatusPill tone={githubIntegrationTone(board.status)} dot size="sm"> | ||
| GitHub {board.status === 'ok' ? 'live' : 'stale'} | ||
| </StatusPill> | ||
| <StatusPill tone={productionReadyAt ? 'success' : 'neutral'} dot={Boolean(productionReadyAt)} size="sm"> | ||
| {productionReadyAt | ||
| ? `prod ${productionCommitSha?.slice(0, 7) ?? 'build'}` | ||
| : 'prod timing n/a'} | ||
| </StatusPill> | ||
| {fetchedAt ? ( | ||
| <StatusPill tone="neutral" dot={false} size="sm"> | ||
| checked {new Date(fetchedAt).toLocaleTimeString()} | ||
| </StatusPill> | ||
| ) : null} | ||
| </div> | ||
| <Link | ||
| href={repoIssuesUrl} | ||
| target="_blank" | ||
| rel="noreferrer" | ||
| className="inline-flex items-center gap-1 text-xs font-medium text-accent-700 hover:underline" | ||
| > | ||
| <GitPullRequest size={14} aria-hidden /> | ||
| All issues on {repoLabel} | ||
| </Link> | ||
| </div> | ||
|
|
||
| <div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4"> | ||
| {( | ||
| [ | ||
| ['Open / in progress', openCount, 'Needs attention'], | ||
| ['In production', shippedCount, 'Shipped or labeled'], | ||
| ['Pending deploy', pendingDeployCount, 'Closed, not on prod yet'], | ||
| ['Total tracked', issues.length, 'Last 50 updates'], | ||
| ] as const | ||
| ).map(([label, value, caption]) => ( | ||
| <div key={label} className="rounded-xl border border-warm-200/70 bg-surface px-3 py-2"> | ||
| <StatTile label={label} value={value} tone="neutral" mono /> | ||
| <p className="mt-1 text-xs text-warm-500">{caption}</p> | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
| {productionReadyAt ? ( | ||
| <p className="flex items-center gap-2 text-xs text-warm-500"> | ||
| <Rocket size={14} className="text-accent-600" aria-hidden /> | ||
| Production last ready {formatWhen(new Date(productionReadyAt).toISOString())} | ||
| {productionCommitSha ? ` · ${productionCommitSha.slice(0, 7)}` : null} | ||
| . Closed issues after that time show as <span className="font-medium text-warm-700">In production</span>. | ||
| </p> | ||
| ) : ( | ||
| <p className="text-xs text-warm-500"> | ||
| Set VERCEL_API_TOKEN to correlate closed issues with production deploy timing. Without it, status uses GitHub labels only. | ||
| </p> | ||
| )} | ||
|
|
||
| {issues.length === 0 ? ( | ||
| <PanelNoData | ||
| label="No Ben + Leah issues yet" | ||
| description="Submissions from this tab create GitHub issues tagged ben-leah. Submit the first one above." | ||
| /> | ||
| ) : ( | ||
| <BenLeahIssueTable issues={issues} /> | ||
| )} | ||
|
|
||
| <div className="grid gap-2 sm:grid-cols-2 lg:grid-cols-3"> | ||
| {(Object.keys(TRACK_META) as BenLeahTrackStatus[]).map((status) => ( | ||
| <div key={status} className="rounded-fw-md bg-surface-sunken px-3 py-2"> | ||
| <div className="flex items-center justify-between gap-2"> | ||
| <StatusPill tone={TRACK_META[status].tone} dot size="sm"> | ||
| {TRACK_META[status].label} | ||
| </StatusPill> | ||
| <span className="font-fw-mono text-sm tabular-nums text-warm-900">{counts[status]}</span> | ||
| </div> | ||
| <p className="mt-1 text-xs text-warm-500">{TRACK_META[status].description}</p> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.