Skip to content

Add image-versions-live shortcode for live version-status data - #5709

Draft
catplat wants to merge 3 commits into
mainfrom
infra/image-versions-live-shortcode
Draft

Add image-versions-live shortcode for live version-status data#5709
catplat wants to merge 3 commits into
mainfrom
infra/image-versions-live-shortcode

Conversation

@catplat

@catplat catplat commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a new Hugo shortcode, image-versions-live, that fetches an image's version data live from meta.upsun.com at build time and lists versions matching a given Upsun internal_status (active, sunset, or decommissioned).

Unlike the existing image-versions shortcode, this reads no local data file (shared/data/registry.json) — it queries https://meta.upsun.com/images/<image> directly, so it can serve the Active/Sunset/Decommissioned classification for images the docs registry pipeline doesn't yet track.

No content in this repo calls the shortcode yet. It's added standalone here so it can be reviewed on its own merits, independent of any page that adopts it. See #5710 for the first (and currently only) consumer.

Why a live fetch, not the existing data pipeline

shared/data/registry.json only tracks supported/deprecated per image — it has no equivalent to Upsun's internal_status (active/sunset/decommissioned) field. Getting that data into the static registry would require changes to an external tool (meta-version-updater) that we don't own. The public meta.upsun.com/images/:id endpoint already returns internal_status today, unauthenticated, for every image — so this shortcode reads it directly instead.

Manual verification

This repo has no existing pattern for testing a shortcode in isolation (no exampleSite, no fixture pages), so this was verified manually against real data:

  • curl https://meta.upsun.com/images/redis confirmed the endpoint is public and returns upsun.status/upsun.internal_status per version.

  • A local Hugo build against a scratch test page rendered:

    • Active: 8.8, 8.0, 7.2, 6.2
    • Sunset: 7.0, 6.0, 5.0
    • Decommissioned: 4.0, 3.2, 3.0, 2.8

    — matching the real API data exactly, correctly sorted descending.

  • Cold-cache build adds ~730ms (one live HTTP round trip, deduped across repeated calls to the same URL within a build); warm-cache (Hugo's local resource cache) is ~25ms.

Trade-offs worth knowing about (for reviewers)

  • Build-time network dependency: every build of a page using this shortcode needs network access to meta.upsun.com. If that endpoint is down or slow during CI, the build could fail or hang, depending on timeout config.
  • No PR-review checkpoint for content changes: every other version-status list on this site is git-committed and reviewed via a PR (shared/data/registry.json, refreshed by a daily bot). A page using this shortcode can change its rendered content on every rebuild with no corresponding diff to review.
  • Grid-only: the public API has no per-environment (Grid vs. Dedicated Gen 2/3) breakdown — confirmed by testing ?platform= and ?environment= query params, which are silently ignored. This shortcode can only ever answer for the flat/Grid-equivalent classification.

Merge order

This is the first of three related PRs. Merge this one first — the content PR depends on it.

  1. This PR (infra) — merge first
  2. Serve Redis Grid version statuses live, split out Dedicated Gen 2 #5710 — stacked on this branch, adds the shortcode's first real usage in redis.md
  3. Add runtime/service upgrade guide, de-emphasize Redis as one-off #5711 — independent, no dependency on the other two, can merge any time

Test plan

  • Confirm security.http config in sites/platform/config/_default/config.yaml permits the GET request to meta.upsun.com in CI (not just locally)
  • Local hugo build succeeds with no template errors

Fetches an image's version data live from meta.upsun.com at build time
and lists versions matching a given Upsun internal_status (active,
sunset, or decommissioned). Unlike the existing image-versions
shortcode, this reads no local data file, so it can serve the
Active/Sunset/Decommissioned classification before the docs registry
pipeline tracks it.

Verified against the public API (meta.upsun.com/images/redis) with a
local build: output for status=active/sunset/decommissioned matches
the real data exactly (Active: 8.8, 8.0, 7.2, 6.2; Sunset: 7.0, 6.0,
5.0; Decommissioned: 4.0, 3.2, 3.0, 2.8), sorted correctly. No content
in this repo calls the shortcode yet — it's added here standalone so
it can be reviewed independently of any page that adopts it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Your Upsun Fixed environment has successfully deployed. 🚀

See the site:

@catplat
catplat requested review from Theosakamg and a lite review from Copilot August 14, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new Hugo shortcode, image-versions-live, intended to render Upsun image versions by fetching live version metadata from https://meta.upsun.com/images/<image> at build time, filtering by upsun.internal_status (active/sunset/decommissioned).

Changes:

  • Added image-versions-live shortcode that uses resources.GetRemote + transform.Unmarshal to fetch and parse remote image version data.
  • Implemented filtering by upsun.internal_status and rendering as an HTML list (or “None available” when empty).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread themes/psh-docs/layouts/shortcodes/image-versions-live.html
Comment thread themes/psh-docs/layouts/shortcodes/image-versions-live.html
catplat and others added 2 commits August 17, 2026 13:17
Adds a "Version-status data for runtimes and services" section
explaining the two version-status shortcodes (image-versions vs.
image-versions-live), their data sources, and how the Active/Sunset/
Decommissioned and Supported/Deprecated classifications map to each
other — captured here since it took real investigation this session
(the meta.upsun.com API's status/internal_status fields, its lack of
per-environment data) rather than being obvious from the code.

Also documents the infra-PR-before-content-PR convention under Review
process, since it applied directly to how this shortcode and its first
consumer were split into separate PRs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants