Skip to content

Commit 135c2fb

Browse files
fix(service-datasource)!: an object imported from a package's external datasource is saved into that package or its customization package (#30602)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg7tzcrehvbdg7wEixkg22DP)_ domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE Fixes #30469 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — `git grep -n -i -E "datasource (table )?(sync|import)|external object|import_object|customization pair|customization package|\.custom" -- skills` on `8c52a7af` answers lines about overrides, object extensions and the permission-set clone landing in a base's `.custom` package (`skills/objectstack-platform/SKILL.md:128`, `skills/objectstack-data/SKILL.md:366`, `skills/objectstack-automation/SKILL.md:51` and their evals) and the datasources catalog entry (`skills/objectstack-data/SKILL.md:47`); `skills/objectstack-data/rules/datasources.md` names no import. No published sentence says where an imported object is saved or what it is named. ## 维护者速读 - 改了什么:从外部数据源导入的表,现在按数据源归谁来存:Setup 里加的数据源照旧不进包;包声明的数据源,可写包就存进该包,只读的已装包就存进它的定制包 `包名.custom`,并跟着该包导出。只读包下导入的对象名改为定制包前缀,例如 showcase 的 `customers` 从 `showcase_customers` 变成 `showcase_custom_customers`。 - 为什么改:你 14:46Z 裁定 B(裁定记录 6660988968)。之前导入的对象名字说属于某个包,存储却不属于任何包,包导出带不走,换环境就丢。 - 风险与回滚:BREAKING 收窄:只读包数据源上用旧前缀的显式名字现在被拒(提示里给出新名字);墙内形态(group/isolated)下定制包还不存在时导入被拒,提示请平台运营方先建;已导入的旧对象不迁移、不改名,重新导入会得到新名字的对象,旧的由管理员删。回滚即 revert 本 PR。 - 先看:`packages/services/service-datasource/src/plugin.ts`(`resolveImportLanding`:三行归属与墙内分支)、`external-datasource-service.ts`(`importObject` 先定落点、最后才建定制包再保存),再看 `src/__tests__/external-namespace-reads-engine-registry.test.ts` 末尾新增的 describe。 - 两分钟验证:`pnpm --filter @objectstack/service-datasource exec vitest run src/__tests__/external-namespace-reads-engine-registry.test.ts -t "lands in the package of its datasource"`,预期 14 条通过。 - 需要你做的:无,席位落地。ADR-0146 D3「It receives」加一项、D11 加半句仍是你的 Tier H 待办(本 PR 不改 ADR)。 ## What changes Ruling B on where an imported object lives (ruling record 6660988968, maintainer 「同意」), built as the seat fixed it for walled postures. - **Placement follows the datasource's `_packageId`** (`plugin.ts`, new `resolveImportLanding`): - no package, the `sys_metadata` sentinel, or a datasource that cannot be read → a package-less row, as before (ADR-0146 D11). The save request is byte-for-byte the old one (no `packageId` key); - a writable package (the save door's own ADR-0070 predicate, `isWritablePackage` on the `'protocol'` service) → saved into that package, named in its namespace; - a read-only installed base → saved into its customization package `BASE.custom`, named in the pair's namespace. The pair comes from the ensure door (`ensureCustomizationPackage` on the same `'protocol'` service), the only creation path (ADR-0146 D3). - **Ordering in `importObject`.** The landing is resolved first (a landing that cannot be had refuses before any remote introspection); an explicit `name` is judged against the landing's namespace; then the draft; then `prepare` (the ensure door) runs immediately before the save. A refused name, a missing remote table or a refused draft therefore makes no pair and saves nothing. - **Walled postures (`group`, `isolated`).** There the platform operator alone creates a customization package, through the ensure door's HTTP route (ADR-0146 D3, ADR-0131 D3). So the import never creates a pair under a wall: a pair that already exists receives the import; while none does, the import is refused (`400 EXTERNAL_IMPORT_ERROR`, the code the import door answers every refusal with) with a message naming the platform operator and `POST /api/v1/packages/BASE/ensure-customization`. It is never saved package-less instead (ADR-0070 D3). The posture is the `tenancy` service's effective one, through the shared `classifyAdmissionTenancyPosture`. - **A protocol that cannot answer** (no `isWritablePackage` / `ensureCustomizationPackage`) refuses an import over a packaged datasource rather than guessing. - **The draft door is unchanged**: `…/tables/:remote/draft` still names the object in the datasource package's own namespace, because its `*.object.ts` is committed into that package's source. - `ExternalDatasourceServiceConfig` gains the optional `resolveImportLanding`; `persistObject` takes an optional `packageId`; `ImportLanding` is exported. A host that wires no landing keeps the old placement. - Existing package-less imported objects are not migrated or renamed. Re-importing the same table makes a new object under the new name beside the old one; the administrator deletes the old one (pinned on the showcase below). ### The name, measured before it was fixed On a booted showcase at `1fd0c32c` (scratch file, not committed): `ensureCustomizationPackage({ basePackageId: 'com.example.showcase' })` answered `com.example.showcase.custom`, namespace `showcase_custom`. A save of `showcase_customers` into the pair was refused `422 NAMESPACE_PREFIX` ("Rename it to 'showcase_custom_showcase_customers'"); `showcase_custom_customers` was saved, listed with `_packageId: com.example.showcase.custom`, and carried by `GET /packages/com.example.showcase.custom/export` and `GET /packages/export`. The pair does not share the base's namespace at the save door, so the name is `BASE_NS_custom_TABLE`. ## Tests - **Unit** (`external-namespace-reads-engine-registry.test.ts`, new top-level `describe('[#30469 item 2] an import lands in the package of its datasource')`, 14 cases): package-less and `sys_metadata` controls; writable package; read-only base → ensure then save into the pair, in that order; an explicit base-namespace name refused with the validator's message for the pair, before the pair and before introspection; a missing remote table makes no pair; an ensure refusal refuses the import and saves nothing; for `group` and `isolated`, the import never creates the pair and refuses naming the platform operator, and an existing pair receives the import; `single` control; a protocol without the landing doors refuses; the draft door keeps the base namespace. Four existing cases in the same file now give their protocol fake the writability answer. - **Showcase** (`external-import-code-datasource-namespace.dogfood.test.ts`): an import with no name lands as `showcase_custom_customers` in `com.example.showcase.custom`, both exports carry it, its rows read, and a package-less `showcase_customers` saved before stays `sys_metadata` and outside the pair's export; a new top-level `describe` boots under `group` (`multiTenant: 'posture-only'`) and pins the refusal (nothing saved, no pair), then the operator's ensure door, then the import landing in the pair. - Four more showcase files import over `showcase_external` under explicit names; their names now carry `showcase_custom_` (`external-federation-read-capability`, `external-import-destructive-remedy`, `external-import-saves-like-meta` (cold boot), `external-validate-sees-runtime-save`). All five files: 24/24 + the new cases green. - **Red on the base `898145b6`** (source restored to the base, tests kept): unit 10 failed / 15 passed of the file's 25 (the 10 non-control new cases; the 4 new controls and the 11 older cases pass); showcase 4 failed / 7 passed (`expected 'showcase_customers' to be 'showcase_custom_customers'`; the walled import answered `201` where `400` is pinned). - **Ablation** (once, `scripts/ablation-replace.mjs`): the walled condition replaced by `false` (anchor ×1 → ×0, marker ×0 → ×1) → the four walled cases red (`Tests 4 failed | 21 passed`); restored blob `09eaac88` = HEAD, `git diff HEAD` empty. ## Acceptance notes - The import's object label is `toLabel(name)`, unchanged, so an import over a read-only base now reads `Showcase Custom Customers`. The label rule is not touched here. - The ensure door's own refusals (a base with no namespace, a non-SemVer version) reach the import caller as the import door's `400 EXTERNAL_IMPORT_ERROR` with the door's sentence; nothing is saved. - ADR-0146 text (D3 "It receives" gains imports over the base's datasource; D11 "environment metadata" gains imports over a Setup-added datasource) is the maintainer's Tier H todo and is not edited here. ## Verification <details><summary>Package suite and typecheck</summary> On `8c52a7af` (after the `origin/main` merge; the one later commit `100d47a7` rewords a comment in `plugin.ts`): `pnpm --filter @objectstack/service-datasource run typecheck` exit 0; `vitest run --maxWorkers=2`: Test Files 72 passed (72), Tests 1205 passed (1205). </details> <details><summary>Full dogfood battery (BREAKING narrowing)</summary> `pnpm --filter @objectstack/dogfood test` under the verify lock on `8c52a7af` with the closure built: Test Files 420 passed, 3 skipped (423); Tests 3500 passed, 36 skipped (3536); `VERDICT command-exit 0`. The tree differs from the head `100d47a7` by one comment in `plugin.ts`. </details> <details><summary>Derived gates (head 100d47a)</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 66 commands at `100d47a7`; each ran with its exit code recorded before any pipe; `--ran`: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN, every exit 0. `pnpm lint` exit 0. `node scripts/pm/check-governed-merges.mjs --test` on the final file list: 0 of 10 paths governed, 667 changed lines. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CbDkdjhP7yRbNoEsZu)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 25fea77 commit 135c2fb

10 files changed

Lines changed: 628 additions & 37 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/service-datasource': patch
3+
---
4+
5+
fix(service-datasource)!: an object imported from a package's external datasource is saved into that package, or into its customization package
6+
7+
Clause-②: yes (narrowing) — `POST /api/v1/datasources/:name/external/tables/:remote/import` (and the MCP `import_object` tool) now saves the object into the package that declares the datasource, or into that package's customization package `<base>.custom` when the package is read-only, and names it in that package's namespace. An explicit `name` in the read-only base's own namespace (`showcase_orders` over the showcase's `showcase_external`) is now refused with ADR-0028's message naming the pair-prefixed name (`showcase_custom_orders`); under a walled tenancy posture (`group`, `isolated`) an import that needs a customization package that does not exist yet is refused, naming the platform operator and the ensure door. `ExternalDatasourceServiceConfig` gains the optional `resolveImportLanding`, `persistObject` an optional third `packageId` argument, and the package exports the `ImportLanding` type.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped: the imported object's definition keeps its shape, and the import request and its answer keep theirs. What moves is which package the import door saves the object into and therefore which namespace its name carries; rows already stored are not rewritten, so there is nothing for a migration to rewrite. -->
11+
12+
**BREAKING** accept-set narrowing at the external-datasource import door (`@objectstack/service-datasource`), ruling B on where an imported object lives (ruling record 6660988968).
13+
14+
- **Where an import lands.** The datasource's owning package decides. A datasource no package declares (added in Setup) keeps today's answer: a package-less row, environment metadata that no package export carries (ADR-0146 D11). A datasource declared by a writable package saves the object into that package. A datasource declared by a read-only installed package (a booted code package or a marketplace install) saves it into that package's customization package `<base>.custom`, which the import obtains from the ensure door first (ADR-0146 D2/D3), so `os package export` and `GET /api/v1/packages/<base>.custom/export` carry it.
15+
- **The name it gets.** The save door judges the name against the package written into, so an import over a read-only package's datasource is named in the pair's namespace: the showcase's `customers` table imports as `showcase_custom_customers`, where it imported as `showcase_customers`. The draft door (`…/tables/:remote/draft`, the `*.object.ts` an author commits into the package's own source) still names it in the datasource package's namespace.
16+
- **Walled postures.** Under `group` and `isolated` the platform operator alone creates a customization package. The import never creates it: it saves into one that already exists, and while none does it is refused (`400 EXTERNAL_IMPORT_ERROR`) with a message naming the platform operator and `POST /api/v1/packages/<base>/ensure-customization`. It is never saved package-less instead.
17+
- **Objects imported before this release** stay where they are, package-less and under their old names. Importing the same table again makes a second object under the new name in the customization package; delete the old one once nothing points at it.

‎packages/qa/dogfood/test/external-federation-read-capability.dogfood.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ const WRITE_ONLY = 'federation-write-only@verify.test';
5353
const BOTH = 'federation-read-write@verify.test';
5454

5555
/**
56-
* Object names the two imports ask for — prefixed with the showcase namespace,
57-
* which an import over `showcase_external` is held to.
56+
* Object names the two imports ask for — prefixed with the namespace of the
57+
* showcase's customization package, which an import over `showcase_external`
58+
* lands in (#30469 item 2).
5859
*/
59-
const REFUSED_IMPORT = 'showcase_fed_refused_cust';
60-
const SERVED_IMPORT = 'showcase_fed_served_cust';
60+
const REFUSED_IMPORT = 'showcase_custom_fed_refused_cust';
61+
const SERVED_IMPORT = 'showcase_custom_fed_served_cust';
6162

6263
const errorOf = (json: any) => {
6364
const e = json?.error;

‎packages/qa/dogfood/test/external-import-code-datasource-namespace.dogfood.test.ts‎

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
// refusing edits to a code-defined datasource and lists it as before, and
2929
// validate and the existing federated objects answer as before.
3030
//
31+
// [#30469 item 2, ruling B] The showcase package is read-only, so an import
32+
// over its datasource is SAVED into its customization package
33+
// `com.example.showcase.custom` and named in that package's namespace
34+
// (`showcase_custom`); the draft door keeps the showcase's own. The last case
35+
// of the first block pins the landing, the pair's export and an older
36+
// package-less import left where it was; the second block pins that under a
37+
// walled posture the import never creates the pair.
38+
//
3139
// The verify harness does not mount the federation service, so this file
3240
// mounts `ExternalDatasourceServicePlugin` itself, as `objectstack dev` and
3341
// `serve` do. The working directory is a temporary one because the showcase's
@@ -47,9 +55,19 @@ const DATASOURCE = 'showcase_external';
4755
/** The package that declares it, and that package's ADR-0028 namespace. */
4856
const PACKAGE_ID = 'com.example.showcase';
4957
const NAMESPACE = 'showcase';
58+
/**
59+
* [#30469 item 2] The package an import over it is SAVED into: the showcase is
60+
* read-only, so its customization package, whose namespace is the import's.
61+
*/
62+
const IMPORT_NAMESPACE = 'showcase_custom';
63+
const PAIR_ID = `${PACKAGE_ID}.custom`;
64+
/** The object an import of `customers` with no name override makes there. */
65+
const LANDED = `${IMPORT_NAMESPACE}_customers`;
66+
/** The name that import used to get, as a package-less row: what a deployment already holds. */
67+
const LEGACY = `${NAMESPACE}_customers`;
5068
/** An explicit import name with no namespace prefix: the defect's shape. */
5169
const UNPREFIXED = 'dogfood_ext_order_21889';
52-
const PREFIXED = `${NAMESPACE}_${UNPREFIXED}`;
70+
const PREFIXED = `${IMPORT_NAMESPACE}_${UNPREFIXED}`;
5371

5472
const ext = `/datasources/${DATASOURCE}/external`;
5573

@@ -175,4 +193,122 @@ describe('an import over a code-defined datasource is held to its package\'s nam
175193
expect(entry).toMatchObject({ origin: 'code', label: 'External Analytics (SQLite)' });
176194
expect(entry).not.toHaveProperty('_packageId');
177195
});
196+
197+
// [#30469 item 2, ruling B] The showcase package is read-only (a booted code
198+
// package), so an object imported over the datasource it declares is saved
199+
// into its customization package, and travels with that package's export.
200+
it('an import with no name lands in the showcase\'s customization package, and the package export carries it', async () => {
201+
// An object imported before the placement changed: package-less, under the
202+
// base-namespace name, bound to the same remote table. It is not moved or
203+
// renamed, and importing the table again makes the new object beside it.
204+
const legacy = await call('PUT', `/meta/object/${LEGACY}`, {
205+
name: LEGACY,
206+
label: 'Legacy Customers',
207+
datasource: DATASOURCE,
208+
external: { remoteName: 'customers' },
209+
fields: { name: { type: 'text', label: 'Name' } },
210+
sharingModel: 'public_read',
211+
});
212+
expect(legacy.status, JSON.stringify(legacy.json)).toBe(200);
213+
214+
const imported = await call('POST', `${ext}/tables/customers/import`, {});
215+
expect(imported.status, JSON.stringify(imported.json)).toBe(201);
216+
expect((imported.json.data as { object?: { name?: string } }).object?.name).toBe(LANDED);
217+
218+
const listed = await call('GET', '/meta/object');
219+
const items = (listed.json as { data?: unknown; items?: unknown }).data ?? (listed.json as { items?: unknown }).items;
220+
const entry = (Array.isArray(items) ? items : (items as { items?: unknown[] })?.items ?? [])
221+
.find((i) => (i as { name?: string }).name === LANDED) as { _packageId?: string } | undefined;
222+
expect(entry?._packageId).toBe(PAIR_ID);
223+
224+
const pairExport = await call('GET', `/packages/${PAIR_ID}/export`);
225+
expect(pairExport.status, JSON.stringify(pairExport.json)).toBe(200);
226+
expect(JSON.stringify(pairExport.json)).toContain(`"${LANDED}"`);
227+
228+
const whole = await call('GET', '/packages/export');
229+
expect(whole.status, JSON.stringify(whole.json)).toBe(200);
230+
expect(JSON.stringify(whole.json)).toContain(`"${LANDED}"`);
231+
232+
const rows = await call('GET', `/data/${LANDED}`);
233+
expect(rows.status, JSON.stringify(rows.json)).toBe(200);
234+
expect(rows.json.records?.length).toBeGreaterThan(0);
235+
236+
const kept = (Array.isArray(items) ? items : (items as { items?: unknown[] })?.items ?? [])
237+
.find((i) => (i as { name?: string }).name === LEGACY) as { _packageId?: string } | undefined;
238+
expect(kept?._packageId).toBe('sys_metadata');
239+
expect(JSON.stringify(pairExport.json)).not.toContain(`"${LEGACY}"`);
240+
});
241+
});
242+
243+
// [#30469 item 2, ruling B] Under a walled posture the platform operator
244+
// creates a customization package, through its ensure door (ADR-0146 D3,
245+
// ADR-0131 D3). The import never creates one: while the pair is absent the
246+
// import is refused, naming the operator and that door, and nothing is saved
247+
// anywhere; once the pair exists the import lands in it.
248+
describe('group: an import never creates the customization package (showcase)', () => {
249+
let stack: VerifyStack;
250+
let token: string;
251+
let prevCwd: string;
252+
let dir: string;
253+
const previous = process.env.OS_TENANCY_POSTURE;
254+
255+
const call = async (method: string, path: string, body?: unknown) => {
256+
const res = await stack.apiAs(token, method, path, body);
257+
const json = (await res.json().catch(() => ({}))) as Envelope;
258+
return { status: res.status, json };
259+
};
260+
261+
beforeAll(async () => {
262+
prevCwd = process.cwd();
263+
dir = mkdtempSync(join(tmpdir(), 'dogfood-30469-'));
264+
process.chdir(dir);
265+
process.env.OS_TENANCY_POSTURE = 'group';
266+
await onEnable({ logger: { info() {}, warn() {} } } as never);
267+
stack = await bootShowcase({
268+
databaseFile: join(dir, 'showcase.db'),
269+
multiTenant: 'posture-only',
270+
extraPlugins: [new ExternalDatasourceServicePlugin()],
271+
});
272+
// The seeded administrator is the platform operator on this harness.
273+
token = await stack.signIn();
274+
}, 180_000);
275+
276+
afterAll(async () => {
277+
await stack?.stop();
278+
if (previous === undefined) delete process.env.OS_TENANCY_POSTURE;
279+
else process.env.OS_TENANCY_POSTURE = previous;
280+
if (prevCwd) process.chdir(prevCwd);
281+
if (dir) rmSync(dir, { recursive: true, force: true });
282+
});
283+
284+
it('guard the guard: a real, non-degraded walled posture', async () => {
285+
const tenancy = await stack.kernel.getServiceAsync<{ posture: string; degraded: boolean }>('tenancy');
286+
expect(tenancy.posture).toBe('group');
287+
expect(tenancy.degraded).toBe(false);
288+
});
289+
290+
it('with no pair, the import is refused naming the platform operator and the ensure door, and nothing is saved', async () => {
291+
const refused = await call('POST', `${ext}/tables/customers/import`, {});
292+
293+
expect(refused.status, JSON.stringify(refused.json)).toBe(400);
294+
expect(refused.json.error?.code).toBe('EXTERNAL_IMPORT_ERROR');
295+
expect(refused.json.error?.message).toContain('platform operator');
296+
expect(refused.json.error?.message).toContain(`/packages/${PACKAGE_ID}/ensure-customization`);
297+
298+
expect((await call('GET', `/meta/object/${LANDED}`)).status).toBe(404);
299+
expect((await call('GET', '/meta/object/showcase_customers')).status).toBe(404);
300+
expect((await call('GET', `/packages/${PAIR_ID}`)).status).toBe(404);
301+
});
302+
303+
it('once the operator has created the pair through its door, the import lands in it', async () => {
304+
const ensured = await call('POST', `/packages/${PACKAGE_ID}/ensure-customization`, {});
305+
expect(ensured.status, JSON.stringify(ensured.json)).toBe(201);
306+
307+
const imported = await call('POST', `${ext}/tables/customers/import`, {});
308+
expect(imported.status, JSON.stringify(imported.json)).toBe(201);
309+
expect((imported.json.data as { object?: { name?: string } }).object?.name).toBe(LANDED);
310+
311+
const pairExport = await call('GET', `/packages/${PAIR_ID}/export`);
312+
expect(JSON.stringify(pairExport.json)).toContain(`"${LANDED}"`);
313+
});
178314
});

‎packages/qa/dogfood/test/external-import-destructive-remedy.dogfood.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
//
3434
// [#21889] Both imported names carry the showcase's ADR-0028 prefix:
3535
// `showcase_external` is declared by the showcase package (namespace
36-
// `showcase`), so an import over it is held to that namespace.
36+
// `showcase`), so an import over it is held to that namespace. [#30469 item 2]
37+
// That package is read-only, so the import lands in its customization package
38+
// `com.example.showcase.custom`, whose namespace is `showcase_custom`.
3739

3840
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
3941
import showcaseStack, { onEnable } from '@objectstack/example-showcase';
@@ -48,9 +50,9 @@ import { join } from 'node:path';
4850
const DATASOURCE = 'showcase_external';
4951
const REMOTE = 'customers';
5052
/** The object the first import creates and the re-import would shrink. */
51-
const NAME = 'showcase_dogfood_ext_cust_21841';
53+
const NAME = 'showcase_custom_dogfood_ext_cust_21841';
5254
/** The remedy's "new `name`". */
53-
const NEW_NAME = 'showcase_dogfood_ext_cust_21841_v2';
55+
const NEW_NAME = 'showcase_custom_dogfood_ext_cust_21841_v2';
5456
/** The column the re-import leaves out, so the stored object would lose its field. */
5557
const DROPPED = 'region';
5658
/** The re-import's options: the same table, one column fewer. */

‎packages/qa/dogfood/test/external-import-saves-like-meta.dogfood.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
// shape this file's control first pinned, an object named exactly as its
3939
// remote table (`orders`), which the namespace now refuses; the control imports
4040
// with no `name` override instead, under the prefixed name the draft derives.
41+
// [#30469 item 2] The showcase package is read-only, so both imports land in
42+
// its customization package and carry that package's namespace,
43+
// `showcase_custom`.
4144

4245
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
4346
import showcaseStack, { onEnable } from '@objectstack/example-showcase';
@@ -51,9 +54,9 @@ import { join } from 'node:path';
5154
/** The showcase's external datasource and its two remote tables (`external-fixture.ts`). */
5255
const DATASOURCE = 'showcase_external';
5356
/** Imported under a name that differs from its remote table — the defect's shape. */
54-
const RENAMED = 'showcase_dogfood_ext_cust_21788';
57+
const RENAMED = 'showcase_custom_dogfood_ext_cust_21788';
5558
/** Imported with no `name` override: the draft's name, the remote table's prefixed with the namespace. */
56-
const DERIVED = 'showcase_orders';
59+
const DERIVED = 'showcase_custom_orders';
5760

5861
const importPath = (remote: string) => `/datasources/${DATASOURCE}/external/tables/${remote}/import`;
5962

‎packages/qa/dogfood/test/external-validate-sees-runtime-save.dogfood.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ const SAVED = 'dogfood_ext_cust_21842';
5050
/** A column the saved object declares and the remote `customers` table does not have. */
5151
const MISSING = 'loyalty_tier';
5252
/** Imported at runtime from the remote `orders` table. */
53-
// [#21889] Prefixed: an import over `showcase_external` is held to the showcase package's namespace.
54-
const IMPORTED = 'showcase_dogfood_ext_ord_21842';
53+
// [#21889] Prefixed: an import over `showcase_external` is held to the namespace of the package it
54+
// lands in, the showcase's customization package (`showcase_custom`, #30469 item 2).
55+
const IMPORTED = 'showcase_custom_dogfood_ext_ord_21842';
5556

5657
const validatePath = `/datasources/${DATASOURCE}/external/validate`;
5758

0 commit comments

Comments
 (0)