@m8t-stack/cli 0.2.92 → 0.2.95
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/cli.js +77 -11
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1487,7 +1487,7 @@ function installFoundryDnsShim() {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
|
|
1489
1489
|
// src/lib/package-version.ts
|
|
1490
|
-
var CLI_VERSION = "0.2.
|
|
1490
|
+
var CLI_VERSION = "0.2.95";
|
|
1491
1491
|
|
|
1492
1492
|
// src/lib/render-error.ts
|
|
1493
1493
|
init_errors();
|
|
@@ -20983,6 +20983,7 @@ import * as os10 from "os";
|
|
|
20983
20983
|
import * as path26 from "path";
|
|
20984
20984
|
init_errors();
|
|
20985
20985
|
var FOUNDRY_TRACING_MODES = ["project", "account", "skip"];
|
|
20986
|
+
var DEFAULT_FOUNDRY_TRACING = "project";
|
|
20986
20987
|
function parseFoundryTracingMode(v) {
|
|
20987
20988
|
if (v === void 0) return void 0;
|
|
20988
20989
|
if (!FOUNDRY_TRACING_MODES.includes(v)) {
|
|
@@ -24270,10 +24271,10 @@ var PlatformEnableAutoUpdateCommand = class extends M8tCommand {
|
|
|
24270
24271
|
description: "Release-channel URL the updater job polls (bicep default applies when omitted)."
|
|
24271
24272
|
});
|
|
24272
24273
|
location = Option40.String("--location", {
|
|
24273
|
-
description: "Region for the updater identity + job. Defaults to the resource group's existing resources."
|
|
24274
|
+
description: "Region for the updater identity + job. Defaults to this install's stamped region, then to the resource group's existing resources."
|
|
24274
24275
|
});
|
|
24275
24276
|
foundryTracing = Option40.String("--foundry-tracing", {
|
|
24276
|
-
description: "project | account | skip.
|
|
24277
|
+
description: "project | account | skip. Omitting it keeps the value already stamped on this install; only an install with nothing stamped falls through to the default (project)."
|
|
24277
24278
|
});
|
|
24278
24279
|
endpoint = Option40.String("--endpoint", {
|
|
24279
24280
|
description: "Foundry project endpoint URL. Disambiguates the project in a multi-project subscription."
|
|
@@ -24344,7 +24345,8 @@ var PlatformEnableAutoUpdateCommand = class extends M8tCommand {
|
|
|
24344
24345
|
resourceGroup,
|
|
24345
24346
|
subscriptionId
|
|
24346
24347
|
});
|
|
24347
|
-
const
|
|
24348
|
+
const stampedLocation = stampedParams?.bicep.location;
|
|
24349
|
+
const location = typeof this.location === "string" && this.location.length > 0 ? this.location : stampedLocation !== void 0 && stampedLocation.length > 0 ? stampedLocation : (await runAz(["resource", "list", "-g", resourceGroup, "--subscription", subscriptionId, "--query", "[0].location", "-o", "tsv"])).trim();
|
|
24348
24350
|
if (!location) {
|
|
24349
24351
|
throw new LocalCliError({
|
|
24350
24352
|
code: "PLATFORM_ENABLE_AUTO_UPDATE_NO_LOCATION",
|
|
@@ -24352,8 +24354,9 @@ var PlatformEnableAutoUpdateCommand = class extends M8tCommand {
|
|
|
24352
24354
|
});
|
|
24353
24355
|
}
|
|
24354
24356
|
const foundryResourceId = await resolveFoundryResourceId(project.endpoint);
|
|
24355
|
-
const
|
|
24356
|
-
const
|
|
24357
|
+
const resolvedAcrPullIdentity = resolveAcrPullIdentity({});
|
|
24358
|
+
const acrPullIdentityResourceId = resolvedAcrPullIdentity !== "" ? resolvedAcrPullIdentity : stampedParams?.bicep.acrPullIdentityResourceId ?? "";
|
|
24359
|
+
const acrResourceId = await resolveAcrResourceId({ imageRef });
|
|
24357
24360
|
const recoveredParams = {
|
|
24358
24361
|
location,
|
|
24359
24362
|
suffix,
|
|
@@ -24364,8 +24367,49 @@ var PlatformEnableAutoUpdateCommand = class extends M8tCommand {
|
|
|
24364
24367
|
foundryProjectEndpoint: project.endpoint,
|
|
24365
24368
|
acrPullIdentityResourceId,
|
|
24366
24369
|
acrResourceId,
|
|
24367
|
-
|
|
24368
|
-
|
|
24370
|
+
// This row is REPLACED wholesale, so an absent flag must INHERIT the stamped
|
|
24371
|
+
// value rather than drop it. Both optional fields need this, for the same
|
|
24372
|
+
// reason and with the same consequence:
|
|
24373
|
+
//
|
|
24374
|
+
// foundryTracingMode — dropping it re-applied main.bicep's `project`
|
|
24375
|
+
// default, so an install that deliberately opted out of tracing had it
|
|
24376
|
+
// switched back on by an unrelated re-run of this command. That is
|
|
24377
|
+
// exactly the silent posture change we refuse to make for a customer.
|
|
24378
|
+
// channelUrl — dropping it re-applied bicep's empty default, so the
|
|
24379
|
+
// gateway and updater job lost their release channel and the install
|
|
24380
|
+
// silently stopped polling for updates. The field exists in InfraParams
|
|
24381
|
+
// precisely so a converge re-emits it; dropping it defeats its purpose.
|
|
24382
|
+
//
|
|
24383
|
+
// The stamped value is re-validated rather than cast: the row is typed
|
|
24384
|
+
// `string` and JSON-parsed unchecked, so a bad value would otherwise reach
|
|
24385
|
+
// ARM and come back as an opaque InvalidTemplate instead of a local refusal.
|
|
24386
|
+
//
|
|
24387
|
+
// An unrecognised stamped mode REFUSES rather than dropping to the bicep
|
|
24388
|
+
// default. Dropping would resolve to `project` and switch tracing ON for an
|
|
24389
|
+
// install whose stored configuration said something else — the silent
|
|
24390
|
+
// posture change this whole block exists to prevent. It also covers the
|
|
24391
|
+
// forward case: a newer CLI stamping a mode this build does not know should
|
|
24392
|
+
// not be clobbered by this build. An explicit flag rescues it either way,
|
|
24393
|
+
// which is why the flag is parsed FIRST and the stamp only read if absent.
|
|
24394
|
+
...(() => {
|
|
24395
|
+
const explicit = parseFoundryTracingMode(this.foundryTracing);
|
|
24396
|
+
if (explicit) return { foundryTracingMode: explicit };
|
|
24397
|
+
const raw = stampedParams?.bicep.foundryTracingMode;
|
|
24398
|
+
if (raw === void 0) return {};
|
|
24399
|
+
try {
|
|
24400
|
+
return { foundryTracingMode: parseFoundryTracingMode(raw) };
|
|
24401
|
+
} catch {
|
|
24402
|
+
throw new LocalCliError({
|
|
24403
|
+
code: "PLATFORM_ENABLE_AUTO_UPDATE_UNKNOWN_STAMPED_TRACING",
|
|
24404
|
+
message: `This install's stored configuration records a Foundry tracing mode this version does not recognise: '${raw}'.`,
|
|
24405
|
+
hint: "Pass --foundry-tracing project|account|skip to replace it. It is not dropped automatically, because that would re-enable tracing on an install whose configuration says otherwise."
|
|
24406
|
+
});
|
|
24407
|
+
}
|
|
24408
|
+
})(),
|
|
24409
|
+
...(() => {
|
|
24410
|
+
const url = typeof this.channelUrl === "string" && this.channelUrl.length > 0 ? this.channelUrl : stampedParams?.bicep.channelUrl;
|
|
24411
|
+
return url ? { channelUrl: url } : {};
|
|
24412
|
+
})()
|
|
24369
24413
|
};
|
|
24370
24414
|
onProgress("running Bicep deployment to provision the updater (~2-4 min)\u2026");
|
|
24371
24415
|
const repoRoot = await resolveRepoRoot2();
|
|
@@ -24904,6 +24948,16 @@ var KNOWN_NOISE = [
|
|
|
24904
24948
|
{ resourceType: "Microsoft.App/containerApps", pathPattern: /(^|\.)configuration\.secrets$/, reason: "shared relay secret is regenerated on every deployment \u2014 owned elsewhere" },
|
|
24905
24949
|
{ resourceType: "Microsoft.App/containerApps", pathPattern: /(^|\.)configuration\.secrets\[\d+\]\.value$/, reason: "shared relay secret is regenerated on every deployment \u2014 owned elsewhere" }
|
|
24906
24950
|
];
|
|
24951
|
+
var PROBE_LEAF = /\.probes\[\d+\]\./;
|
|
24952
|
+
var PROBE_TYPE_LEAF = /\.probes\[\d+\]\.type$/;
|
|
24953
|
+
function isProbeReordering(leaves) {
|
|
24954
|
+
const types = leaves.filter((l) => PROBE_TYPE_LEAF.test(l.path));
|
|
24955
|
+
if (types.length === 0) return false;
|
|
24956
|
+
const before = types.map((l) => l.before).filter((v) => typeof v === "string").sort();
|
|
24957
|
+
const after = types.map((l) => l.after).filter((v) => typeof v === "string").sort();
|
|
24958
|
+
if (before.length !== types.length || after.length !== types.length) return false;
|
|
24959
|
+
return before.every((v, i) => v === after[i]);
|
|
24960
|
+
}
|
|
24907
24961
|
var shortName = (resourceId) => resourceId.startsWith("[") ? "(role assignment)" : resourceId.split("/").pop() ?? resourceId;
|
|
24908
24962
|
function isArmExpression(v) {
|
|
24909
24963
|
return typeof v === "string" && /^\[.*\b(reference|format|guid|subscriptionResourceId|extensionResourceId)\(/.test(v) && v.endsWith("]");
|
|
@@ -24934,8 +24988,14 @@ function classifyWhatIf(changes) {
|
|
|
24934
24988
|
}
|
|
24935
24989
|
const resourceType = deriveResourceType(c.resourceId);
|
|
24936
24990
|
const resourceName = shortName(c.resourceId);
|
|
24937
|
-
|
|
24991
|
+
const leaves = flattenDelta(c.delta ?? []);
|
|
24992
|
+
const probesReordered = isProbeReordering(leaves);
|
|
24993
|
+
for (const leaf of leaves) {
|
|
24938
24994
|
const base = { resourceType, resourceName, path: leaf.path, before: leaf.before, after: leaf.after };
|
|
24995
|
+
if (probesReordered && PROBE_LEAF.test(leaf.path)) {
|
|
24996
|
+
noise.push({ ...base, reason: "probe array reordered by the RP; same probe set \u2014 no apply can reconcile it" });
|
|
24997
|
+
continue;
|
|
24998
|
+
}
|
|
24939
24999
|
if (leaf.propertyChangeType === "NoEffect") {
|
|
24940
25000
|
noise.push({ ...base, reason: "NoEffect (no-op)" });
|
|
24941
25001
|
continue;
|
|
@@ -31571,7 +31631,7 @@ ${colors.error("\u2717")} The GitHub App on disk is installed on ${colors.field(
|
|
|
31571
31631
|
// src/commands/bootstrap/launch.ts
|
|
31572
31632
|
var DEFAULT_RG = "rg-m8t-stack";
|
|
31573
31633
|
var DEFAULT_INSTALLER = "ghcr.io/m8t-labs/m8t-installer";
|
|
31574
|
-
var DEFAULT_INSTALLER_TAG = "v0.1.
|
|
31634
|
+
var DEFAULT_INSTALLER_TAG = "v0.1.65";
|
|
31575
31635
|
var ACI_NAME = "m8t-installer";
|
|
31576
31636
|
var MI_NAME = "m8t-installer-mi";
|
|
31577
31637
|
var BootstrapLaunchCommand = class extends M8tCommand {
|
|
@@ -31607,6 +31667,11 @@ var BootstrapLaunchCommand = class extends M8tCommand {
|
|
|
31607
31667
|
reinstallInto = Option56.String("--reinstall-into", { description: "Consent to installing into --resource-group even though it already holds resources. Must match the target group's name." });
|
|
31608
31668
|
org = Option56.String("--org", { description: "Assert the GitHub App on disk is installed on this org; refuses on a mismatch." });
|
|
31609
31669
|
noBrains = Option56.Boolean("--no-brains", false, { description: "Install without brain-backed workers. For test and CI rigs; the supported install creates brains." });
|
|
31670
|
+
// The opt-out TELEMETRY.md names. Without it there is no way to decline at
|
|
31671
|
+
// install time — the ACI env is built entirely from these options, so a
|
|
31672
|
+
// founder setting FOUNDRY_TRACING in their own shell reaches nothing. A
|
|
31673
|
+
// privacy notice that documents a control has to be a control that exists.
|
|
31674
|
+
foundryTracing = Option56.String("--foundry-tracing", { description: "Where agent traces go: project (default, your own App Insights) | account (legacy shared) | skip (no tracing \u2014 you lose the record of what your agents did)." });
|
|
31610
31675
|
async executeCommand() {
|
|
31611
31676
|
const location = typeof this.location === "string" ? this.location : void 0;
|
|
31612
31677
|
if (!location) {
|
|
@@ -31619,6 +31684,7 @@ var BootstrapLaunchCommand = class extends M8tCommand {
|
|
|
31619
31684
|
const installerImageOverride = typeof this.installerImage === "string" ? this.installerImage : void 0;
|
|
31620
31685
|
const installerImage = installerImageOverride ?? `${DEFAULT_INSTALLER}:${installerTag}`;
|
|
31621
31686
|
const gatewayImageRef = typeof this.gatewayImageRef === "string" ? this.gatewayImageRef : void 0;
|
|
31687
|
+
const foundryTracing = parseFoundryTracingMode(typeof this.foundryTracing === "string" ? this.foundryTracing : void 0) ?? DEFAULT_FOUNDRY_TRACING;
|
|
31622
31688
|
const account = await getAzAccount();
|
|
31623
31689
|
const subscriptionId = (typeof this.subscription === "string" ? this.subscription : void 0) ?? account.subscriptionId;
|
|
31624
31690
|
const out = (m) => this.context.stderr.write(` ${colors.dim(m)}
|
|
@@ -31746,7 +31812,7 @@ var BootstrapLaunchCommand = class extends M8tCommand {
|
|
|
31746
31812
|
appRegClientId: appReg.clientId,
|
|
31747
31813
|
image: installerImage,
|
|
31748
31814
|
gatewayImageRef,
|
|
31749
|
-
foundryTracing
|
|
31815
|
+
foundryTracing,
|
|
31750
31816
|
githubApp,
|
|
31751
31817
|
...founderObjectId ? { founderObjectId } : {},
|
|
31752
31818
|
...skipBrains ? { skipBrains: true } : {},
|