@substrat-run/control-plane-api 0.206.0 → 0.208.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +142 -4
- package/dist/api.js.map +1 -1
- package/dist/platform-usage.d.ts +75 -0
- package/dist/platform-usage.d.ts.map +1 -0
- package/dist/platform-usage.js +215 -0
- package/dist/platform-usage.js.map +1 -0
- package/dist/staff-client.d.ts +5 -1
- package/dist/staff-client.d.ts.map +1 -1
- package/dist/staff-client.js +4 -0
- package/dist/staff-client.js.map +1 -1
- package/dist/vertical-client.d.ts +31 -3
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +54 -11
- package/dist/vertical-client.js.map +1 -1
- package/package.json +10 -10
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,kBAAkB,EAAoB,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AACxL,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAE9G,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EA8BL,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,kBAAkB,EAAoB,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AACxL,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAE9G,OAAO,EAAE,IAAI,EAAE,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@@ import { PREVIEW_CONNECTIONS_REFUSAL } from './connection-relay.js';
|
|
|
4
4
|
import { bindingChangeRefusal, bindingOptionsRefusal, connectionBindingOptions, refusesBindingChange } from './connection-binding-options.js';
|
|
5
5
|
import { resolveObservabilityWindow } from './observability-window.js';
|
|
6
6
|
import { Hono } from 'hono';
|
|
7
|
-
import { MARKUP_SEED, MARKUP_SEED_EFFECTIVE_FROM, markupPercentFor, markupRowInput, permissionKey, parseHostname, withLabel, RESERVED_LABEL_SEPARATOR, adminAction, lakeEventsInput, ownerTransferInput, memberInviteInput, memberRoleInput, ASSET_PART_PREFIX, assetHash, STORE_DRIVERS, storeDriverErasesSubjects, storeDriverServesVertical, storeCatalogOperation, storeDriverBasisAdmits, channelName, connectLinkId, connectionActivity, connectionActivitySource, connectionCredential, connectionCertificate, connectionFilter, connectionHealthState, connectionProvider, connectorDispatchKind, PROVISION_SIBLING_KIND, ARCHIVE_SCOPE_KIND, PROVISION_TENANT_KIND, SET_ENTITLEMENTS_KIND, MODEL_USAGE_KIND, SWEEP_RUNS_KIND, toConnectionHealthEntry, CONNECTION_EXPIRY_WARNING_DAYS, CONNECTION_STALE_DAYS, connectionProbe, connectionSendTest, connectionSendTestResult, connectionSenders, createTenantInput, entitlementGrantInput, hostname as hostnameSchema, hostnameRegion, hostnameStatus, identityLink, errorCode, issueStatus, issueStatusInput, FINDINGS_LIMIT_DEFAULT, FINDINGS_LIMIT_MAX, findingCursorOf, findingKind, findingRuleInput, findingStatus, findingStatusInput, listPageQuery, matchesOutboundHost, pageOf, platformRequestFilter, principalId as principalIdSchema, impersonationStamp, promotionAcknowledgement, bindAcknowledgement, rebindAcknowledgement, provisionableJurisdiction, publishVersionInput, queryScopeInput, readScopeTableInput, entityHistoryInput, eventFacetInput, eventCauseInput, eventEffectsInput, invocationEventsInput, deadLettersInput, lifecycleFlowInput, operationSeriesCount, operationSeriesInput, delegatedReadParams, createOrgInput, roleKey as roleKeySchema, peerSwitch, verticalSlug, scopeText, systemSwitch, DEFAULT_DENIAL_LIMIT, DENIAL_LIMIT_MAX, denialGroupBy, registerVerticalInput, platformScriptCollision, platformScriptRefusal, PLATFORM_SCRIPT_NAMES, serviceDimensions, sweepRunKind, sweepRunOutcome, scopeDump, mergeDumpPages, dataSubjectId as dataSubjectIdSchema, scopeId as scopeIdSchema, scopeStatus, requestRollupReading, costRollupReading, costAttribution, cloudflareUsageDay, meterDaysReading, verticalOwnersReading, utcDay, storageShape, surfaceName, modelUsageLine, tenantId as tenantIdSchema, tenantStatus, versionOrigin, z, PROBLEM_CONTENT_TYPE, toProblem, validationIssuesFrom, redrainEventsInput, importCursorMove, importCursorAcknowledgementMissing, REDRAIN_BATCH, migrationsOnTop, substratError, errorCodeOf, envVarSpec, capabilityFilterQuery, capabilityId as capabilityIdSchema, PLATFORM_FEATURES_HEADER, PLATFORM_FEATURE_SCOPE_SWEEPER, PLATFORM_FEATURE_SOURCE_BUILDS, SOCIAL_RELAY_VERTICALS, isVerticalConnectorProvider, previewTag, buildPreviewTagPrefix, } from '@substrat-run/contracts';
|
|
7
|
+
import { MARKUP_SEED, MARKUP_SEED_EFFECTIVE_FROM, markupPercentFor, markupRowInput, permissionKey, parseHostname, withLabel, RESERVED_LABEL_SEPARATOR, adminAction, lakeEventsInput, ownerTransferInput, memberInviteInput, memberRoleInput, ASSET_PART_PREFIX, assetHash, STORE_DRIVERS, storeDriverErasesSubjects, storeDriverServesVertical, storeCatalogOperation, storeDriverBasisAdmits, channelName, connectLinkId, connectionActivity, connectionActivitySource, connectionCredential, connectionCertificate, connectionFilter, connectionHealthState, connectionProvider, connectorDispatchKind, PROVISION_SIBLING_KIND, ARCHIVE_SCOPE_KIND, PROVISION_TENANT_KIND, SET_ENTITLEMENTS_KIND, MODEL_USAGE_KIND, SWEEP_RUNS_KIND, toConnectionHealthEntry, CONNECTION_EXPIRY_WARNING_DAYS, CONNECTION_STALE_DAYS, connectionProbe, connectionSendTest, connectionSendTestResult, connectionSenders, createTenantInput, entitlementGrantInput, hostname as hostnameSchema, hostnameRegion, hostnameStatus, identityLink, errorCode, issueStatus, issueStatusInput, FINDINGS_LIMIT_DEFAULT, FINDINGS_LIMIT_MAX, findingCursorOf, findingKind, findingRuleInput, findingStatus, findingStatusInput, listPageQuery, matchesOutboundHost, pageOf, platformRequestFilter, principalId as principalIdSchema, impersonationStamp, promotionAcknowledgement, bindAcknowledgement, rebindAcknowledgement, provisionableJurisdiction, publishVersionInput, queryScopeInput, readScopeTableInput, entityHistoryInput, eventFacetInput, eventCauseInput, eventEffectsInput, invocationEventsInput, deadLettersInput, lifecycleFlowInput, operationSeriesCount, operationSeriesInput, delegatedReadParams, createOrgInput, roleKey as roleKeySchema, peerSwitch, verticalSlug, scopeText, systemSwitch, DEFAULT_DENIAL_LIMIT, DENIAL_LIMIT_MAX, denialGroupBy, registerVerticalInput, platformScriptCollision, platformScriptRefusal, PLATFORM_SCRIPT_NAMES, serviceDimensions, sweepRunKind, sweepRunOutcome, scopeDump, mergeDumpPages, dataSubjectId as dataSubjectIdSchema, scopeId as scopeIdSchema, scopeDumpSample, scopeStatus, requestRollupReading, costRollupReading, staffPlatformCosts, tenantPlatformUsage, costAttribution, cloudflareUsageDay, meterDaysReading, verticalOwnersReading, utcDay, storageShape, surfaceName, modelUsageLine, tenantId as tenantIdSchema, tenantStatus, versionOrigin, z, PROBLEM_CONTENT_TYPE, toProblem, validationIssuesFrom, redrainEventsInput, importCursorMove, importCursorAcknowledgementMissing, REDRAIN_BATCH, migrationsOnTop, substratError, errorCodeOf, envVarSpec, capabilityFilterQuery, capabilityId as capabilityIdSchema, PLATFORM_FEATURES_HEADER, PLATFORM_FEATURE_SCOPE_SWEEPER, PLATFORM_FEATURE_SOURCE_BUILDS, SOCIAL_RELAY_VERTICALS, isVerticalConnectorProvider, previewTag, buildPreviewTagPrefix, } from '@substrat-run/contracts';
|
|
8
8
|
import { upstreamHandleIn, upstreamReferenceOf, withUpstreamReference } from '@substrat-run/contracts';
|
|
9
9
|
import { mailInAddressAct, mailInStanding } from '@substrat-run/contracts';
|
|
10
10
|
import { ENGINE_ENTITLEMENT_KEYS, bareSlug, declarableEntitlementKey, entitlementNamespaceRefusal, grantableEntitlements } from '@substrat-run/contracts';
|
|
@@ -92,6 +92,7 @@ import { wireSettingsRefusal, wireUploadFor } from './wire-upload.js';
|
|
|
92
92
|
import { parseWireWalkCursor, runWireWalk, WIRE_WALK_LIMIT_DEFAULT, WIRE_WALK_LIMIT_MAX, WIRE_WALK_RELEASE_MAX, } from './wire-walk.js';
|
|
93
93
|
import { wireKeyDropSince, wireReadinessReport, WIRE_READINESS_LIMIT_DEFAULT, WIRE_READINESS_LIMIT_MAX } from './wire-readiness.js';
|
|
94
94
|
import { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, readStoragePage } from './storage-meter.js';
|
|
95
|
+
import { foldStaffPlatformCosts, foldTenantPlatformUsage, PLATFORM_USAGE_DAYS_MAX } from './platform-usage.js';
|
|
95
96
|
import { usageDays, utcDaysBetween } from './metered-usage-days.js';
|
|
96
97
|
import { queryLakeEvents, teamWindowRefusal } from './lake-gateway.js';
|
|
97
98
|
import { LakeQueryError } from './r2-sql-engine.js';
|
|
@@ -556,6 +557,16 @@ const createPreviewBody = z.object({
|
|
|
556
557
|
// never starts one: it answers the copy's progress, finishes it once it is done, or says it is gone.
|
|
557
558
|
// A call after a 202 naming another push's copy (one being finished) is not a poll: it may start its own.
|
|
558
559
|
poll: z.boolean().optional(),
|
|
560
|
+
// #3232: a fork copies a SAMPLE of its source: the newest `sample` rows of each table, among those
|
|
561
|
+
// whose parents it keeps, and the spine that follows them. A fresh fork only: a push to an existing
|
|
562
|
+
// preview carries the preview's own data, whatever it was forked as.
|
|
563
|
+
sample: scopeDumpSample.shape.rows.optional(),
|
|
564
|
+
// #3232: the cost cap. A fresh fork estimates the rows it would copy before it copies anything, and
|
|
565
|
+
// is refused (413, the estimate in the refusal) above `maxRows`.
|
|
566
|
+
maxRows: z.number().int().positive().optional(),
|
|
567
|
+
// #3232: with `maxRows`, a fork over the cap copies a sample of this many rows per table instead of
|
|
568
|
+
// being refused, and is refused only when that sample is over the cap too.
|
|
569
|
+
sampleOverCap: scopeDumpSample.shape.rows.optional(),
|
|
559
570
|
});
|
|
560
571
|
const listRolesQuery = z.object({
|
|
561
572
|
tenantId: tenantIdSchema.optional(),
|
|
@@ -848,6 +859,8 @@ const TENANT_ROUTES = [
|
|
|
848
859
|
{ method: 'DELETE', re: /\/tenants\/[^/]+\/role-assignments$/, pin: 'path' },
|
|
849
860
|
{ method: 'GET', re: /\/tenants\/[^/]+\/entitlements$/, pin: 'path' },
|
|
850
861
|
{ method: 'GET', re: /\/tenants\/[^/]+\/metered-usage$/, pin: 'path' },
|
|
862
|
+
// #3316: the team's platform usage at the platform's price. The handler returns prices only.
|
|
863
|
+
{ method: 'GET', re: /\/tenants\/[^/]+\/platform-usage$/, pin: 'path' },
|
|
851
864
|
// An install's entitlement. The handler narrows WHICH key a tenant credential may
|
|
852
865
|
// grant (`tenantGrantableEntitlement`): the pin alone would let it grant itself any.
|
|
853
866
|
{ method: 'PUT', re: /\/tenants\/[^/]+\/entitlements\/[^/]+$/, pin: 'path' },
|
|
@@ -2386,6 +2399,65 @@ export function createControlPlaneApi(options) {
|
|
|
2386
2399
|
const { recorded } = await admin.recordCostDay(actor, { day: usage.day, attemptedAt: new Date().toISOString(), usage });
|
|
2387
2400
|
return c.json({ day: usage.day, recorded }, 201);
|
|
2388
2401
|
});
|
|
2402
|
+
// Platform usage, priced (#3316): the cost rollup, router requests and stored bytes over a window
|
|
2403
|
+
// of closed UTC days, costed at Cloudflare's list price and priced at the markup schedule. Two
|
|
2404
|
+
// readings of one fold: the tenant's (`/tenants/:tenantId/platform-usage`, price only, never cost
|
|
2405
|
+
// or markup) and staff's (`/meters/platform-costs`, cost, markup and price side by side, plus the
|
|
2406
|
+
// residual no tenant is charged for). `?days=` (1–92, default 30) ending `?until=` (default
|
|
2407
|
+
// yesterday). A day the cost rollup has not read counts nothing, and says so.
|
|
2408
|
+
const platformWindow = (c) => {
|
|
2409
|
+
const yesterday = new Date(Date.now() - 86_400_000).toISOString().slice(0, 10);
|
|
2410
|
+
const q = z
|
|
2411
|
+
.object({
|
|
2412
|
+
days: z.coerce.number().int().min(1).max(PLATFORM_USAGE_DAYS_MAX).default(30),
|
|
2413
|
+
until: utcDay.default(yesterday),
|
|
2414
|
+
})
|
|
2415
|
+
.parse({ days: c.req.query('days') || undefined, until: c.req.query('until') || undefined });
|
|
2416
|
+
if (q.until > yesterday)
|
|
2417
|
+
return refuse(c, 'validation_failed', `${q.until} has not ended`);
|
|
2418
|
+
const since = new Date(Date.parse(`${q.until}T00:00:00Z`) - (q.days - 1) * 86_400_000).toISOString().slice(0, 10);
|
|
2419
|
+
return { since, until: q.until };
|
|
2420
|
+
};
|
|
2421
|
+
const platformUsageInputs = async (admin, actor, window, tenantId) => {
|
|
2422
|
+
// Every source or none: a host without request or storage history would read as zero usage.
|
|
2423
|
+
if (!admin.sumCostDays || !admin.listCostRollupDays || !admin.listRequestDays || !admin.listScopeStorage)
|
|
2424
|
+
return null;
|
|
2425
|
+
const schedule = await markupScheduleFor(admin, actor, tenantId);
|
|
2426
|
+
if (!schedule)
|
|
2427
|
+
return null;
|
|
2428
|
+
const filter = { ...(tenantId ? { tenantId } : {}), ...window };
|
|
2429
|
+
// The day ledger first: a day's marker and its rows commit together, so every day it calls
|
|
2430
|
+
// read has its rows in the totals read after it. Read the other way, a day committed between
|
|
2431
|
+
// the two reads would count as read with no usage.
|
|
2432
|
+
const reads = await admin.listCostRollupDays(actor, window);
|
|
2433
|
+
const [costs, requests, storage] = await Promise.all([
|
|
2434
|
+
admin.sumCostDays(actor, filter),
|
|
2435
|
+
admin.listRequestDays(actor, { ...filter, limit: REQUEST_ROLLUP_LIMIT_MAX }).then((rows) => ({ rows, truncated: rows.length >= REQUEST_ROLLUP_LIMIT_MAX })),
|
|
2436
|
+
admin.listScopeStorage(actor, { ...filter, limit: STORAGE_HISTORY_LIMIT_MAX }).then((rows) => ({ rows, truncated: rows.length >= STORAGE_HISTORY_LIMIT_MAX })),
|
|
2437
|
+
]);
|
|
2438
|
+
return { ...window, readAt: new Date().toISOString(), costs, reads, requests, storage, schedule };
|
|
2439
|
+
};
|
|
2440
|
+
app.get('/tenants/:tenantId/platform-usage', async (c) => {
|
|
2441
|
+
const tenantId = tenantIdSchema.parse(c.req.param('tenantId'));
|
|
2442
|
+
if (outsideTenant(c.get('principal'), tenantId))
|
|
2443
|
+
return refuse(c, 'forbidden', 'forbidden');
|
|
2444
|
+
const window = platformWindow(c);
|
|
2445
|
+
if (window instanceof Response)
|
|
2446
|
+
return window;
|
|
2447
|
+
const inputs = await platformUsageInputs(c.var.admin, c.get('actor'), window, tenantId);
|
|
2448
|
+
if (!inputs)
|
|
2449
|
+
return refuseStatus(c, 501, 'this control plane keeps no Cloudflare cost rollup, request or storage history, or markup schedule');
|
|
2450
|
+
return c.json(tenantPlatformUsage.parse(foldTenantPlatformUsage(inputs, tenantId)));
|
|
2451
|
+
});
|
|
2452
|
+
app.get('/meters/platform-costs', async (c) => {
|
|
2453
|
+
const window = platformWindow(c);
|
|
2454
|
+
if (window instanceof Response)
|
|
2455
|
+
return window;
|
|
2456
|
+
const inputs = await platformUsageInputs(c.var.admin, c.get('actor'), window);
|
|
2457
|
+
if (!inputs)
|
|
2458
|
+
return refuseStatus(c, 501, 'this control plane keeps no Cloudflare cost rollup, request or storage history, or markup schedule');
|
|
2459
|
+
return c.json(staffPlatformCosts.parse(foldStaffPlatformCosts(inputs)));
|
|
2460
|
+
});
|
|
2389
2461
|
// The daily meter snapshot (#2501): meters 1 and 2 as the first scheduled pass of each UTC day
|
|
2390
2462
|
// found them, one row per (day, tenant), and the record of each day in the window. Staff-only
|
|
2391
2463
|
// like `/meters`. A directory read; nothing is recomputed, so a past day reads as it was then.
|
|
@@ -10734,6 +10806,52 @@ export function createControlPlaneApi(options) {
|
|
|
10734
10806
|
const handle = tenant?.slug ?? tenantId;
|
|
10735
10807
|
return `${slug.split('/').at(-1)}-${handle}.${jurisdiction}.${baseDomain}`;
|
|
10736
10808
|
};
|
|
10809
|
+
/** #3232: a sample asked of a scope this control plane holds itself, whose host copies only whole. */
|
|
10810
|
+
const sampleNeedsVertical = (scopeId) => new ControlPlaneError(409, `scope ${scopeId} is held by the control plane's own host, which copies a scope only whole (#3232). Nothing was copied.`);
|
|
10811
|
+
/**
|
|
10812
|
+
* #3232: what a fresh fork copies, decided before it copies anything. With `maxRows`, the copy is
|
|
10813
|
+
* estimated at its source first (rows, per table): at or under the cap it copies as asked, over it
|
|
10814
|
+
* it copies `sampleOverCap` instead when that sample fits, and is otherwise refused (413) with the
|
|
10815
|
+
* estimate, the cap and the largest tables in the refusal. A source that cannot estimate (a
|
|
10816
|
+
* deployment that predates it) is copied as asked, ungated, and the note says so: the size gate
|
|
10817
|
+
* (`COPY_MAX_BYTES`) treats an unknown size the same way.
|
|
10818
|
+
*/
|
|
10819
|
+
const forkCopyPlan = async (c, source, opts) => {
|
|
10820
|
+
const sampleNote = (rows, estimate) => `Data: a sample of production, the newest ${rows} rows of each table and what they reference` +
|
|
10821
|
+
`${estimate === undefined ? '' : ` (about ${estimate} rows)`}, not a whole copy.`;
|
|
10822
|
+
if (opts.maxRows === undefined)
|
|
10823
|
+
return opts.sample === undefined ? { note: null } : { sample: opts.sample, note: sampleNote(opts.sample) };
|
|
10824
|
+
const cap = opts.maxRows;
|
|
10825
|
+
const client = await verticalForScope(c, source);
|
|
10826
|
+
const estimate = (sample) => client ? retryTransient(() => client.estimateScopeCopy(source.id, sample === undefined ? {} : { sample })) : Promise.resolve('predates');
|
|
10827
|
+
const asked = opts.sample;
|
|
10828
|
+
const first = await estimate(asked);
|
|
10829
|
+
if (first === 'predates') {
|
|
10830
|
+
return {
|
|
10831
|
+
...(asked === undefined ? {} : { sample: asked }),
|
|
10832
|
+
note: `Data: the copy could not be estimated (its source predates estimates, #3232), so the --max-rows cap of ${cap} was not applied.`,
|
|
10833
|
+
};
|
|
10834
|
+
}
|
|
10835
|
+
if (first.rows <= cap) {
|
|
10836
|
+
return asked === undefined ? { note: `Data: a whole copy of production, about ${first.rows} rows (cap ${cap}).` } : { sample: asked, note: sampleNote(asked, first.rows) };
|
|
10837
|
+
}
|
|
10838
|
+
const largest = [...first.tables].sort((a, b) => b.rows - a.rows).slice(0, 3).map((t) => `${t.name} ${t.rows}`).join(', ');
|
|
10839
|
+
if (asked === undefined && opts.sampleOverCap !== undefined) {
|
|
10840
|
+
const fallback = await estimate(opts.sampleOverCap);
|
|
10841
|
+
if (fallback !== 'predates' && fallback.rows <= cap) {
|
|
10842
|
+
return {
|
|
10843
|
+
sample: opts.sampleOverCap,
|
|
10844
|
+
note: `${sampleNote(opts.sampleOverCap, fallback.rows)} A whole copy would move about ${first.rows} rows, over the cap of ${cap}.`,
|
|
10845
|
+
};
|
|
10846
|
+
}
|
|
10847
|
+
throw new ControlPlaneError(413, `a copy of scope ${source.id} would move about ${first.rows} rows, and a sample of ${opts.sampleOverCap} rows per table ` +
|
|
10848
|
+
`${fallback === 'predates' ? 'could not be estimated' : `about ${fallback.rows}`}: over the cap of ${cap} rows (--max-rows). ` +
|
|
10849
|
+
`Largest tables: ${largest}. Nothing was copied (#3232). Lower --sample-over-cap, or raise --max-rows.`);
|
|
10850
|
+
}
|
|
10851
|
+
throw new ControlPlaneError(413, `a ${asked === undefined ? 'copy' : `sample of ${asked} rows per table`} of scope ${source.id} would move about ${first.rows} rows, ` +
|
|
10852
|
+
`over the cap of ${cap} rows (--max-rows). Largest tables: ${largest}. Nothing was copied (#3232). ` +
|
|
10853
|
+
(asked === undefined ? 'Pass --sample <n> to copy the newest n rows of each table instead, or raise --max-rows.' : 'Pass a smaller --sample, or raise --max-rows.'));
|
|
10854
|
+
};
|
|
10737
10855
|
const orchestratedPreview = async (c, tenantId, slug,
|
|
10738
10856
|
// A FORK copies this scope's data; `null` provisions an empty clean-room scope (#509 (b)).
|
|
10739
10857
|
source, opts) => {
|
|
@@ -11007,8 +11125,11 @@ export function createControlPlaneApi(options) {
|
|
|
11007
11125
|
'Anyone on the team can, once signed in to Substrat.',
|
|
11008
11126
|
};
|
|
11009
11127
|
};
|
|
11128
|
+
/** #3232: what this create decided to copy, said where the person pushing reads it. */
|
|
11129
|
+
let copyNote = null;
|
|
11010
11130
|
const notesFor = (parent) => parent
|
|
11011
11131
|
? [
|
|
11132
|
+
...(copyNote ? [copyNote] : []),
|
|
11012
11133
|
"Settings: only non-secret Env tab settings explicitly declared for preview carryover are delivered; " +
|
|
11013
11134
|
"other settings use the deployment's defaults.",
|
|
11014
11135
|
]
|
|
@@ -11405,6 +11526,11 @@ export function createControlPlaneApi(options) {
|
|
|
11405
11526
|
],
|
|
11406
11527
|
};
|
|
11407
11528
|
}
|
|
11529
|
+
// #3232: a fresh fork decides what it copies (whole, or a sample) before anything is reaped or
|
|
11530
|
+
// provisioned, so a fork refused for its cost leaves the preview it would replace in place.
|
|
11531
|
+
const copyPlan = source && !poll ? await forkCopyPlan(c, source, opts) : { note: null };
|
|
11532
|
+
copyNote = copyPlan.note;
|
|
11533
|
+
const sampled = copyPlan.sample === undefined ? {} : { sample: copyPlan.sample };
|
|
11408
11534
|
// Free the tag: the slug is unique per tenant and the `--<tag>` hostname is still bound
|
|
11409
11535
|
// to the old row, so the fresh fork below cannot be provisioned until this one is gone.
|
|
11410
11536
|
// A marked row is also the GC sweep's to reap (its `expiresAt` has passed), so the sweep
|
|
@@ -11453,11 +11579,16 @@ export function createControlPlaneApi(options) {
|
|
|
11453
11579
|
// restore blip reloads the same stage and an export fault is not recorded as a restore's.
|
|
11454
11580
|
forkData = sourceClient
|
|
11455
11581
|
? async () => {
|
|
11456
|
-
const moved = await transferScope(sourceClient, target, { from: source.id, to: previewId }, { retry: retryTransient, stamp: false, maxBytes: copyMaxBytes });
|
|
11582
|
+
const moved = await transferScope(sourceClient, target, { from: source.id, to: previewId }, { retry: retryTransient, stamp: false, maxBytes: copyMaxBytes, ...sampled });
|
|
11457
11583
|
refuseWipedSource(moved.meta, source.id);
|
|
11458
11584
|
return moved.dump;
|
|
11459
11585
|
}
|
|
11460
|
-
: async () =>
|
|
11586
|
+
: async () => {
|
|
11587
|
+
// #3232: this control plane's own host copies only whole; a sample asked for is never quietly dropped.
|
|
11588
|
+
if (copyPlan.sample !== undefined)
|
|
11589
|
+
throw sampleNeedsVertical(source.id);
|
|
11590
|
+
return canonical.tables;
|
|
11591
|
+
};
|
|
11461
11592
|
// Directory row FIRST as `provisioning` (K-31 two-phase): a crash before the data
|
|
11462
11593
|
// copy leaves an inert row that — carrying `forkedFrom` + `expiresAt` — the GC sweep
|
|
11463
11594
|
// reaps, never copied data with no record.
|
|
@@ -11533,7 +11664,7 @@ export function createControlPlaneApi(options) {
|
|
|
11533
11664
|
if (forkPaged && jobs && move && targetRef && target) {
|
|
11534
11665
|
// #2450 step 2: the first page moves here. A fork that needs more moves in a job, and a
|
|
11535
11666
|
// later call to this route finishes it (`finishForkJob`); the row stays `provisioning`.
|
|
11536
|
-
const begun = await beginTransfer({ source: forkPaged.source, dest: target }, { from: forkPaged.sourceScopeId, to: previewId }, { retry: retryTransient, stamp: false, alwaysStage: true, maxBytes: copyMaxBytes });
|
|
11667
|
+
const begun = await beginTransfer({ source: forkPaged.source, dest: target }, { from: forkPaged.sourceScopeId, to: previewId }, { retry: retryTransient, stamp: false, alwaysStage: true, maxBytes: copyMaxBytes, ...sampled });
|
|
11537
11668
|
if ('state' in begun) {
|
|
11538
11669
|
const staged = begun.state;
|
|
11539
11670
|
const ends = { source: forkPaged.source, dest: target };
|
|
@@ -11705,6 +11836,13 @@ export function createControlPlaneApi(options) {
|
|
|
11705
11836
|
if (body.seed && !body.empty) {
|
|
11706
11837
|
return refuse(c, 'validation_failed', 'seed needs empty: a sample world is seated only in a clean-room preview');
|
|
11707
11838
|
}
|
|
11839
|
+
// #3232: a sample and a cap shape a FORK's copy; a clean room copies nothing.
|
|
11840
|
+
if (body.empty && (body.sample !== undefined || body.maxRows !== undefined || body.sampleOverCap !== undefined)) {
|
|
11841
|
+
return refuse(c, 'validation_failed', 'sample, maxRows and sampleOverCap shape a fork\'s copy; a clean-room preview copies nothing');
|
|
11842
|
+
}
|
|
11843
|
+
if (body.sampleOverCap !== undefined && (body.maxRows === undefined || body.sample !== undefined)) {
|
|
11844
|
+
return refuse(c, 'validation_failed', 'sampleOverCap needs maxRows, and replaces sample: pass sample to always copy a sample');
|
|
11845
|
+
}
|
|
11708
11846
|
if (body.seed && !options.personaIssuer) {
|
|
11709
11847
|
return refuse(c, 'unavailable', 'this control plane runs no persona issuer, so it cannot sign a seeded preview in');
|
|
11710
11848
|
}
|