You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kg: refactor published-concepts-query.js to SELECT.from(PublishedConcepts) #684
Follow-up from PR #679 (Phase 3 Track 3-A, code-review finding).
Context
srv/lib/published-concepts-query.js currently selects from Concepts directly with the publish gate (publishedAt IS NOT NULL AND status='ACTIVE') inlined into the WHERE clause:
The same predicate is declared by the PublishedConcepts CDS view in srv/knowledge-graph-service.cds. This is functionally correct but duplicates the gate predicate in two places. The view exists primarily as an admin-readable surface but the runtime helper duplicates it.
Change
Switch the helper to read from PublishedConcepts:
const{ PublishedConcepts }=entities('com.sap.developers.ims')// adjust namespace if neededconstpublished=awaitdb.run(SELECT.from(PublishedConcepts).columns('ID','slug','name','description').orderBy('slug'))
Validate that:
The existing unit tests in test/unit/srv/published-concepts-query.test.js still pass.
The unit-test fixture's in-memory SQLite deploy actually surfaces PublishedConcepts (CDS views may behave differently in SQLite vs HANA — verify the test setup deploys it).
Acceptance
Helper selects from PublishedConcepts (no WHERE clause needed).
All 7 unit tests in published-concepts-query.test.js still pass.
Single source of truth for the publish gate: the CDS view definition.
Activity