Catalogue: deployed API-reference import, chained into the rebuild - #227
Merged
Conversation
Discover's API tile projects from SapApiReference, and that table was only ever writable by `pnpm sap:catalog:import` - a laptop holding the production DATABASE_URL. A deployment whose reference predated product tags could never surface private-edition or SuccessFactors APIs: the hub-content Rebuild re-projects faithfully but had nothing multi-product to project FROM. Every other content type gained a deployed import path; the one the API tile depends on did not. - The pure normalization (normalizeRow, parseJson, normalizeStatus, normalizeApiType, NormalizedApi) moves to src/lib/sap-public/api-reference-import.ts; the script re-exports from it, so the row a laptop writes and the row the route writes are the same row - the edition-tags extraction's precedent, for the same reason. - POST /api/sap/tdd/hub-content/api-reference-import: admin-gated, typed confirmation phrase, fetched at request time from the repository at the PINNED DEPLOYED COMMIT (refused without a SHA - hub-harvest-remote's discipline, reused), chunked and resumable (~4,600 rows), idempotent upserts by apiId, editions derived from product tags by the shared classifier, apiType preserved when the file declares none, append-only audited. - Catalogue Health gains "Import API reference + rebuild": drives the chunk loop to completion, then chains the hub-content rebuild automatically - a refreshed reference without a re-projection would leave the screen unchanged and the operator concluding the import did nothing. - The capabilities route's "no probeable services" note now points at the screen first, the local script second. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEq89i8SZpWXPbDXoaRvX8
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ib823
marked this pull request as ready for review
August 6, 2026 06:36
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.
Follow-up to #226, closing the one data gap it left visible on production: Discover's API tile shows 0 for private-cloud and SuccessFactors connections, because
SapApiReference— the table the API slice projects from — was only ever writable by the localpnpm sap:catalog:importscript, and production's copy predates product tags. The rebuild re-projects faithfully but had nothing multi-product to project from.What this adds
scripts/import-sap-api-catalog.ts(normalizeRow,parseJson,normalizeStatus,normalizeApiType) moves tosrc/lib/sap-public/api-reference-import.ts; the script re-exports it, so the laptop path and the deployed path write identical rows (theedition-tagsextraction's precedent).POST /api/sap/tdd/hub-content/api-reference-import: admin-gated, typed confirmation phrase, fetches the committedsap-references/api-hub-catalog.jsonfrom the repository at the pinned deployed commit (refused without a SHA — reusinghub-harvest-remote's source resolution), chunked and resumable (~4,600 rows), idempotent upserts byapiId, editions derived from product tags by the shared classifier,apiTypepreserved when the file declares none, append-only audited.After merge, on production
Operations → Catalogue health → type the confirmation phrase → Import API reference + rebuild. The API tile then populates for private-cloud and SuccessFactors connections.
No schema changes. Full gate green: typecheck:strict, lint:strict, 317 files / 4,738 tests,
next buildvia pre-push.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEq89i8SZpWXPbDXoaRvX8
Generated by Claude Code