Skip to content

feat: add /build/tags tag-taxonomy feed for CI frontmatter validation - #2051

Merged
jung-thomas merged 1 commit into
DEVfrom
feat/build-tags-feed
Aug 27, 2026
Merged

feat: add /build/tags tag-taxonomy feed for CI frontmatter validation#2051
jung-thomas merged 1 commit into
DEVfrom
feat/build-tags-feed

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

What

Adds a build-time tag-taxonomy feed so a downstream CI checker can validate tutorial frontmatter tags against the canonical taxonomy. Mirrors the existing /build/verb-definitions pattern exactly.

Changes

  • srv/server.js — new anonymous app.get('/build/tags', ...) handler alongside the other /build/* handlers. Reads name+label direct from the raw com.sap.developers.ims.Tags entity (NOT via AdminService, whose @requires chain would 403 an anonymous request), orderBy('name'), sets Cache-Control: public, max-age=60, returns { tags: rows.map(r => r.name), buildAt }, 500s on error.
  • scripts/fetch-tags.ts — mirrors scripts/fetch-verb-definitions.ts; fetches ${CAP_BASE_URL||'http://localhost:4004'}/build/tags, writes hugo/data/tags.json ({ tags, buildAt, error }), warn-and-continues on failure.
  • package.json — new fetch-tags npm script; wired into build:all immediately after fetch-verb-definitions.
  • test/unit/srv/build-tags-feed.test.js — unit test mirroring the verb-definitions build test (same cds.test('serve', '--project', '.', '--in-memory') bootstrap): asserts 200 + tags array, 60s Cache-Control, ISO buildAt, and returns the name strings of seeded Tags rows ordered by name.

Verification

npx vitest run test/unit/srv/build-tags-feed.test.js --project unit4/4 passing.

Notes

  • Returns just the array of name strings (the full category>value tag) — all a membership check needs.
  • No hugo/data/tags.json committed; generation is left to the build.

Draft — targeting DEV.

Mirror the existing /build/verb-definitions pattern:
- anonymous app.get('/build/tags') in srv/server.js reads name+label from
  com.sap.developers.ims.Tags ordered by name, 60s Cache-Control, returns
  { tags: [names], buildAt }, 500s on error
- scripts/fetch-tags.ts writes hugo/data/tags.json, warn-and-continue
- wire fetch-tags into build:all next to fetch-verb-definitions
- unit test asserts endpoint returns tags array from seeded rows
@jung-thomas
jung-thomas marked this pull request as ready for review August 27, 2026 14:17
@jung-thomas
jung-thomas merged commit 03fdc86 into DEV Aug 27, 2026
6 checks passed
@jung-thomas
jung-thomas deleted the feat/build-tags-feed branch August 27, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant