Add image-versions-live shortcode for live version-status data - #5709
Draft
catplat wants to merge 3 commits into
Draft
Add image-versions-live shortcode for live version-status data#5709catplat wants to merge 3 commits into
catplat wants to merge 3 commits into
Conversation
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>
|
Your Upsun Fixed environment has successfully deployed. 🚀 See the site: |
Contributor
There was a problem hiding this comment.
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-liveshortcode that usesresources.GetRemote+transform.Unmarshalto fetch and parse remote image version data. - Implemented filtering by
upsun.internal_statusand 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.
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>
Theosakamg
approved these changes
Aug 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a new Hugo shortcode,
image-versions-live, that fetches an image's version data live frommeta.upsun.comat build time and lists versions matching a given Upsuninternal_status(active,sunset, ordecommissioned).Unlike the existing
image-versionsshortcode, this reads no local data file (shared/data/registry.json) — it querieshttps://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.jsononly trackssupported/deprecatedper image — it has no equivalent to Upsun'sinternal_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 publicmeta.upsun.com/images/:idendpoint already returnsinternal_statustoday, 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/redisconfirmed the endpoint is public and returnsupsun.status/upsun.internal_statusper version.A local Hugo build against a scratch test page rendered:
— 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)
meta.upsun.com. If that endpoint is down or slow during CI, the build could fail or hang, depending on timeout config.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.?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.
redis.mdTest plan
security.httpconfig insites/platform/config/_default/config.yamlpermits theGETrequest tometa.upsun.comin CI (not just locally)hugobuild succeeds with no template errors