mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-25 03:34:14 +00:00
8487258 added the deprecation notice to the shared helm metadata partial, on
the understanding that both the Overview and Chart tabs rendered it. Only the
Chart tab does. The Overview panel renders the README and never touches chart
metadata, so a deprecated chart carried no warning on the default landing tab.
The notice is extracted into a shared helm-deprecation-notice block, so the
copy lives in one place, and the Overview panel renders it server-side as the
first element in the panel. Deprecation decides whether you should use the
chart at all, so it belongs in the first paint rather than arriving a beat
later from a lazy fetch.
Getting the data there costs nothing extra. The page already made a blocking
hold call for layer count, and for a chart that call was wasted: a helm config
blob is Chart.yaml, which has no history key, so the count always came back 0
and fell through to the database. That call is now FetchHelmChartMeta instead,
against the same XRPC endpoint, so a chart page makes one hold call rather than
two and the displayed layer count is unchanged. A container image never fetches
chart metadata and its path is byte-for-byte the old code.
Failure follows the layer-count precedent: log at warn, leave the metadata nil,
render the page. An unreachable hold means no notice, not a broken repository
page. The tradeoff against the lazy version is that a slow-but-up hold now
delays the whole page, bounded by the same 10s the page already accepted.
A container image emits no element at all rather than an empty one, so the
space-y-4 stack spacing is untouched.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDqoCE1j3njokkZ9b1C5n9
144 lines
6.8 KiB
HTML
144 lines
6.8 KiB
HTML
{{ define "helm-metadata" }}
|
|
{{/*
|
|
Renders parsed Chart.yaml metadata as a description list. Expects a
|
|
HelmChartMeta value. Rows are skipped silently when fields are empty so
|
|
sparse charts don't render with a wall of "—" cells.
|
|
*/}}
|
|
<div class="card bg-base-200 shadow-sm border border-base-300 p-6 space-y-4 min-w-0">
|
|
{{/* Deprecation leads the card: it changes whether you should use the
|
|
chart at all, so it has to be readable before the description.
|
|
The digest page also renders a small chip in its header; that one
|
|
is a scannable status label, this one carries the explanation. */}}
|
|
{{ template "helm-deprecation-notice" . }}
|
|
|
|
{{ if .Description }}
|
|
<div>
|
|
<h2 class="text-sm font-semibold uppercase tracking-wider text-base-content/70 mb-2">Description</h2>
|
|
<p class="text-sm leading-relaxed">{{ .Description }}</p>
|
|
</div>
|
|
{{ end }}
|
|
|
|
<dl class="grid grid-cols-[max-content_1fr] gap-x-6 gap-y-2 text-sm">
|
|
{{ if .Type }}
|
|
<dt class="font-medium text-base-content/70">Type</dt>
|
|
<dd>{{ .Type }}</dd>
|
|
{{ end }}
|
|
{{ if .AppVersion }}
|
|
<dt class="font-medium text-base-content/70">App version</dt>
|
|
<dd class="font-mono text-xs">{{ .AppVersion }}</dd>
|
|
{{ end }}
|
|
{{ if .KubeVersion }}
|
|
<dt class="font-medium text-base-content/70">Kube version</dt>
|
|
<dd class="font-mono text-xs">{{ .KubeVersion }}</dd>
|
|
{{ end }}
|
|
{{ if .Home }}
|
|
<dt class="font-medium text-base-content/70">Home</dt>
|
|
<dd class="min-w-0 truncate">
|
|
{{ if or (hasPrefix .Home "http://") (hasPrefix .Home "https://") }}
|
|
<a href="{{ .Home }}" class="link link-primary" rel="noopener noreferrer" title="{{ .Home }}">{{ .Home }}</a>
|
|
{{ else }}
|
|
{{/* Non-http schemes (oci://, etc.) get sanitized to #ZgotmplZ
|
|
in href context. Render as plain text so the user can
|
|
still see and copy the value. */}}
|
|
<code class="font-mono text-xs break-all" title="{{ .Home }}">{{ .Home }}</code>
|
|
{{ end }}
|
|
</dd>
|
|
{{ end }}
|
|
{{ if .Sources }}
|
|
<dt class="font-medium text-base-content/70">Sources</dt>
|
|
<dd class="space-y-1 min-w-0">
|
|
{{ range .Sources }}
|
|
<div class="truncate">
|
|
{{ if or (hasPrefix . "http://") (hasPrefix . "https://") }}
|
|
<a href="{{ . }}" class="link link-primary" rel="noopener noreferrer" title="{{ . }}">{{ . }}</a>
|
|
{{ else }}
|
|
<code class="font-mono text-xs break-all" title="{{ . }}">{{ . }}</code>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
</dd>
|
|
{{ end }}
|
|
{{ if .Keywords }}
|
|
<dt class="font-medium text-base-content/70">Keywords</dt>
|
|
<dd class="flex flex-wrap gap-1">
|
|
{{ range .Keywords }}<span class="badge badge-ghost badge-sm">{{ . }}</span>{{ end }}
|
|
</dd>
|
|
{{ end }}
|
|
{{ if .Maintainers }}
|
|
<dt class="font-medium text-base-content/70">Maintainers</dt>
|
|
<dd class="space-y-1">
|
|
{{ range .Maintainers }}
|
|
<div class="text-sm">
|
|
{{ if and .URL (or (hasPrefix .URL "http://") (hasPrefix .URL "https://")) }}
|
|
<a href="{{ .URL }}" class="link link-primary" rel="noopener noreferrer">{{ if .Name }}{{ .Name }}{{ else }}{{ .URL }}{{ end }}</a>
|
|
{{ else if .Name }}
|
|
{{ .Name }}
|
|
{{ else if .URL }}
|
|
<code class="font-mono text-xs">{{ .URL }}</code>
|
|
{{ end }}
|
|
{{ if .Email }}<span class="text-base-content/60"><{{ .Email }}></span>{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
</dd>
|
|
{{ end }}
|
|
</dl>
|
|
|
|
{{ if .Dependencies }}
|
|
<div class="pt-2 border-t border-base-300">
|
|
<h2 class="text-sm font-semibold uppercase tracking-wider text-base-content/70 mb-2">Dependencies</h2>
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-xs">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Version</th>
|
|
<th>Repository</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range .Dependencies }}
|
|
<tr>
|
|
<td class="font-medium">{{ .Name }}{{ if .Alias }} <span class="text-base-content/60">({{ .Alias }})</span>{{ end }}</td>
|
|
<td class="font-mono text-xs">{{ .Version }}</td>
|
|
<td class="text-xs">
|
|
{{ if .Repository }}
|
|
{{ if or (hasPrefix .Repository "http://") (hasPrefix .Repository "https://") }}
|
|
<a href="{{ .Repository }}" class="link link-primary" rel="noopener noreferrer">{{ .Repository }}</a>
|
|
{{ else }}
|
|
{{/* oci://, file://, etc. — render as code so it's copyable. */}}
|
|
<code class="font-mono break-all">{{ .Repository }}</code>
|
|
{{ end }}
|
|
{{ end }}
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{ define "helm-deprecation-notice" }}
|
|
{{/*
|
|
The deprecation callout, shared so the repo page's Overview tab and the
|
|
Chart tab say the same thing in the same voice. Expects a
|
|
*HelmChartMeta, which may be nil (hold unreachable, or config blob
|
|
unparseable) — a nil or non-deprecated chart renders nothing at all,
|
|
which is what lets the Overview tab's placeholder swap itself away.
|
|
|
|
No margin classes here: both call sites drop this into a space-y-4
|
|
stack as the first child, so spacing comes from the parent.
|
|
*/}}
|
|
{{- if . }}{{ if .Deprecated }}
|
|
<div class="alert alert-warning" role="status">
|
|
{{ icon "alert-triangle" "size-5 shrink-0" }}
|
|
<div>
|
|
<p class="font-medium">This chart is deprecated</p>
|
|
<p class="text-sm">The maintainers marked it deprecated in Chart.yaml. It may not get further updates or fixes.</p>
|
|
</div>
|
|
</div>
|
|
{{ end }}{{ end -}}
|
|
{{ end }}
|