@fern-api/fern-api-dev 5.9.0-1-gf5bf2891dcb → 5.9.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/cli.cjs +40 -293
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -58001,9 +58001,7 @@ function newRepositoryReference({ remote, owner, repo }) {
|
|
|
58001
58001
|
repoUrl,
|
|
58002
58002
|
cloneUrl,
|
|
58003
58003
|
getAuthedCloneUrl: (installationToken) => {
|
|
58004
|
-
|
|
58005
|
-
const userPrefix = isInstallationToken ? "x-access-token:" : "";
|
|
58006
|
-
return cloneUrl.replace("https://", `https://${userPrefix}${installationToken}@`);
|
|
58004
|
+
return cloneUrl.replace("https://", `https://x-access-token:${installationToken}@`);
|
|
58007
58005
|
}
|
|
58008
58006
|
};
|
|
58009
58007
|
}
|
|
@@ -291715,7 +291713,7 @@ var require_websocket = __commonJS({
|
|
|
291715
291713
|
var http13 = require("http");
|
|
291716
291714
|
var net4 = require("net");
|
|
291717
291715
|
var tls2 = require("tls");
|
|
291718
|
-
var { randomBytes: randomBytes2, createHash:
|
|
291716
|
+
var { randomBytes: randomBytes2, createHash: createHash5 } = require("crypto");
|
|
291719
291717
|
var { Duplex, Readable: Readable8 } = require("stream");
|
|
291720
291718
|
var { URL: URL4 } = require("url");
|
|
291721
291719
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -292375,7 +292373,7 @@ var require_websocket = __commonJS({
|
|
|
292375
292373
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
292376
292374
|
return;
|
|
292377
292375
|
}
|
|
292378
|
-
const digest =
|
|
292376
|
+
const digest = createHash5("sha1").update(key2 + GUID).digest("base64");
|
|
292379
292377
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
292380
292378
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
292381
292379
|
return;
|
|
@@ -292742,7 +292740,7 @@ var require_websocket_server = __commonJS({
|
|
|
292742
292740
|
var EventEmitter9 = require("events");
|
|
292743
292741
|
var http13 = require("http");
|
|
292744
292742
|
var { Duplex } = require("stream");
|
|
292745
|
-
var { createHash:
|
|
292743
|
+
var { createHash: createHash5 } = require("crypto");
|
|
292746
292744
|
var extension4 = require_extension();
|
|
292747
292745
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
292748
292746
|
var subprotocol2 = require_subprotocol();
|
|
@@ -293043,7 +293041,7 @@ var require_websocket_server = __commonJS({
|
|
|
293043
293041
|
);
|
|
293044
293042
|
}
|
|
293045
293043
|
if (this._state > RUNNING) return abortHandshake(socket, 503);
|
|
293046
|
-
const digest =
|
|
293044
|
+
const digest = createHash5("sha1").update(key2 + GUID).digest("base64");
|
|
293047
293045
|
const headers2 = [
|
|
293048
293046
|
"HTTP/1.1 101 Switching Protocols",
|
|
293049
293047
|
"Upgrade: websocket",
|
|
@@ -345534,7 +345532,6 @@ var require_replay_run = __commonJS({
|
|
|
345534
345532
|
"../../generator-cli/lib/replay/replay-run.js"(exports2) {
|
|
345535
345533
|
"use strict";
|
|
345536
345534
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
345537
|
-
exports2.ReplayPrepareError = void 0;
|
|
345538
345535
|
exports2.replayPrepare = replayPrepare;
|
|
345539
345536
|
exports2.replayApply = replayApply;
|
|
345540
345537
|
exports2.replayRun = replayRun;
|
|
@@ -345580,17 +345577,12 @@ var require_replay_run = __commonJS({
|
|
|
345580
345577
|
if (!isTagMergedIntoHead(outputDir, tagSha)) {
|
|
345581
345578
|
logger4?.warn(`fern-generation-base tag ${tagSha} is not reachable from HEAD \u2014 skipping divergent-merge sync. The tag likely points at an unmerged generation (PR closed without merge).`);
|
|
345582
345579
|
} else {
|
|
345583
|
-
|
|
345584
|
-
|
|
345585
|
-
|
|
345586
|
-
|
|
345587
|
-
|
|
345588
|
-
|
|
345589
|
-
});
|
|
345590
|
-
} catch (error50) {
|
|
345591
|
-
logger4?.warn("Replay divergent-merge sync failed, continuing without sync: " + String(error50));
|
|
345592
|
-
throw new ReplayPrepareError(String(error50), error50);
|
|
345593
|
-
}
|
|
345580
|
+
const syncService = new replay_1.ReplayService(outputDir, { enabled: true });
|
|
345581
|
+
await syncService.syncFromDivergentMerge(tagSha, {
|
|
345582
|
+
cliVersion,
|
|
345583
|
+
generatorVersions,
|
|
345584
|
+
baseBranchHead: baseBranchHead ?? void 0
|
|
345585
|
+
});
|
|
345594
345586
|
try {
|
|
345595
345587
|
const freshLockManager = new replay_1.LockfileManager(outputDir);
|
|
345596
345588
|
if (freshLockManager.exists()) {
|
|
@@ -345612,8 +345604,8 @@ var require_replay_run = __commonJS({
|
|
|
345612
345604
|
baseBranchHead: baseBranchHead ?? void 0
|
|
345613
345605
|
});
|
|
345614
345606
|
} catch (error50) {
|
|
345615
|
-
logger4?.warn("Replay
|
|
345616
|
-
|
|
345607
|
+
logger4?.warn("Replay failed, continuing without replay: " + String(error50));
|
|
345608
|
+
return null;
|
|
345617
345609
|
}
|
|
345618
345610
|
return {
|
|
345619
345611
|
_service: service,
|
|
@@ -345631,14 +345623,13 @@ var require_replay_run = __commonJS({
|
|
|
345631
345623
|
try {
|
|
345632
345624
|
report = await prepared._service.applyPreparedReplay(prepared._preparation, { stageOnly });
|
|
345633
345625
|
} catch (error50) {
|
|
345634
|
-
logger4?.warn("Replay
|
|
345626
|
+
logger4?.warn("Replay failed, continuing without replay: " + String(error50));
|
|
345635
345627
|
return {
|
|
345636
345628
|
report: null,
|
|
345637
345629
|
fernignoreUpdated: false,
|
|
345638
345630
|
previousGenerationSha: prepared.previousGenerationSha,
|
|
345639
345631
|
currentGenerationSha: prepared.currentGenerationSha,
|
|
345640
|
-
baseBranchHead: prepared.baseBranchHead
|
|
345641
|
-
failureReason: String(error50)
|
|
345632
|
+
baseBranchHead: prepared.baseBranchHead
|
|
345642
345633
|
};
|
|
345643
345634
|
}
|
|
345644
345635
|
let resolvedBaseBranchHead = prepared.baseBranchHead;
|
|
@@ -345664,19 +345655,7 @@ var require_replay_run = __commonJS({
|
|
|
345664
345655
|
};
|
|
345665
345656
|
}
|
|
345666
345657
|
async function replayRun(params2) {
|
|
345667
|
-
|
|
345668
|
-
try {
|
|
345669
|
-
prepared = await replayPrepare(params2);
|
|
345670
|
-
} catch (error50) {
|
|
345671
|
-
return {
|
|
345672
|
-
report: null,
|
|
345673
|
-
fernignoreUpdated: false,
|
|
345674
|
-
previousGenerationSha: null,
|
|
345675
|
-
currentGenerationSha: null,
|
|
345676
|
-
baseBranchHead: null,
|
|
345677
|
-
failureReason: error50 instanceof ReplayPrepareError ? error50.reason : String(error50)
|
|
345678
|
-
};
|
|
345679
|
-
}
|
|
345658
|
+
const prepared = await replayPrepare(params2);
|
|
345680
345659
|
if (prepared == null) {
|
|
345681
345660
|
return {
|
|
345682
345661
|
report: null,
|
|
@@ -345688,19 +345667,6 @@ var require_replay_run = __commonJS({
|
|
|
345688
345667
|
}
|
|
345689
345668
|
return replayApply(prepared, { stageOnly: params2.stageOnly, logger: params2.logger });
|
|
345690
345669
|
}
|
|
345691
|
-
var ReplayPrepareError = class extends Error {
|
|
345692
|
-
reason;
|
|
345693
|
-
constructor(reason, cause) {
|
|
345694
|
-
super(`Replay prepare failed: ${reason}`, { cause });
|
|
345695
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
345696
|
-
if (Error.captureStackTrace) {
|
|
345697
|
-
Error.captureStackTrace(this, this.constructor);
|
|
345698
|
-
}
|
|
345699
|
-
this.name = this.constructor.name;
|
|
345700
|
-
this.reason = reason;
|
|
345701
|
-
}
|
|
345702
|
-
};
|
|
345703
|
-
exports2.ReplayPrepareError = ReplayPrepareError;
|
|
345704
345670
|
function isTagMergedIntoHead(cwd2, tagSha) {
|
|
345705
345671
|
try {
|
|
345706
345672
|
(0, child_process_1.execFileSync)("git", ["merge-base", "--is-ancestor", tagSha, "HEAD"], {
|
|
@@ -358242,7 +358208,6 @@ var require_GenerationCommitStep = __commonJS({
|
|
|
358242
358208
|
"use strict";
|
|
358243
358209
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
358244
358210
|
exports2.GenerationCommitStep = void 0;
|
|
358245
|
-
var child_process_1 = require("child_process");
|
|
358246
358211
|
var replay_run_1 = require_replay_run();
|
|
358247
358212
|
var BaseStep_1 = require_BaseStep();
|
|
358248
358213
|
var GenerationCommitStep = class extends BaseStep_1.BaseStep {
|
|
@@ -358259,35 +358224,14 @@ var require_GenerationCommitStep = __commonJS({
|
|
|
358259
358224
|
this.generatorName = generatorName;
|
|
358260
358225
|
}
|
|
358261
358226
|
async execute(_context) {
|
|
358262
|
-
const
|
|
358263
|
-
|
|
358264
|
-
|
|
358265
|
-
|
|
358266
|
-
|
|
358267
|
-
|
|
358268
|
-
|
|
358269
|
-
|
|
358270
|
-
skipApplication: this.config.skipApplication,
|
|
358271
|
-
logger: this.logger
|
|
358272
|
-
});
|
|
358273
|
-
} catch (error50) {
|
|
358274
|
-
const reason = error50 instanceof replay_run_1.ReplayPrepareError ? error50.reason : String(error50);
|
|
358275
|
-
if (headBeforePrepare != null) {
|
|
358276
|
-
try {
|
|
358277
|
-
(0, child_process_1.execFileSync)("git", ["reset", "--hard", headBeforePrepare], {
|
|
358278
|
-
cwd: this.outputDir,
|
|
358279
|
-
stdio: "pipe"
|
|
358280
|
-
});
|
|
358281
|
-
} catch {
|
|
358282
|
-
}
|
|
358283
|
-
}
|
|
358284
|
-
return {
|
|
358285
|
-
executed: true,
|
|
358286
|
-
success: true,
|
|
358287
|
-
errorMessage: reason,
|
|
358288
|
-
preparedReplay: null
|
|
358289
|
-
};
|
|
358290
|
-
}
|
|
358227
|
+
const prepared = await (0, replay_run_1.replayPrepare)({
|
|
358228
|
+
outputDir: this.outputDir,
|
|
358229
|
+
cliVersion: this.cliVersion,
|
|
358230
|
+
generatorVersions: this.generatorVersions,
|
|
358231
|
+
generatorName: this.generatorName,
|
|
358232
|
+
skipApplication: this.config.skipApplication,
|
|
358233
|
+
logger: this.logger
|
|
358234
|
+
});
|
|
358291
358235
|
if (prepared == null) {
|
|
358292
358236
|
return {
|
|
358293
358237
|
executed: true,
|
|
@@ -358307,17 +358251,6 @@ var require_GenerationCommitStep = __commonJS({
|
|
|
358307
358251
|
}
|
|
358308
358252
|
};
|
|
358309
358253
|
exports2.GenerationCommitStep = GenerationCommitStep;
|
|
358310
|
-
function tryRevParse(cwd2, rev) {
|
|
358311
|
-
try {
|
|
358312
|
-
return (0, child_process_1.execFileSync)("git", ["rev-parse", "--verify", rev], {
|
|
358313
|
-
cwd: cwd2,
|
|
358314
|
-
encoding: "utf-8",
|
|
358315
|
-
stdio: "pipe"
|
|
358316
|
-
}).trim();
|
|
358317
|
-
} catch {
|
|
358318
|
-
return null;
|
|
358319
|
-
}
|
|
358320
|
-
}
|
|
358321
358254
|
}
|
|
358322
358255
|
});
|
|
358323
358256
|
|
|
@@ -358615,10 +358548,8 @@ var require_replay_summary = __commonJS({
|
|
|
358615
358548
|
const applied = result.patchesApplied ?? 0;
|
|
358616
358549
|
const absorbed = result.patchesAbsorbed ?? 0;
|
|
358617
358550
|
const unresolvedCount = result.unresolvedPatches?.length ?? 0;
|
|
358618
|
-
const unresolvedFiles = (result.unresolvedPatches ?? []).reduce((sum, patch5) => sum + patch5.conflictDetails.length, 0);
|
|
358619
358551
|
const preserved = applied - absorbed;
|
|
358620
|
-
|
|
358621
|
-
logger4.info(`[replay] flow=${result.flow ?? "unknown"} detected=${result.patchesDetected ?? 0} applied=${applied} conflicts=${result.patchesWithConflicts ?? 0} absorbed=${absorbed} repointed=${result.patchesRepointed ?? 0} content_rebased=${result.patchesContentRebased ?? 0} kept_as_user_owned=${result.patchesKeptAsUserOwned ?? 0} unresolved=${unresolvedCount} unresolved_files=${unresolvedFiles} warnings=${result.warnings?.length ?? 0} success=${replayLogicSucceeded}`);
|
|
358552
|
+
logger4.debug(`Replay: flow=${result.flow}, detected=${result.patchesDetected ?? 0}, applied=${applied}, absorbed=${absorbed}, unresolved=${unresolvedCount}`);
|
|
358622
358553
|
if (preserved > 0) {
|
|
358623
358554
|
const absorbedNote = absorbed > 0 ? ` (some customizations now part of generated code)` : "";
|
|
358624
358555
|
logger4.info(`Replay: customizations preserved${absorbedNote}`);
|
|
@@ -358626,29 +358557,8 @@ var require_replay_summary = __commonJS({
|
|
|
358626
358557
|
logger4.info(`Replay: customizations now part of generated code`);
|
|
358627
358558
|
}
|
|
358628
358559
|
if (unresolvedCount > 0) {
|
|
358629
|
-
const
|
|
358630
|
-
|
|
358631
|
-
for (const file4 of patch5.conflictDetails) {
|
|
358632
|
-
switch (file4.conflictReason) {
|
|
358633
|
-
case "same-line-edit":
|
|
358634
|
-
buckets.sameLineEdit += 1;
|
|
358635
|
-
break;
|
|
358636
|
-
case "new-file-both":
|
|
358637
|
-
buckets.newFileBoth += 1;
|
|
358638
|
-
break;
|
|
358639
|
-
case "base-generation-mismatch":
|
|
358640
|
-
buckets.baseGenerationMismatch += 1;
|
|
358641
|
-
break;
|
|
358642
|
-
case "patch-apply-failed":
|
|
358643
|
-
buckets.patchApplyFailed += 1;
|
|
358644
|
-
break;
|
|
358645
|
-
default:
|
|
358646
|
-
buckets.other += 1;
|
|
358647
|
-
}
|
|
358648
|
-
}
|
|
358649
|
-
}
|
|
358650
|
-
logger4.debug(`[replay] conflict_buckets same_line_edit=${buckets.sameLineEdit} new_file_both=${buckets.newFileBoth} base_generation_mismatch=${buckets.baseGenerationMismatch} patch_apply_failed=${buckets.patchApplyFailed} other=${buckets.other}`);
|
|
358651
|
-
logger4.warn(`Replay: ${plural(unresolvedFiles, "file")} ${unresolvedFiles === 1 ? "has" : "have"} unresolved conflicts \u2014 resolve via \`fern replay resolve\``);
|
|
358560
|
+
const totalFiles = (result.unresolvedPatches ?? []).reduce((sum, patch5) => sum + patch5.conflictDetails.length, 0);
|
|
358561
|
+
logger4.warn(`Replay: ${plural(totalFiles, "file")} ${totalFiles === 1 ? "has" : "have"} unresolved conflicts \u2014 resolve via \`fern replay resolve\``);
|
|
358652
358562
|
for (const patch5 of result.unresolvedPatches ?? []) {
|
|
358653
358563
|
logger4.warn(` "${patchDescription(patch5)}":`);
|
|
358654
358564
|
for (const file4 of patch5.conflictDetails) {
|
|
@@ -358656,9 +358566,6 @@ var require_replay_summary = __commonJS({
|
|
|
358656
358566
|
}
|
|
358657
358567
|
}
|
|
358658
358568
|
}
|
|
358659
|
-
if (result.replayCrashed === true && result.errorMessage != null) {
|
|
358660
|
-
logger4.warn(`Replay: ${result.errorMessage}`);
|
|
358661
|
-
}
|
|
358662
358569
|
for (const warning of result.warnings ?? []) {
|
|
358663
358570
|
logger4.warn(`Replay: ${warning}`);
|
|
358664
358571
|
}
|
|
@@ -359099,18 +359006,6 @@ var require_ReplayStep = __commonJS({
|
|
|
359099
359006
|
async execute(context3) {
|
|
359100
359007
|
const generationCommit = context3.previousStepResults.generationCommit;
|
|
359101
359008
|
const prepared = generationCommit?.preparedReplay;
|
|
359102
|
-
if (generationCommit != null && generationCommit.errorMessage != null && prepared == null) {
|
|
359103
|
-
return {
|
|
359104
|
-
executed: true,
|
|
359105
|
-
success: true,
|
|
359106
|
-
replayCrashed: true,
|
|
359107
|
-
errorMessage: generationCommit.errorMessage,
|
|
359108
|
-
flow: "normal-regeneration",
|
|
359109
|
-
patchesDetected: 0,
|
|
359110
|
-
patchesApplied: 0,
|
|
359111
|
-
patchesWithConflicts: 0
|
|
359112
|
-
};
|
|
359113
|
-
}
|
|
359114
359009
|
if (generationCommit != null && prepared == null) {
|
|
359115
359010
|
return {
|
|
359116
359011
|
executed: true,
|
|
@@ -359133,21 +359028,6 @@ var require_ReplayStep = __commonJS({
|
|
|
359133
359028
|
skipApplication: this.config.skipApplication,
|
|
359134
359029
|
logger: this.logger
|
|
359135
359030
|
});
|
|
359136
|
-
if (result.failureReason != null) {
|
|
359137
|
-
return {
|
|
359138
|
-
executed: true,
|
|
359139
|
-
success: true,
|
|
359140
|
-
replayCrashed: true,
|
|
359141
|
-
errorMessage: result.failureReason,
|
|
359142
|
-
previousGenerationSha: result.previousGenerationSha ?? void 0,
|
|
359143
|
-
currentGenerationSha: result.currentGenerationSha ?? void 0,
|
|
359144
|
-
baseBranchHead: result.baseBranchHead ?? void 0,
|
|
359145
|
-
flow: "normal-regeneration",
|
|
359146
|
-
patchesDetected: 0,
|
|
359147
|
-
patchesApplied: 0,
|
|
359148
|
-
patchesWithConflicts: 0
|
|
359149
|
-
};
|
|
359150
|
-
}
|
|
359151
359031
|
if (result.report == null) {
|
|
359152
359032
|
return {
|
|
359153
359033
|
executed: true,
|
|
@@ -622758,7 +622638,7 @@ var AccessTokenPosthogManager = class {
|
|
|
622758
622638
|
properties: {
|
|
622759
622639
|
...event,
|
|
622760
622640
|
...event.properties,
|
|
622761
|
-
version: "5.9.0
|
|
622641
|
+
version: "5.9.0",
|
|
622762
622642
|
usingAccessToken: true
|
|
622763
622643
|
}
|
|
622764
622644
|
});
|
|
@@ -622812,7 +622692,7 @@ var UserPosthogManager = class {
|
|
|
622812
622692
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
622813
622693
|
event: "CLI",
|
|
622814
622694
|
properties: {
|
|
622815
|
-
version: "5.9.0
|
|
622695
|
+
version: "5.9.0",
|
|
622816
622696
|
...event,
|
|
622817
622697
|
...event.properties,
|
|
622818
622698
|
usingAccessToken: false,
|
|
@@ -628504,24 +628384,7 @@ var TaskContextAdapter = class {
|
|
|
628504
628384
|
return false;
|
|
628505
628385
|
}
|
|
628506
628386
|
}
|
|
628507
|
-
instrumentPostHogEvent(
|
|
628508
|
-
try {
|
|
628509
|
-
if (event.command == null || event.command.length === 0) {
|
|
628510
|
-
return;
|
|
628511
|
-
}
|
|
628512
|
-
const eventName = event.command;
|
|
628513
|
-
const tags = {};
|
|
628514
|
-
if (event.orgId != null) {
|
|
628515
|
-
tags.org = event.orgId;
|
|
628516
|
-
}
|
|
628517
|
-
for (const [key2, value2] of Object.entries(event.properties ?? {})) {
|
|
628518
|
-
if (typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "boolean" || value2 === null) {
|
|
628519
|
-
tags[String(key2)] = value2;
|
|
628520
|
-
}
|
|
628521
|
-
}
|
|
628522
|
-
this.context.telemetry.sendEvent(eventName, tags);
|
|
628523
|
-
} catch {
|
|
628524
|
-
}
|
|
628387
|
+
instrumentPostHogEvent(_event) {
|
|
628525
628388
|
}
|
|
628526
628389
|
formatError(error50) {
|
|
628527
628390
|
if (error50 == null) {
|
|
@@ -847731,7 +847594,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
847731
847594
|
var LOGS_FOLDER_NAME = "logs";
|
|
847732
847595
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
847733
847596
|
function getCliSource() {
|
|
847734
|
-
const version7 = "5.9.0
|
|
847597
|
+
const version7 = "5.9.0";
|
|
847735
847598
|
return `cli@${version7}`;
|
|
847736
847599
|
}
|
|
847737
847600
|
var DebugLogger = class {
|
|
@@ -860384,7 +860247,7 @@ var LegacyDocsPublisher = class {
|
|
|
860384
860247
|
previewId,
|
|
860385
860248
|
disableTemplates: void 0,
|
|
860386
860249
|
skipUpload,
|
|
860387
|
-
cliVersion: "5.9.0
|
|
860250
|
+
cliVersion: "5.9.0",
|
|
860388
860251
|
loginCommand: "fern auth login"
|
|
860389
860252
|
});
|
|
860390
860253
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -912897,88 +912760,6 @@ var import_os13 = __toESM(require("os"), 1);
|
|
|
912897
912760
|
var import_path80 = __toESM(require("path"), 1);
|
|
912898
912761
|
var import_tmp_promise15 = __toESM(require_tmp_promise(), 1);
|
|
912899
912762
|
|
|
912900
|
-
// ../generation/local-generation/local-workspace-runner/lib/buildReplayTelemetryProps.js
|
|
912901
|
-
var import_crypto9 = require("crypto");
|
|
912902
|
-
var KNOWN_CONFLICT_REASONS = [
|
|
912903
|
-
"same-line-edit",
|
|
912904
|
-
"new-file-both",
|
|
912905
|
-
"base-generation-mismatch",
|
|
912906
|
-
"patch-apply-failed"
|
|
912907
|
-
];
|
|
912908
|
-
function isKnownConflictReason(reason) {
|
|
912909
|
-
return reason != null && KNOWN_CONFLICT_REASONS.includes(reason);
|
|
912910
|
-
}
|
|
912911
|
-
function buildReplayTelemetryProps(input3) {
|
|
912912
|
-
const { pipelineResult, generatorName, generatorVersion, cliVersion, repoUri, automationMode, autoMerge, skipIfNoDiff, hasBreakingChanges, versionArg, versionBump, replayConfigEnabled, noReplayFlag, githubMode, previewMode, durationMs } = input3;
|
|
912913
|
-
const replay = pipelineResult.steps.replay;
|
|
912914
|
-
const github = pipelineResult.steps.github;
|
|
912915
|
-
const unresolvedPatches = replay?.unresolvedPatches ?? [];
|
|
912916
|
-
const unresolvedConflictFilesCount = unresolvedPatches.reduce((sum, patch5) => sum + patch5.conflictDetails.length, 0);
|
|
912917
|
-
const conflictBuckets = {
|
|
912918
|
-
"same-line-edit": 0,
|
|
912919
|
-
"new-file-both": 0,
|
|
912920
|
-
"base-generation-mismatch": 0,
|
|
912921
|
-
"patch-apply-failed": 0,
|
|
912922
|
-
other: 0
|
|
912923
|
-
};
|
|
912924
|
-
for (const patch5 of unresolvedPatches) {
|
|
912925
|
-
for (const detail of patch5.conflictDetails) {
|
|
912926
|
-
if (isKnownConflictReason(detail.conflictReason)) {
|
|
912927
|
-
conflictBuckets[detail.conflictReason] += 1;
|
|
912928
|
-
} else {
|
|
912929
|
-
conflictBuckets.other += 1;
|
|
912930
|
-
}
|
|
912931
|
-
}
|
|
912932
|
-
}
|
|
912933
|
-
const replayLogicSucceeded = replay != null && replay.executed && replay.replayCrashed !== true;
|
|
912934
|
-
return {
|
|
912935
|
-
action: "pipeline_run",
|
|
912936
|
-
success: replayLogicSucceeded,
|
|
912937
|
-
executed: replay?.executed ?? false,
|
|
912938
|
-
flow: replay?.flow ?? null,
|
|
912939
|
-
replay_crashed: replay?.replayCrashed === true,
|
|
912940
|
-
pipeline_success: pipelineResult.success,
|
|
912941
|
-
pipeline_warnings_count: pipelineResult.warnings?.length ?? 0,
|
|
912942
|
-
replay_warnings_count: replay?.warnings?.length ?? 0,
|
|
912943
|
-
generator_name: generatorName,
|
|
912944
|
-
generator_version: generatorVersion,
|
|
912945
|
-
cli_version: cliVersion ?? null,
|
|
912946
|
-
repo_uri_hash: hashRepoUri(repoUri),
|
|
912947
|
-
automation_mode: automationMode,
|
|
912948
|
-
auto_merge_requested: autoMerge,
|
|
912949
|
-
auto_merge_enabled: github?.autoMergeEnabled === true,
|
|
912950
|
-
skip_if_no_diff: skipIfNoDiff,
|
|
912951
|
-
no_diff_skipped: github?.skippedNoDiff === true,
|
|
912952
|
-
version_arg: versionArg,
|
|
912953
|
-
version_bump: versionBump ?? null,
|
|
912954
|
-
has_breaking_changes: hasBreakingChanges,
|
|
912955
|
-
replay_config_enabled: replayConfigEnabled,
|
|
912956
|
-
no_replay_flag: noReplayFlag,
|
|
912957
|
-
github_mode: githubMode,
|
|
912958
|
-
preview_mode: previewMode,
|
|
912959
|
-
pr_created: github?.prNumber != null,
|
|
912960
|
-
pr_updated_existing: github?.updatedExistingPr === true,
|
|
912961
|
-
duration_ms: durationMs,
|
|
912962
|
-
patches_detected: replay?.patchesDetected ?? 0,
|
|
912963
|
-
patches_applied: replay?.patchesApplied ?? 0,
|
|
912964
|
-
patches_with_conflicts: replay?.patchesWithConflicts ?? 0,
|
|
912965
|
-
patches_absorbed: replay?.patchesAbsorbed ?? 0,
|
|
912966
|
-
patches_repointed: replay?.patchesRepointed ?? 0,
|
|
912967
|
-
patches_content_rebased: replay?.patchesContentRebased ?? 0,
|
|
912968
|
-
patches_kept_as_user_owned: replay?.patchesKeptAsUserOwned ?? 0,
|
|
912969
|
-
unresolved_patches_count: unresolvedPatches.length,
|
|
912970
|
-
unresolved_conflict_files_count: unresolvedConflictFilesCount,
|
|
912971
|
-
conflicts_same_line_edit: conflictBuckets["same-line-edit"],
|
|
912972
|
-
conflicts_new_file_both: conflictBuckets["new-file-both"],
|
|
912973
|
-
conflicts_base_generation_mismatch: conflictBuckets["base-generation-mismatch"],
|
|
912974
|
-
conflicts_patch_apply_failed: conflictBuckets["patch-apply-failed"],
|
|
912975
|
-
conflicts_other: conflictBuckets.other
|
|
912976
|
-
};
|
|
912977
|
-
}
|
|
912978
|
-
function hashRepoUri(uri) {
|
|
912979
|
-
return (0, import_crypto9.createHash)("sha256").update(uri).digest("hex").slice(0, 16);
|
|
912980
|
-
}
|
|
912981
|
-
|
|
912982
912763
|
// ../generation/local-generation/local-workspace-runner/lib/getGeneratorOutputSubfolder.js
|
|
912983
912764
|
function getGeneratorOutputSubfolder(generatorName) {
|
|
912984
912765
|
const baseName = generatorName.split("/").pop() || "sdk";
|
|
@@ -913230,48 +913011,14 @@ generators:
|
|
|
913230
913011
|
},
|
|
913231
913012
|
generatorName: generatorInvocation.name
|
|
913232
913013
|
}, pipelineLogger);
|
|
913233
|
-
const pipelineStart = Date.now();
|
|
913234
913014
|
const pipelineResult = await pipeline6.run();
|
|
913235
|
-
const pipelineDurationMs = Date.now() - pipelineStart;
|
|
913236
913015
|
if (pipelineResult.steps.replay != null) {
|
|
913237
913016
|
(0, import_pipeline.logReplaySummary)(pipelineResult.steps.replay, {
|
|
913238
913017
|
debug: (msg) => interactiveTaskContext.logger.debug(msg),
|
|
913239
|
-
info: (msg) =>
|
|
913240
|
-
const isStructured = msg.startsWith("[replay] ") || msg.startsWith("[telemetry] ");
|
|
913241
|
-
interactiveTaskContext.logger.info(isStructured ? msg : source_default.cyan(msg));
|
|
913242
|
-
},
|
|
913018
|
+
info: (msg) => interactiveTaskContext.logger.info(source_default.cyan(msg)),
|
|
913243
913019
|
warn: (msg) => interactiveTaskContext.logger.warn(source_default.yellow(msg)),
|
|
913244
913020
|
error: (msg) => interactiveTaskContext.logger.error(source_default.red(msg))
|
|
913245
913021
|
});
|
|
913246
|
-
if (!disableTelemetry) {
|
|
913247
|
-
try {
|
|
913248
|
-
const replayTelemetryProps = buildReplayTelemetryProps({
|
|
913249
|
-
pipelineResult,
|
|
913250
|
-
generatorName: generatorInvocation.name,
|
|
913251
|
-
generatorVersion: generatorInvocation.version,
|
|
913252
|
-
cliVersion: workspace.cliVersion,
|
|
913253
|
-
repoUri: selfhostedGithubConfig.uri,
|
|
913254
|
-
automationMode: automationMode === true,
|
|
913255
|
-
autoMerge: autoMerge === true,
|
|
913256
|
-
skipIfNoDiff: skipIfNoDiff === true,
|
|
913257
|
-
hasBreakingChanges,
|
|
913258
|
-
versionArg: version7 == null ? "none" : (0, import_autoversion3.isAutoVersion)(version7) ? "auto" : "explicit",
|
|
913259
|
-
versionBump: autoVersioningVersionBump,
|
|
913260
|
-
replayConfigEnabled: replay?.enabled === true,
|
|
913261
|
-
noReplayFlag: noReplay === true,
|
|
913262
|
-
githubMode: selfhostedGithubConfig.mode ?? "push",
|
|
913263
|
-
previewMode: selfhostedGithubConfig.previewMode === true,
|
|
913264
|
-
durationMs: pipelineDurationMs
|
|
913265
|
-
});
|
|
913266
|
-
interactiveTaskContext.instrumentPostHogEvent({
|
|
913267
|
-
command: "replay",
|
|
913268
|
-
properties: replayTelemetryProps
|
|
913269
|
-
});
|
|
913270
|
-
interactiveTaskContext.logger.debug(`[telemetry] replay event sent: ${JSON.stringify(replayTelemetryProps)}`);
|
|
913271
|
-
} catch (error50) {
|
|
913272
|
-
interactiveTaskContext.logger.debug(`[telemetry] failed to send replay event: ${String(error50)}`);
|
|
913273
|
-
}
|
|
913274
|
-
}
|
|
913275
913022
|
}
|
|
913276
913023
|
if (pipelineResult.steps.github?.skippedNoDiff) {
|
|
913277
913024
|
interactiveTaskContext.logger.info(source_default.green("No changes detected \u2014 skipping PR creation"));
|
|
@@ -934943,7 +934690,7 @@ var CliContext = class _CliContext {
|
|
|
934943
934690
|
if (false) {
|
|
934944
934691
|
this.logger.error("CLI_VERSION is not defined");
|
|
934945
934692
|
}
|
|
934946
|
-
return "5.9.0
|
|
934693
|
+
return "5.9.0";
|
|
934947
934694
|
}
|
|
934948
934695
|
getCliName() {
|
|
934949
934696
|
if (false) {
|
|
@@ -948213,7 +947960,7 @@ var import_path94 = __toESM(require("path"), 1);
|
|
|
948213
947960
|
// src/commands/docs-theme/ThemeConfigProcessor.ts
|
|
948214
947961
|
init_lib6();
|
|
948215
947962
|
var import_child_process12 = require("child_process");
|
|
948216
|
-
var
|
|
947963
|
+
var import_crypto9 = require("crypto");
|
|
948217
947964
|
var import_promises178 = require("fs/promises");
|
|
948218
947965
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
948219
947966
|
var import_path93 = __toESM(require("path"), 1);
|
|
@@ -948429,7 +948176,7 @@ ${errors4.map((e8) => ` - ${e8}`).join("\n")}`,
|
|
|
948429
948176
|
return this.uploadToCas(content5, contentType, bindPath, import_path93.default.basename(absolutePath));
|
|
948430
948177
|
}
|
|
948431
948178
|
async uploadToCas(content5, contentType, bindPath, label) {
|
|
948432
|
-
const hash5 = (0,
|
|
948179
|
+
const hash5 = (0, import_crypto9.createHash)("sha256").update(content5).digest("hex");
|
|
948433
948180
|
const casUrl = `${FDR_ORIGIN}/v2/registry/content/${hash5}?orgId=${encodeURIComponent(this.orgId)}`;
|
|
948434
948181
|
this.context.logger.debug(` CAS check: PUT ${casUrl} (${contentType}, ${content5.byteLength} bytes)`);
|
|
948435
948182
|
let checkRes;
|
|
@@ -952301,7 +952048,7 @@ function computePreviewVersion({ previewId }) {
|
|
|
952301
952048
|
|
|
952302
952049
|
// src/commands/sdk-preview/getPreviewId.ts
|
|
952303
952050
|
var import_child_process14 = require("child_process");
|
|
952304
|
-
var
|
|
952051
|
+
var import_crypto10 = require("crypto");
|
|
952305
952052
|
var import_util71 = require("util");
|
|
952306
952053
|
var execAsync2 = (0, import_util71.promisify)(import_child_process14.exec);
|
|
952307
952054
|
var MAX_PREVIEW_ID_LENGTH = 40;
|
|
@@ -952325,7 +952072,7 @@ function sanitizeBranchName(branch) {
|
|
|
952325
952072
|
return branch.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, MAX_PREVIEW_ID_LENGTH).replace(/-$/, "");
|
|
952326
952073
|
}
|
|
952327
952074
|
function generateRandomId() {
|
|
952328
|
-
return (0,
|
|
952075
|
+
return (0, import_crypto10.randomBytes)(4).toString("hex");
|
|
952329
952076
|
}
|
|
952330
952077
|
|
|
952331
952078
|
// src/commands/sdk-preview/toPreviewPackageName.ts
|
|
@@ -954637,12 +954384,12 @@ async function collectFiles(baseDirectory, relativeBase) {
|
|
|
954637
954384
|
}
|
|
954638
954385
|
|
|
954639
954386
|
// src/commands/write-translation/hash-utils.ts
|
|
954640
|
-
var
|
|
954387
|
+
var import_crypto11 = require("crypto");
|
|
954641
954388
|
var import_fs42 = require("fs");
|
|
954642
954389
|
var import_promises195 = require("fs/promises");
|
|
954643
954390
|
var import_path105 = __toESM(require("path"), 1);
|
|
954644
954391
|
function calculateContentHash(content5) {
|
|
954645
|
-
return (0,
|
|
954392
|
+
return (0, import_crypto11.createHash)("sha256").update(content5, "utf-8").digest("hex");
|
|
954646
954393
|
}
|
|
954647
954394
|
async function loadHashMappings(translationsDirectory) {
|
|
954648
954395
|
const hashesFilePath = import_path105.default.join(translationsDirectory, "hashes");
|
package/package.json
CHANGED