Skip to content

PSL-3700: List schemas for SCHEMA_REFERENCE variable assignments - #457

Merged
Buqeta (Buqeta) merged 11 commits into
mainfrom
psl-3700
Nov 6, 2026
Merged

Buqeta (Buqeta) merged 11 commits into
mainfrom
psl-3700

Conversation

@Buqeta

@Buqeta Buqeta (Buqeta) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds SCHEMA_REFERENCE to content-cli list assignments, so Team-to-Team Copy (T2TC) can offer target-team schemas when mapping Context Model schema variables. The list follows the Context Model schema picker in ems-frontend (loadSchemaCatalog), using only existing Integration endpoints:

  1. GET /integration/api/pools: pools the caller is admin of (ADMIN in permissions).
  2. GET /integration/api/pools/{poolId}/data-sources/slim-overview per admin pool, 4 in parallel.
  • Pools whose slim overview entries report a pool provider other than Storium (primaryPoolProviderType / secondaryPoolProviderType) are left out, as Context Models read through Storium. A pool whose entries carry no pool provider types is kept, so no extra request is needed.
  • Per pool, an exact copy of the picker's toSchemaOptions and creation-mode sortSchemaOptions (T2TC has no hosting pool):
    • the global schema (Global schema) plus one schema per slim overview entry (targetSchemaName, or <poolId>_<dataSourceId>), including the virtual global (Global Data Connection) and OCDM (Objects and events) entries from celonis/cloud-integration#11993. Like the picker, the pool's global schema is therefore listed twice.
    • only schemas named <poolId> or <poolId>_...; custom targetSchemaName schemas and the legacy business_graph_schema_<tenantId> are left out.
    • schemas shared with managed data sources (pig, context-model, context-model-semantic) are left out.
    • sorted by pool name, then schema name.
  • Value = technical schema name, name = <pool name> / <label>.
  • The SCHEMA_REFERENCE logic lives in its own file, api/schema-reference-candidates.ts, so it can be replaced later. VariableAssignmentApi gets an optional loadCandidates hook for this multi-request list. Other types still make a single GET, including defaultParams from main.
  • Docs: config-commands.md lists the new type.

To verify: the local run used a personal profile, not the OAuth token CDP uses for the target team. Not yet checked with that token: whether it gets ADMIN in permissions on /integration/api/pools, and whether the gateway allows it to call the slim overview.

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios (unit tests in list-assignments.spec.ts; ran list assignments --type SCHEMA_REFERENCE from a local build against a develop team, which listed the Global schema, Global Data Connection and Objects and events of each pool)
  • I have updated docs if needed

Co-Authored-By: Claude noreply@anthropic.com
Includes-AI-Code: true

Buqeta (Buqeta) and others added 10 commits November 5, 2026 17:01
`list assignments --type SCHEMA_REFERENCE` returns the global schema and
the data connection schemas of every data pool the caller is admin of, so
Team-to-Team Copy can map Context Model schema variables.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
The slim overview returns the PIG data source type as "PIG", so the
managed schema check now ignores case.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
# Conflicts:
#	docs/user-guide/config-commands.md
#	src/commands/configuration-management/interfaces/variable-assignment-apis.constants.ts
#	tests/commands/configuration-management/list-assignments.spec.ts
Context Models read through Storium, so the schema list keeps only pools
whose primary or secondary pool provider is Storium, like the Context Model
schema picker. The engine comes from the slim overview entries; pools
without entries are resolved in batches of 100 through
GET /integration/api/pools/pool-provider-types.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
The slim overview now returns virtual global and OCDM entries. The global
schema is no longer listed twice, and OCDM schemas are left out, as
Package Settings only assigns Data Connection and Global schemas to schema
variables.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
Offers the pool's OCDM schema like the global schema, as the picker does
since the slim overview returns it, and keeps the picker's creation rule
that only schemas named after their pool are offered.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
Lists the virtual global entry next to the picker's own global schema,
matches managed data source types and pool-named schemas the way the
picker does, and sorts by pool name, then schema name.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
Drops the pool-provider-types fallback. A pool is left out only when its
slim overview entries report a pool provider other than Storium; pools
without reported pool provider types are kept.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
Each worker takes the next pool and calls itself again, so the slim
overview requests still run 4 at a time without an await inside a loop.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
@Buqeta
Buqeta (Buqeta) marked this pull request as ready for review November 6, 2026 15:37
@Buqeta
Buqeta (Buqeta) requested a review from a team as a code owner November 6, 2026 15:37
Keeps the schema listing for SCHEMA_REFERENCE in
api/schema-reference-candidates.ts, so it can be replaced on its own
later, and simplifies its docs to every data pool of the team.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@Buqeta
Buqeta (Buqeta) merged commit f325af1 into main Nov 6, 2026
5 checks passed
@Buqeta
Buqeta (Buqeta) deleted the psl-3700 branch November 6, 2026 16:23
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.

2 participants