#4684·agones

`make feature-shortcode-update` skips non-`.md` files and orphans shortcodes added after their version ships

Author: igoochCreated Aug 12, 2026Updated Sep 16, 2026
Labelskind/cleanupawaiting-maintainer

Problem 1: only .md files are processed

build/scripts/feature-shortcode-update/main.go:45 skips everything else:

go
if d.IsDir() || !strings.HasSuffix(d.Name(), ".md") {
    return nil
}

site/content/en/docs/Reference/agones_crd_api_reference.html lives in the same tree and uses the same shortcodes, so the release-time cleanup never reaches it.

The two-block structure that gen-api-docs.sh maintains is correct during a dev cycle — it re-tags the old publish block as expiryVersion=$VERSION and appends newly-generated content as publishVersion=$VERSION, which is what lets the released site and the dev site render different API docs from one source. But at release the expiryVersion half becomes permanently hidden and should be dropped, the same way it is for .md. It hasn't been:

Tag Shortcodes Lines
v1.57.0 expiryVersion="1.57.0" / publishVersion="1.57.0" 10027
v1.58.0 expiryVersion="1.57.0" / publishVersion="1.57.0" 10027
v1.59.0 expiryVersion="1.59.0" / publishVersion="1.59.0" 9993

Each of those tags ships ~5k lines that render at no version. In #4683 this had to be removed by hand.

Caveat for implementation: gen-api-docs.sh locates its baseline by scanning for the publishVersion shortcode:

bash
awk '/ feature publishVersion/{flag=1;next}/ \/feature/{flag=0}flag' $FILE > $OLD

so the publish wrapper must survive the cleanup, or the generator will rewrite the file and test-gen-api-docs will fail with a misleading "API docs are out of date". Only the expiry block should be removed.

Problem 2: exact version matching orphans late-added shortcodes

The script only removes shortcodes matching the exact -version passed, so a shortcode naming an already-shipped version never matches a future release. Two live examples on main:

File Shortcode Added Version released
site/content/en/docs/Guides/Client SDKs/rust.md 1.52.0 pair 2025-09-10 (#4247) 2025-09-09
site/content/en/docs/Reference/fleetautoscaler.md 1.54.0 pair 2025-12-13 (#4365) 2025-12-02

Both landed after their release had already run the cleanup. They render correctly but are permanent dead markup.

Suggested direction

  • Widen the walk to .html, removing only the expiryVersion block (see caveat above).
  • Resolve every shortcode with a version <= the release version, not just exact matches.
  • Optionally, a CI check flagging shortcodes that name an already-released version.

Constraint

site/content/en/docs/Contribute/documentation-editing-contribution.md contains escaped examples ({{%/* feature publishVersion="1.24.0" */%}}) documenting the shortcode itself. These must not be rewritten.

Files

  • build/scripts/feature-shortcode-update/main.go
  • build/includes/website.mk (feature-shortcode-update, lines 118-120)
  • docs/governance/templates/release_issue.md