bitfab 0.63.1 → 0.63.3
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/{chunk-Q74D6UQA.js → chunk-2SHMY7VT.js} +10 -4
- package/dist/{chunk-Q74D6UQA.js.map → chunk-2SHMY7VT.js.map} +1 -1
- package/dist/{chunk-RW26DE5W.js → chunk-2UXFKQAO.js} +6 -4
- package/dist/chunk-2UXFKQAO.js.map +1 -0
- package/dist/{chunk-KARCQKAW.js → chunk-7J4PWCMT.js} +10 -4
- package/dist/{chunk-KARCQKAW.js.map → chunk-7J4PWCMT.js.map} +1 -1
- package/dist/{chunk-ZVEIZZAN.js → chunk-DISN55EE.js} +6 -6
- package/dist/{chunk-ZVEIZZAN.js.map → chunk-DISN55EE.js.map} +1 -1
- package/dist/{chunk-5RHWKAAZ.js → chunk-ZVBOAKPF.js} +43 -22
- package/dist/chunk-ZVBOAKPF.js.map +1 -0
- package/dist/{http-TO3MKZLO.js → http-T57OQRSM.js} +2 -2
- package/dist/{http-Q62IVATC.js → http-TNAMJGTM.js} +2 -2
- package/dist/index.cjs +50 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -19
- package/dist/index.d.ts +26 -19
- package/dist/index.js +3 -3
- package/dist/node.cjs +50 -23
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-RJJAPO6Q.js → replay-GMHI5FIV.js} +3 -3
- package/dist/replayCli.js +34 -3
- package/dist/replayCli.js.map +1 -1
- package/dist/seedCli.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-5RHWKAAZ.js.map +0 -1
- package/dist/chunk-RW26DE5W.js.map +0 -1
- /package/dist/{http-Q62IVATC.js.map → http-T57OQRSM.js.map} +0 -0
- /package/dist/{http-TO3MKZLO.js.map → http-TNAMJGTM.js.map} +0 -0
- /package/dist/{replay-RJJAPO6Q.js.map → replay-GMHI5FIV.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ var __version__, __packageName__;
|
|
|
51
51
|
var init_version_generated = __esm({
|
|
52
52
|
"src/version.generated.ts"() {
|
|
53
53
|
"use strict";
|
|
54
|
-
__version__ = "0.63.
|
|
54
|
+
__version__ = "0.63.3";
|
|
55
55
|
__packageName__ = "bitfab";
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -2904,7 +2904,7 @@ var init_http = __esm({
|
|
|
2904
2904
|
* Start a replay session by fetching historical traces.
|
|
2905
2905
|
* Blocking call - creates an experiment and returns lightweight item references.
|
|
2906
2906
|
*/
|
|
2907
|
-
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata) {
|
|
2907
|
+
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun) {
|
|
2908
2908
|
const payload = { traceFunctionKey };
|
|
2909
2909
|
if (experimentalSelectiveReplay !== void 0) {
|
|
2910
2910
|
payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
|
|
@@ -2962,6 +2962,9 @@ var init_http = __esm({
|
|
|
2962
2962
|
if (skipAssertionJudging !== true) {
|
|
2963
2963
|
payload.judgeAssertions = true;
|
|
2964
2964
|
}
|
|
2965
|
+
if (dryRun) {
|
|
2966
|
+
payload.dryRun = true;
|
|
2967
|
+
}
|
|
2965
2968
|
const git = await resolvedGitState();
|
|
2966
2969
|
if (git && !isEmptyGitState(git)) {
|
|
2967
2970
|
payload.git = git;
|
|
@@ -2975,7 +2978,10 @@ var init_http = __esm({
|
|
|
2975
2978
|
const { testRunId, testRunUrl, ...rest } = response;
|
|
2976
2979
|
const experimentId = response.experimentId ?? testRunId;
|
|
2977
2980
|
const experimentUrl = response.experimentUrl ?? testRunUrl;
|
|
2978
|
-
if (
|
|
2981
|
+
if (dryRun && response.experimentId === null) {
|
|
2982
|
+
return { ...rest, experimentId: null, experimentUrl: null };
|
|
2983
|
+
}
|
|
2984
|
+
if (experimentId === void 0 || experimentId === null || experimentUrl === void 0 || experimentUrl === null) {
|
|
2979
2985
|
throw new BitfabError(
|
|
2980
2986
|
"Replay start response is missing the experiment ID or URL."
|
|
2981
2987
|
);
|
|
@@ -4311,7 +4317,7 @@ async function processItem(httpClient, serverItem, fn, experimentId, mockStrateg
|
|
|
4311
4317
|
const originalTraceId = serverItem.originalTraceId ?? serverItem.sourceTraceId;
|
|
4312
4318
|
const originalSpanId = serverItem.originalSpanId ?? serverItem.sourceSpanId;
|
|
4313
4319
|
try {
|
|
4314
|
-
if (includeDbBranchLease && !lease && !leaseError) {
|
|
4320
|
+
if (includeDbBranchLease && experimentId !== null && !lease && !leaseError) {
|
|
4315
4321
|
let resolved2;
|
|
4316
4322
|
try {
|
|
4317
4323
|
resolved2 = await httpClient.resolveDbBranchLease(
|
|
@@ -4405,7 +4411,7 @@ async function processItem(httpClient, serverItem, fn, experimentId, mockStrateg
|
|
|
4405
4411
|
}
|
|
4406
4412
|
return pending;
|
|
4407
4413
|
} : void 0;
|
|
4408
|
-
if (dryRun) {
|
|
4414
|
+
if (dryRun || experimentId === null) {
|
|
4409
4415
|
return {
|
|
4410
4416
|
traceId: null,
|
|
4411
4417
|
originalTraceId,
|
|
@@ -4693,7 +4699,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4693
4699
|
options?.skipAssertionJudging === true || options?.judgeAssertions === false,
|
|
4694
4700
|
options?.experimentalSelectiveReplay,
|
|
4695
4701
|
options?.notes,
|
|
4696
|
-
options?.metadata
|
|
4702
|
+
options?.metadata,
|
|
4703
|
+
options?.dryRun === true
|
|
4697
4704
|
);
|
|
4698
4705
|
if (started.items.length === 0) {
|
|
4699
4706
|
try {
|
|
@@ -4723,6 +4730,22 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4723
4730
|
);
|
|
4724
4731
|
}
|
|
4725
4732
|
const { experimentId } = session;
|
|
4733
|
+
if (experimentId === null || session.experimentUrl === null) {
|
|
4734
|
+
return runReplaySession(
|
|
4735
|
+
httpClient,
|
|
4736
|
+
fn,
|
|
4737
|
+
session,
|
|
4738
|
+
null,
|
|
4739
|
+
maxConcurrency,
|
|
4740
|
+
() => {
|
|
4741
|
+
},
|
|
4742
|
+
() => {
|
|
4743
|
+
},
|
|
4744
|
+
() => false,
|
|
4745
|
+
options,
|
|
4746
|
+
registeredOverrides
|
|
4747
|
+
);
|
|
4748
|
+
}
|
|
4726
4749
|
const fullExperimentUrl = `${serviceUrl}${session.experimentUrl}`;
|
|
4727
4750
|
const heartbeat = startReplayHeartbeat(
|
|
4728
4751
|
() => httpClient.heartbeatReplay(experimentId)
|
|
@@ -4784,12 +4807,14 @@ function throwIfInterrupted(interrupted, items, experimentId, experimentUrl) {
|
|
|
4784
4807
|
async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxConcurrency, stopInterruptingOnSignal, markCompleteReturned, interrupted, options, registeredOverrides) {
|
|
4785
4808
|
const { experimentId, attempts } = session;
|
|
4786
4809
|
const mockStrategy = options?.mock ?? "marked";
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4810
|
+
if (experimentId !== null && fullExperimentUrl !== null) {
|
|
4811
|
+
try {
|
|
4812
|
+
options?.onExperimentStart?.({
|
|
4813
|
+
experimentId,
|
|
4814
|
+
experimentUrl: fullExperimentUrl
|
|
4815
|
+
});
|
|
4816
|
+
} catch {
|
|
4817
|
+
}
|
|
4793
4818
|
}
|
|
4794
4819
|
const resolvedOverrides = [
|
|
4795
4820
|
...normalizeMockOverrides(options?.mockOverride),
|
|
@@ -4931,17 +4956,18 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
|
|
|
4931
4956
|
interrupted
|
|
4932
4957
|
);
|
|
4933
4958
|
const resultItems = [...carriedOverItems, ...ranItems];
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4959
|
+
if (options?.dryRun === true || experimentId === null || fullExperimentUrl === null) {
|
|
4960
|
+
if (experimentId !== null && fullExperimentUrl !== null) {
|
|
4961
|
+
throwIfInterrupted(
|
|
4962
|
+
interrupted,
|
|
4963
|
+
resultItems,
|
|
4964
|
+
experimentId,
|
|
4965
|
+
fullExperimentUrl
|
|
4966
|
+
);
|
|
4967
|
+
stopInterruptingOnSignal();
|
|
4968
|
+
await httpClient.completeReplay(experimentId).catch(() => void 0);
|
|
4969
|
+
markCompleteReturned();
|
|
4970
|
+
}
|
|
4945
4971
|
const dryResult = {
|
|
4946
4972
|
items: resultItems,
|
|
4947
4973
|
experimentId,
|
|
@@ -4953,6 +4979,7 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
|
|
|
4953
4979
|
await writeReplayResultFile(dryResult);
|
|
4954
4980
|
return dryResult;
|
|
4955
4981
|
}
|
|
4982
|
+
throwIfInterrupted(interrupted, resultItems, experimentId, fullExperimentUrl);
|
|
4956
4983
|
const deliveredTraceIds = await preserveReplayFailure(
|
|
4957
4984
|
() => waitForReplayPersistence(httpClient, experimentId, replayedTraceIds),
|
|
4958
4985
|
resultItems,
|