main
1import type { Child } from 'hono/jsx'
2import type { BranchInfo, RepoHeader, TagInfo, TraceBar, TraceModel } from './model.ts'
3import { PLY_SHA, PLY_WEB_SHA, plyBuildValue } from '../version.ts'
4import { atIndex } from '../absent.ts'
6/** Hex digits of each commit shown in the footer. */
7const BUILD_SHA_CHARS = 12
8import { viewerHref } from './url.ts'
9import {
10 bannerClass, buttonClass, KUMO_BADGE_DANGER, KUMO_BADGE_INFO, KUMO_BADGE_NEUTRAL, KUMO_BADGE_OUTLINE, KUMO_BADGE_SUCCESS,
11 KUMO_BADGE_WARNING, KUMO_BREADCRUMBS, KUMO_BREADCRUMB_CURRENT, KUMO_BREADCRUMB_LINK, KUMO_BREADCRUMB_SEPARATOR,
12 KUMO_BUTTON_FOCUS, KUMO_BUTTON_SECONDARY, KUMO_BUTTON_SIZE_SM, KUMO_INPUT_SM, KUMO_LAYER_CARD, KUMO_LAYER_CARD_PRIMARY,
13 KUMO_LAYER_CARD_SECONDARY, type BannerTone, type ButtonSize, type ButtonVariant,
14} from './kumo-classes.ts'
15import { exactTime, formatBytes, formatDuration, percentClass } from './format.ts'
16import { repoIdentity } from './identity.ts'
17import { LAYOUT } from './layout.ts'
18import { VIEWER_CSS_PATH } from './styles.ts'
20export function Button(props: { variant: ButtonVariant; size: ButtonSize; type: 'submit' | 'button' | null; children: Child }) {
21 const tone = props.variant === 'primary' ? 'is-primary' : 'is-secondary'
22 const type = props.type === null ? 'submit' : props.type
23 return <button type={type} class={`btn ${tone} ${buttonClass(props.variant, props.size)}`}>{props.children}</button>
24}
26export function Banner(props: { tone: BannerTone; children: Child }) {
27 return <p class={`banner ${bannerClass(props.tone)}`}>{props.children}</p>
28}
30export function Time(props: { iso: string; tz: string; now: number }) {
31 const exact = exactTime(props.iso, props.tz, props.now)
32 return <time class="when" datetime={exact.iso} title={exact.label}>{exact.relative}</time>
33}
35// ── icons ───────────────────────────────────────────────────────────────────────────────────────────────────────
36// One inline sprite per page; every icon is a <use> of it (img-src is 'none', so no data: URIs). 16×16 grid.
38const ICONS: Record<string, string> = {
39 dir: 'M1.5 3.25c0-.69.56-1.25 1.25-1.25h3.4c.33 0 .65.13.88.37L8.2 3.5h5.05c.69 0 1.25.56 1.25 1.25v7.5c0 .69-.56 1.25-1.25 1.25H2.75c-.69 0-1.25-.56-1.25-1.25z',
40 file: 'M4 1.5h5.1L12.5 4.9v9.1a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V2a.5.5 0 0 1 .5-.5zM9 1.75V5h3.25',
41 link: 'M6.5 9.5l3-3M7.3 4.7l1.1-1.1a2.5 2.5 0 0 1 3.5 3.5l-1.1 1.1M8.7 11.3l-1.1 1.1a2.5 2.5 0 0 1-3.5-3.5l1.1-1.1',
42 module: 'M2 4.5L8 1.75l6 2.75v7L8 14.25 2 11.5zM2 4.5l6 2.75 6-2.75M8 7.25v7',
43 branch: 'M5 2.5v7.25M5 9.75a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM5 2.5a1.5 1.5 0 1 0 0 .01M11 3.25a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5zM11 6.75c0 2.5-6 1.5-6 3',
44 book: 'M8 3.5C6.8 2.6 5 2.25 2.25 2.25v10c2.75 0 4.55.35 5.75 1.25 1.2-.9 3-1.25 5.75-1.25v-10C11 2.25 9.2 2.6 8 3.5zM8 3.5v10',
45 history: 'M2.25 8A5.75 5.75 0 1 0 4 3.9M2.25 2v2.75H5M8 5v3.25l2.25 1.5',
46 pulse: 'M1.5 8.5h2.75L6 4l3 8 1.75-3.5h3.75',
47 chevron: 'M4.5 6.25L8 9.75l3.5-3.5',
48 up: 'M8 13V3.5M4.25 7.25L8 3.5l3.75 3.75',
49 raw: 'M5.5 4.5L2 8l3.5 3.5M10.5 4.5L14 8l-3.5 3.5',
50}
52export function Sprite() {
53 return (
54 <svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false">
55 {Object.entries(ICONS).map(([id, d]) => <symbol id={`i-${id}`} viewBox="0 0 16 16"><path d={d} /></symbol>)}
56 </svg>
57 )
58}
60export function Icon(props: { name: keyof typeof ICONS; class: string | null }) {
61 return <svg class={`i i-${props.name}${props.class ? ` ${props.class}` : ''}`} width="16" height="16" aria-hidden="true" focusable="false"><use href={`#i-${props.name}`} /></svg>
62}
64export function IconFolder() { return <Icon name="dir" class={null} /> }
65export function IconFile() { return <Icon name="file" class={null} /> }
67// ── page frame ──────────────────────────────────────────────────────────────────────────────────────────────────
69export function Document(props: { title: string; children: Child }) {
70 return (
71 <html lang="en">
72 <head>
73 <meta charset="utf-8" />
74 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
75 <meta name="color-scheme" content="light dark" />
76 <title>{props.title}</title>
77 <link rel="stylesheet" href={VIEWER_CSS_PATH} />
78 </head>
79 <body>
80 <Sprite />
81 <header class="site-header">
82 <div class="site-header-inner">
83 <a class="brand" href="/view"><span class="mark" aria-hidden="true"></span>ply</a>
84 <span class="brand-sub">Public repo viewer</span>
85 </div>
86 </header>
87 <main class="page">{props.children}</main>
88 </body>
89 </html>
90 )
91}
93/** Kumo LayerCard: an elevated frame, an optional header strip (Secondary), and the raised panel (Primary). */
94export function Card(props: { head: Child | null; id: string | null; class: string | null; children: Child }) {
95 return (
96 <section class={`card ${KUMO_LAYER_CARD}${props.class ? ` ${props.class}` : ''}`} {...(props.id ? { id: props.id } : {})}>
97 {props.head ? <div class={`card-head ${KUMO_LAYER_CARD_SECONDARY}`}>{props.head}</div> : null}
98 <div class={`card-body ${KUMO_LAYER_CARD_PRIMARY}`}>{props.children}</div>
99 </section>
100 )
101}
103export function Badge(props: { tone: 'neutral' | 'outline' | 'success' | 'info' | 'warning' | 'danger'; title: string | null; children: Child }) {
104 const cls = { neutral: KUMO_BADGE_NEUTRAL, outline: KUMO_BADGE_OUTLINE, success: KUMO_BADGE_SUCCESS, info: KUMO_BADGE_INFO, warning: KUMO_BADGE_WARNING, danger: KUMO_BADGE_DANGER }[props.tone]
105 return <span class={cls} {...(props.title ? { title: props.title } : {})}>{props.children}</span>
106}
108export function Signed() {
109 return <Badge tone="success" title="The commit carries a signature header (not verified here)">Signed</Badge>
110}
112// ── repository header ───────────────────────────────────────────────────────────────────────────────────────────
114function shortRef(ref: string): string {
115 return ref.replace(/^refs\/heads\//, '').replace(/^refs\/tags\//, '')
116}
118export function RepoIdentity(props: { host: string; repoPath: string; ref: string | null }) {
119 const id = repoIdentity(props.host, props.repoPath)
120 const root = viewerHref(props.host, props.repoPath, props.ref ? { ref: props.ref } : {})
121 return (
122 <div class="repo-id">
123 <p class="repo-scope">
124 <span class="repo-host" title={id.remote}>{id.hostLabel}</span>
125 {id.scope ? <>{id.scopeHref ? <a href={id.scopeHref}>{id.scope}</a> : <span>{id.scope}</span>}<span class="repo-slash" aria-hidden="true">/</span></> : null}
126 </p>
127 <h1 class="repo-name"><a href={root}>{id.name}</a></h1>
128 </div>
129 )
130}
132export function RepoTitle(props: { header: RepoHeader; path: string; branches: readonly BranchInfo[]; tags: readonly TagInfo[] }) {
133 return (
134 <header class="repo-head">
135 <RepoIdentity host={props.header.host} repoPath={props.header.repoPath} ref={props.header.ref} />
136 <div class="repo-tools">
137 <RefSwitcher header={props.header} path={props.path} branches={props.branches} tags={props.tags} />
138 </div>
139 </header>
140 )
141}
143/** Kumo Breadcrumbs (sm) for the path inside the repository. The repository name is the first crumb. */
144export function PathCrumbs(props: { header: { host: string; repoPath: string; ref: string }; path: string }) {
145 if (!props.path) return null
146 const id = repoIdentity(props.header.host, props.header.repoPath)
147 const parts = props.path.split('/')
148 const crumbs: { label: string; href: string }[] = [{ label: id.name, href: viewerHref(props.header.host, props.header.repoPath, { ref: props.header.ref }) }]
149 let acc = ''
150 for (const part of parts) {
151 acc = acc ? `${acc}/${part}` : part
152 crumbs.push({ label: part, href: viewerHref(props.header.host, props.header.repoPath, { ref: props.header.ref, path: acc }) })
153 }
154 const last = crumbs.length - 1
155 return (
156 <nav class={`crumbs ${KUMO_BREADCRUMBS}`} aria-label="Path">
157 {crumbs.map((crumb, index) => (
158 <>
159 {index > 0 ? <span class={`sep ${KUMO_BREADCRUMB_SEPARATOR}`} aria-hidden="true">/</span> : null}
160 {index === last
161 ? <span class={`here ${KUMO_BREADCRUMB_CURRENT}`} aria-current="page">{crumb.label}</span>
162 : <a class={`crumb ${KUMO_BREADCRUMB_LINK}`} href={crumb.href}>{crumb.label}</a>}
163 </>
164 ))}
165 </nav>
166 )
167}
169function refOption(name: string, current: string, label: string, note: string) {
170 const selected = name === current || shortRef(name) === current
171 return <option value={name} selected={selected}>{label}{note}</option>
172}
174export function RefSwitcher(props: { header: RepoHeader; path: string; branches: readonly BranchInfo[]; tags: readonly TagInfo[] }) {
175 const action = viewerHref(props.header.host, props.header.repoPath, {})
176 const known = props.branches.some(branch => branch.name === props.header.ref || shortRef(branch.name) === props.header.ref)
177 || props.tags.some(tag => tag.name === props.header.ref || shortRef(tag.name) === props.header.ref)
178 const current = /^[0-9a-f]{40}$/.test(props.header.ref) ? props.header.ref.slice(0, LAYOUT.shortOid) : shortRef(props.header.ref)
179 return (
180 <details class="refbox">
181 <summary class={`ref-summary ${KUMO_BUTTON_SIZE_SM} ${KUMO_BUTTON_SECONDARY} ${KUMO_BUTTON_FOCUS}`} aria-label={`Ref ${current}. Switch branch or tag`}>
182 <Icon name="branch" class={null} />
183 <span class="ref-v">{current}</span>
184 <Icon name="chevron" class="i-sm" />
185 </summary>
186 <div class="ref-pop">
187 <form action={action} method="get">
188 <label class="ref-label" for="ref-branch">Branch or tag</label>
189 <select id="ref-branch" class={`ref-field ${KUMO_INPUT_SM}`} name="ref">
190 {known ? null : <option value={props.header.ref} selected>{current}</option>}
191 <optgroup label="Branches">
192 {props.branches.map(branch => refOption(branch.name, props.header.ref, shortRef(branch.name), branch.head ? ' (default)' : ''))}
193 </optgroup>
194 {props.tags.length ? (
195 <optgroup label="Tags">
196 {props.tags.map(tag => refOption(tag.name, props.header.ref, shortRef(tag.name), ''))}
197 </optgroup>
198 ) : null}
199 </select>
200 {props.path ? <input type="hidden" name="path" value={props.path} /> : null}
201 <button class={`ref-go ${buttonClass('primary', 'sm')}`} type="submit">Switch</button>
202 </form>
203 <form action={action} method="get">
204 <label class="ref-label" for="ref-oid">Commit</label>
205 <input id="ref-oid" class={`ref-field ${KUMO_INPUT_SM}`} type="text" name="ref" placeholder="name or oid" autocomplete="off" spellcheck={false} />
206 {props.path ? <input type="hidden" name="path" value={props.path} /> : null}
207 <button class={`ref-go ${buttonClass('primary', 'sm')}`} type="submit">Go</button>
208 </form>
209 </div>
210 </details>
211 )
212}
214// ── diagnostics ─────────────────────────────────────────────────────────────────────────────────────────────────
216const COMMIT_HEX = /^[0-9a-f]{40}$/
218/** A GitHub link for a build commit when it is a full id; otherwise plain text. */
219function BuildLink(props: { repo: 'ply' | 'ply-web'; sha: string }) {
220 const short = props.sha.slice(0, BUILD_SHA_CHARS)
221 return COMMIT_HEX.test(props.sha)
222 ? <span><a href={`https://github.com/ivarvong/${props.repo}/commit/${props.sha}`}>{props.repo}={short}</a></span>
223 : <span>{props.repo}={short}</span>
224}
226/**
227 * The page's git work, one line under the title: how many round trips ply made, how long, how many bytes, how many
228 * came from Workers Cache, and every call as a bar on one shared timeline. Links to the full waterfall below.
229 */
230export function PlyStrip(props: { trace: TraceModel; header: RepoHeader }) {
231 const bars = props.trace.bars
232 if (!bars.length) return null
233 const span = Math.max(props.trace.totalMs, 1)
234 const bytes = bars.reduce((sum, bar) => sum + (bar.bytes === null ? 0 : bar.bytes), 0)
235 const hits = bars.filter(bar => bar.cache === 'HIT').length
236 const server = props.header.server
237 return (
238 <a class="ply-strip" href="#diagnostics" title="Every git round trip ply made to render this page">
239 <span class="ply-strip-text">
240 <span class="ply-strip-brand">ply</span>
241 <span>{bars.length} git {bars.length === 1 ? 'call' : 'calls'}</span>
242 <span>{formatDuration(props.trace.totalMs)}</span>
243 <span>{formatBytes(bytes)}</span>
244 {hits ? <span class="wf-hit">{hits} cached</span> : null}
245 <span class="ply-strip-proto">protocol v{server.protocol}</span>
246 </span>
247 <span class="ply-strip-track" aria-hidden="true">
248 {bars.map(bar => {
249 const left = Math.max(0, Math.min(LAYOUT.percentSteps, Math.round((bar.startMs / span) * LAYOUT.percentSteps)))
250 let width = Math.max(1, Math.round((bar.durMs / span) * LAYOUT.percentSteps))
251 if (left + width > LAYOUT.percentSteps) width = Math.max(1, LAYOUT.percentSteps - left)
252 return <span class={`wf-bar ${barTone(bar, bars)} ${percentClass('o', left)} ${percentClass('w', width)}`}></span>
253 })}
254 </span>
255 </a>
256 )
257}
259export function Protocol(props: { header: RepoHeader }) {
260 const server = props.header.server
261 return (
262 <dl class="kv">
263 <div><dt>Protocol</dt><dd>v{server.protocol} · {server.objectFormat}</dd></div>
264 <div><dt>Agent</dt><dd class="mono">{server.agent || 'unknown'}</dd></div>
265 <div><dt>Filter</dt><dd>{server.filterAdvertised ? 'advertised' : 'not advertised'}</dd></div>
266 <div><dt>Fetch</dt><dd class="mono">{server.fetchFeatures.join(' ') || 'none'}</dd></div>
267 <div><dt>Capabilities</dt><dd class="mono">{server.caps.join(' ') || 'none'}</dd></div>
268 </dl>
269 )
270}
272/**
273 * A 400 to a narrow filter that a later call on this page answered with the blob:none fallback: the server's known
274 * refusal (Cloudflare Artifacts refuses tree:0), which ply handled. Drawn as the fallback, not as a failure.
275 */
276function handledRefusal(bar: TraceBar, bars: readonly TraceBar[]): boolean {
277 if (bar.httpStatus !== 400) return false
278 const filter = lineValue(bar.lines, 'git.fetch.filter=')
279 if (filter === null || filter === 'blob:none') return false
280 const at = bars.indexOf(bar)
281 return bars.slice(at + 1).some(next => next.httpStatus === 200 && lineValue(next.lines, 'git.fetch.filter.fallback=') === 'blob:none')
282}
284function barTone(bar: TraceBar, bars: readonly TraceBar[]): string {
285 if (handledRefusal(bar, bars)) return 'c-fallback'
286 if (bar.status === 'error' || (bar.httpStatus !== null && bar.httpStatus >= 400)) return 'c-err'
287 if (bar.cache === 'HIT') return 'c-hit'
288 if (bar.lines.some(line => line.startsWith('git.fetch.filter.fallback='))) return 'c-fallback'
289 if (bar.name.includes('discover') || bar.name.includes('ls-refs')) return 'c-discover'
290 return 'c-fetch'
291}
293function lineValue(lines: readonly string[], prefix: string): string | null {
294 for (const line of lines) {
295 if (!line.startsWith(prefix)) continue
296 const value = atIndex(line.split('='), 1)
297 return value.tag === 'some' ? value.value : null
298 }
299 return null
300}
302function callLabel(bar: TraceBar): { name: string; tag: string } {
303 const name = bar.name.replace(/^git\.(upload-pack|receive-pack)\s+/, '').replace(/^git\./, '')
304 const fallback = lineValue(bar.lines, 'git.fetch.filter.fallback=')
305 const filter = fallback === null ? lineValue(bar.lines, 'git.fetch.filter=') : fallback
306 const deepen = lineValue(bar.lines, 'git.fetch.deepen=')
307 const tag = [filter, deepen !== null && deepen !== '0' ? `deepen ${deepen}` : ''].filter(Boolean).join(' · ')
308 return { name, tag }
309}
311/** What each git call is for, in plain words (the row's title and the legend under the waterfall). */
312function callPurpose(name: string): string {
313 if (name === 'discover') return 'Capability handshake: which protocol and features the server speaks (GET info/refs)'
314 if (name === 'ls-refs') return 'Branch and tag tips: names to commit ids (protocol v2 ls-refs)'
315 if (name === 'fetch') return 'A packfile: the objects asked for by id, with the filter shown (protocol v2 fetch)'
316 return 'One HTTP round trip to the git server'
317}
319export function Waterfall(props: { trace: TraceModel; host: string; repoPath: string; ref: string | null }) {
320 const trace = props.trace
321 if (!trace.bars.length) return null
322 const span = Math.max(trace.totalMs, 1)
323 return (
324 <div class="wf" role="table" aria-label="Upstream git calls">
325 <div class="wf-head" role="row">
326 <span role="columnheader">Call</span>
327 <span role="columnheader" class="num">Status</span>
328 <span role="columnheader" class="num">Size</span>
329 <span role="columnheader" class="num">Time</span>
330 <span role="columnheader" class="wf-axis"><span>0</span><span>{formatDuration(trace.totalMs)}</span></span>
331 </div>
332 {trace.bars.map(bar => {
333 const left = Math.max(0, Math.min(LAYOUT.percentSteps, Math.round((bar.startMs / span) * LAYOUT.percentSteps)))
334 let width = Math.max(bar.durMs > 0 ? 1 : 0, Math.round((bar.durMs / span) * LAYOUT.percentSteps))
335 if (left + width > LAYOUT.percentSteps) width = Math.max(1, LAYOUT.percentSteps - left)
336 const failed = !handledRefusal(bar, trace.bars) && (bar.status === 'error' || (bar.httpStatus !== null && bar.httpStatus >= 400))
337 const label = callLabel(bar)
338 const packHref = bar.packWant && bar.packFilter
339 ? viewerHref(props.host, props.repoPath, { ref: props.ref === null ? '' : props.ref, want: bar.packWant, filter: bar.packFilter })
340 : null
341 return (
342 <details class={failed ? 'wf-row err' : 'wf-row'} role="row">
343 <summary class="wf-sum">
344 <span class="wf-name" role="cell" title={callPurpose(label.name)}><span class="wf-call">{label.name}</span>{label.tag ? <span class="wf-tag">{label.tag}</span> : null}</span>
345 <span class="num wf-status" role="cell">{bar.httpStatus === null ? '—' : String(bar.httpStatus)}</span>
346 <span class="num" role="cell">{bar.bytes === null ? '—' : formatBytes(bar.bytes)}{bar.cache === 'HIT' ? <span class="wf-hit" title="Served from Workers Cache"> · hit</span> : null}</span>
347 <span class="num wf-ms" role="cell">{formatDuration(bar.durMs)}</span>
348 <span class="wf-track" role="cell" title={`${label.name} · starts at ${formatDuration(bar.startMs)} · ${formatDuration(bar.durMs)}`}>
349 <span class={`wf-bar ${barTone(bar, trace.bars)} ${percentClass('o', left)} ${percentClass('w', width)}`}></span>
350 </span>
351 </summary>
352 <div class="wf-detail">
353 <pre class="detail">{`${bar.name}\n${bar.lines.join('\n')}`}</pre>
354 {packHref ? <a class="wf-pack" href={packHref}>Open pack map</a> : null}
355 </div>
356 </details>
357 )
358 })}
359 <p class="wf-caption">Each row is one HTTP round trip ply made to the git server for this page, on one timeline. <span class="mono">discover</span> asks what the server speaks, <span class="mono">ls-refs</span> lists branch tips, <span class="mono">fetch</span> brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.</p>
360 <p class="wf-legend" aria-hidden="true">
361 <span><i class="dot c-discover"></i>handshake</span>
362 <span><i class="dot c-fetch"></i>fetch</span>
363 <span><i class="dot c-fallback"></i>blob:none fallback</span>
364 <span><i class="dot c-hit"></i>cache hit</span>
365 <span><i class="dot c-err"></i>error</span>
366 </p>
367 </div>
368 )
369}
371function shownId(id: string): string {
372 if (!id) return 'n/a'
373 if (id.length <= LAYOUT.requestIdShown) return id
374 return `${id.slice(0, LAYOUT.requestIdShown)}…`
375}
377/**
378 * Everything about how the page was fetched, collapsed by default (open with ?trace=1): the remote, the git calls
379 * as a waterfall on one shared timeline, the protocol the server spoke, pack-map links, and request ids.
380 */
381export function Diagnostics(props: { trace: TraceModel; header: RepoHeader | null; host: string | null; repoPath: string | null; ref: string | null; open: boolean }) {
382 const trace = props.trace
383 const host = props.header === null ? (props.host === null ? '' : props.host) : props.header.host
384 const repoPath = props.header === null ? (props.repoPath === null ? '' : props.repoPath) : props.header.repoPath
385 const ref = props.header === null ? props.ref : props.header.ref
386 const wide = trace.bars.filter(bar => bar.lines.some(line => line.startsWith('git.fetch.filter.fallback=')))
387 // learned=true: this page saw the 400 and retried. learned=false: the isolate already knew, so it asked for blob:none.
388 // A refusal on this page (any call: the history window is often the first to ask for tree:0) counts as a retry here.
389 const refusedHere = trace.bars.some(bar => bar.lines.includes('http.response.status_code=400') && bar.lines.some(line => line.startsWith('git.fetch.filter=') && line !== 'git.fetch.filter=blob:none'))
390 const fallbacks = wide.filter(bar => bar.lines.includes('git.fetch.filter.learned=true')).length || (refusedHere ? wide.length : 0)
391 const known = wide.length - fallbacks
392 const retry = fallbacks === 0 ? '' : fallbacks === 1 ? ' · 1 retry' : ` · ${fallbacks} retries`
393 const calls = trace.bars.length
394 const pill = calls ? `${calls} git ${calls === 1 ? 'call' : 'calls'} · ${formatDuration(trace.totalMs)}${retry}` : 'no git calls'
395 const id = host && repoPath ? repoIdentity(host, repoPath) : null
396 return (
397 <section class="diag" id="diagnostics">
398 <details class="diag-box" {...(props.open ? { open: true } : {})}>
399 <summary class="diag-sum">
400 <Icon name="pulse" class={null} />
401 <span class="diag-title">Diagnostics</span>
402 <span class="diag-pill">{pill}</span>
403 <Icon name="chevron" class="i-sm diag-chev" />
404 </summary>
405 <div class="diag-body">
406 {fallbacks > 0 ? <Banner tone="alert">filter tree:0 was rejected. ply retried with blob:none. The calls are serial, which is why the waterfall is a staircase.</Banner> : null}
407 {fallbacks === 0 && known > 0 ? <Banner tone="info">This server refuses filter tree:0 (learned earlier in this isolate), so ply asked for blob:none directly. That brings every tree under the commit, not just one.</Banner> : null}
408 {host ? <Waterfall trace={trace} host={host} repoPath={repoPath} ref={ref} /> : null}
409 <dl class="kv">
410 {id ? <div><dt>Remote</dt><dd class="mono">{id.remote}</dd></div> : null}
411 {ref ? <div><dt>Ref</dt><dd class="mono">{ref}</dd></div> : null}
412 {props.header ? <div><dt>Commit</dt><dd class="mono">{props.header.commit}</dd></div> : null}
413 <div><dt>cf-ray</dt><dd class="mono">{trace.cfRay || 'n/a'}</dd></div>
414 <div><dt>Request</dt><dd class="mono" title={trace.requestId || 'n/a'}>{shownId(trace.requestId)}</dd></div>
415 </dl>
416 {props.header ? <Protocol header={props.header} /> : null}
417 {props.header ? (
418 <p class="diag-links">
419 Pack maps for this commit:{' '}
420 <a href={viewerHref(host, repoPath, { ref: ref === null ? '' : ref, want: props.header.commit, filter: 'tree:0' })}>tree:0</a>
421 {' · '}
422 <a href={viewerHref(host, repoPath, { ref: ref === null ? '' : ref, want: props.header.commit, filter: 'blob:none' })}>blob:none</a>
423 </p>
424 ) : null}
425 </div>
426 </details>
427 <footer class="site-footer">
428 <span>Rendered by <a href="https://github.com/ivarvong/ply">ply</a>, a zero-dependency git client · read-only</span>
429 {/* Abbreviated commits, one unbreakable token each, so a narrow footer wraps between them (never at "ply-web").
430 The full value is the title and the x-ply-build header. */}
431 <span class="mono build" title={`${plyBuildValue()} (ply commit and ply-web commit this deploy was built from)`}>
432 <BuildLink repo="ply" sha={PLY_SHA} /> <BuildLink repo="ply-web" sha={PLY_WEB_SHA} />
433 </span>
434 <a href="/view#limits">Limits</a>
435 </footer>
436 </section>
437 )
438}
440/** Old name kept for the pages that only need the footer. */
441export function Footer(props: { trace: TraceModel; header: RepoHeader | null; host: string | null; repoPath: string | null; ref: string | null; open: boolean }) {
442 return <Diagnostics {...props} />
443}
Diagnostics4 git calls · 24 ms
CallStatusSizeTime024 ms
discover200152 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=2 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020040 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=18 git.response.bytes=41349 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=526b305930b8ef382f2d7a1f9c0238730a585921 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=41349 git.pkt.payload.max=41254 git.sideband.band1.bytes=41253 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=61 git.pack.bytes=41253 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=ab60efef4b7243678c75de64a4386986ee885c1c git.pack.full=61Open pack map
fetch2007.7 KiB · hit19 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=7892 git.response.cache=HIT git.response.duration_ms=19 git.fetch.wants=a8bd4d66700635cdf8933f264478a6c9404e0e86 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=7892 git.pkt.payload.max=7871 git.sideband.band1.bytes=7870 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
- Ref
- refs/heads/main
- Commit
- 526b305930b8ef382f2d7a1f9c0238730a585921
- cf-ray
- a5e31122686ebdc9
- Request
- 47a9fff6…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format