Skip to content

fix(homepage): boot-seed HomepageShelves; retire seed CSV + manual seed:thirdparty - #2079

Merged
jung-thomas merged 1 commit into
DEVfrom
fix/homepage-shelves-durable-seed
Aug 28, 2026
Merged

fix(homepage): boot-seed HomepageShelves; retire seed CSV + manual seed:thirdparty#2079
jung-thomas merged 1 commit into
DEVfrom
fix/homepage-shelves-durable-seed

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Why

HomepageShelves kept losing its curated/third-party shelf links (Prior Labs, Dremio, Reltio, n8n, Iceberg, Kaggle, Vercel, Hugging Face…) — the recurring "shelf links disappeared" incidents.

Root cause (verified): while the seed CSV lived in db/data, cds build --production compiled it to an .hdbtabledata with include_filter: [], so HDI treated the table as fully tabledata-managed and full-replaced it on every deploy whose CSV hash changed — deleting runtime-seeded rows and admin edits. Commit 1404c4c4 moved the CSV to test/data (which stopped the wipe on PROD, since --production then emits no tabledata) but it never re-seeded the already-lost rows, and the manual npm run seed:thirdparty promotion was DEV/PROD-ambiguous (it followed the CDS binding, so it could silently target the wrong environment).

What

Replace both fragile mechanisms with an idempotent, non-destructive boot seed:

  • srv/lib/homepage/homepage-shelves-defaults.js — single inline canonical baseline (74 SAP entries + 23 third-party links = 97 rows across all 7 verbs). Ships with the srv bundle; no runtime file-read / packaging risk.
  • srv/lib/homepage/seed-homepage-shelves.jsinsert-if-missing on (verb,url), called from cds.on('served') (srv/server.js, mirroring the existing ui-event-saved-queries / ai-grading seed precedents). Never overwrites admin edits, self-heals a deleted baseline row on next restart, fully non-fatal, runs in every profile (cds watch, unit tests, hybrid, production).
  • Retired: test/data/…-HomepageShelves.csv, db/data/staging/homepage-thirdparty.json, scripts/seed-thirdparty.js + its two tests, and the seed:thirdparty npm script (now a helpful error stub pointing at the new path). This also removes the DEV/PROD-ambiguous manual-seed footgun.
  • admin-managed-seed-csvs guard test now asserts the CSV is gone from both data dirs.
  • Docs: new "HomepageShelves seeding" section in docs/developers/architecture/homepage.md.

Guarantees

  • No full-replace ever — HomepageShelves stays admin-managed on HANA (structure-only HDI artifacts, no .hdbtabledata).
  • Admin edits preserved — seed only inserts missing (verb,url) rows.
  • Self-healing — a curated link that goes missing reappears on the next srv restart.

Testing

  • New unit tests: test/unit/homepage/homepage-shelves-defaults.test.js (schema/enum/unique/persona-tag validation of the baseline) and test/unit/homepage/seed-homepage-shelves.test.js (boot-populates third-party, idempotent, non-destructive, self-heals).
  • Existing homepage-seed, homepage-shelves-crud, homepage-link-health and the guard test stay green.
  • Full unit suite: 9078 passed, 0 failures. (17 file-level failures are pre-existing fresh-worktree env gaps — missing frontend deps needing npm run setup, and the generated srv-qa/lib/parsers.bundle.mjs — none related to this change.)

Ops note

PROD HomepageShelves was manually re-seeded and a PROD content rebuild run to restore the links immediately (out of band). Once this ships, the baseline is self-healing on every boot; DEV — which still lacked the rows — will be seeded automatically on next deploy.

…ed:thirdparty

HomepageShelves kept losing its curated/third-party rows (Prior Labs, Dremio,
Reltio, n8n, …) on deploy. Root cause: while the seed CSV lived in db/data it
compiled to an .hdbtabledata with include_filter:[] that HDI full-replaced the
table from on every deploy whose CSV hash changed, wiping runtime-seeded rows
and admin edits. Commit 1404c4c moved the CSV to test/data (stopping the wipe
on PROD) but never re-seeded the lost rows, and the manual `npm run
seed:thirdparty` promotion was DEV/PROD-ambiguous (it followed the CDS binding,
so it could silently target the wrong environment).

Replace both mechanisms with an idempotent, non-destructive boot seed:

- srv/lib/homepage/homepage-shelves-defaults.js — single inline canonical
  baseline (SAP entries + third-party links); ships with the srv bundle, no
  runtime file-read / packaging risk.
- srv/lib/homepage/seed-homepage-shelves.js — insert-if-missing on (verb,url),
  called from cds.on('served'). Never overwrites admin edits, self-heals a
  deleted baseline row on next restart, non-fatal, runs in every profile
  (cds watch, unit tests, hybrid, production).
- Retire test/data seed CSV, db/data/staging/homepage-thirdparty.json,
  scripts/seed-thirdparty.js + its two tests, and the seed:thirdparty npm
  script (now a helpful error stub pointing at the new path).
- admin-managed-seed-csvs guard test asserts the CSV is gone from BOTH data dirs.
- Docs: new "HomepageShelves seeding" section in homepage.md.

Tests: new defaults-validation + seed-behavior unit tests added; homepage-seed,
homepage-shelves-crud, homepage-link-health still green (9078 unit tests pass).
@jung-thomas
jung-thomas merged commit 05d76e1 into DEV Aug 28, 2026
7 checks passed
@jung-thomas
jung-thomas deleted the fix/homepage-shelves-durable-seed branch August 28, 2026 20:52
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