feat: select the TechLog Studio adapter from runtime configuration
Adds TECH_LOG_STUDIO_SOURCE (MOCK | HTTP, default MOCK) to the V2 runtime
config schema so a build can switch createTechLogFeatureInstalledInput
between the mock and HTTP Studio gateways without a rebuild. V1 documents
predate the key and always normalize to MOCK. The HTTP gateway is
constructed with only { operations } per Task 4's actual signature -
no CSRF provider is wired here; that lands with attachCredentials at a
later composition-root task.
Updates every existing Studio test call site to the new required
createTechLogFeatureInstalledInput(context) signature via a shared
tests/helpers/studio-install-context.ts MOCK fixture, so the whole
existing Studio suite keeps exercising the mock adapter unchanged.
This commit is contained in:
@@ -46,6 +46,7 @@ const runtime: Parameters<typeof loadReleaseManifest>[0] = {
|
||||
OFFLINE_COMMANDS: "DEFAULT",
|
||||
},
|
||||
FEATURE_OVERRIDES: {},
|
||||
TECH_LOG_STUDIO_SOURCE: "MOCK",
|
||||
},
|
||||
configSchema: "V2",
|
||||
validationDurationMs: 0,
|
||||
|
||||
@@ -165,6 +165,36 @@ describe("runtime configuration boundary", () => {
|
||||
expect(result.validationDurationMs).toBe(0);
|
||||
});
|
||||
|
||||
it("accepts TECH_LOG_STUDIO_SOURCE and defaults it to MOCK", () => {
|
||||
const defaulted = validateRuntimeConfig(validConfig);
|
||||
expect(defaulted.success).toBe(true);
|
||||
if (defaulted.success) {
|
||||
expect(defaulted.data.TECH_LOG_STUDIO_SOURCE).toBe("MOCK");
|
||||
}
|
||||
|
||||
const explicit = validateRuntimeConfig({
|
||||
...validConfig,
|
||||
TECH_LOG_STUDIO_SOURCE: "HTTP",
|
||||
});
|
||||
expect(explicit.success).toBe(true);
|
||||
if (explicit.success) {
|
||||
expect(explicit.data.TECH_LOG_STUDIO_SOURCE).toBe("HTTP");
|
||||
}
|
||||
|
||||
expect(
|
||||
validateRuntimeConfig({
|
||||
...validConfig,
|
||||
TECH_LOG_STUDIO_SOURCE: "LIVE",
|
||||
}).success,
|
||||
).toBe(false);
|
||||
|
||||
// A V1 document has no such key; normalization must still land on MOCK.
|
||||
expect(validateRuntimeConfig(validV1Config)).toMatchObject({
|
||||
success: true,
|
||||
data: { TECH_LOG_STUDIO_SOURCE: "MOCK" },
|
||||
});
|
||||
});
|
||||
|
||||
it("returns only safe boot fields on failure", async () => {
|
||||
await expect(
|
||||
loadRuntimeConfig({
|
||||
|
||||
Reference in New Issue
Block a user