@bitfab/sdk 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-YV2AMMAU.js → chunk-4TIIRIKY.js} +10 -4
- package/dist/{chunk-YV2AMMAU.js.map → chunk-4TIIRIKY.js.map} +1 -1
- package/dist/{chunk-M22HAOF3.js → chunk-7XTWASGH.js} +6 -6
- package/dist/{chunk-M22HAOF3.js.map → chunk-7XTWASGH.js.map} +1 -1
- package/dist/{chunk-46UTCJLC.js → chunk-FD2TNC5C.js} +43 -22
- package/dist/chunk-FD2TNC5C.js.map +1 -0
- package/dist/{chunk-ZNQXQRQF.js → chunk-KMK7HEFM.js} +10 -4
- package/dist/{chunk-ZNQXQRQF.js.map → chunk-KMK7HEFM.js.map} +1 -1
- package/dist/{chunk-VE2QZR7U.js → chunk-U7F4REDE.js} +6 -4
- package/dist/chunk-U7F4REDE.js.map +1 -0
- package/dist/{http-QOBGV3FG.js → http-JI6KQTDS.js} +2 -2
- package/dist/{http-SG4N6LAX.js → http-TACLFEPK.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-JB3WVAYZ.js → replay-NNIJIKKO.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-46UTCJLC.js.map +0 -1
- package/dist/chunk-VE2QZR7U.js.map +0 -1
- /package/dist/{http-QOBGV3FG.js.map → http-JI6KQTDS.js.map} +0 -0
- /package/dist/{http-SG4N6LAX.js.map → http-TACLFEPK.js.map} +0 -0
- /package/dist/{replay-JB3WVAYZ.js.map → replay-NNIJIKKO.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ var __version__, __packageName__;
|
|
|
42
42
|
var init_version_generated = __esm({
|
|
43
43
|
"src/version.generated.ts"() {
|
|
44
44
|
"use strict";
|
|
45
|
-
__version__ = "0.63.
|
|
45
|
+
__version__ = "0.63.3";
|
|
46
46
|
__packageName__ = "@bitfab/sdk";
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -2895,7 +2895,7 @@ var init_http = __esm({
|
|
|
2895
2895
|
* Start a replay session by fetching historical traces.
|
|
2896
2896
|
* Blocking call - creates an experiment and returns lightweight item references.
|
|
2897
2897
|
*/
|
|
2898
|
-
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata) {
|
|
2898
|
+
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun) {
|
|
2899
2899
|
const payload = { traceFunctionKey };
|
|
2900
2900
|
if (experimentalSelectiveReplay !== void 0) {
|
|
2901
2901
|
payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
|
|
@@ -2953,6 +2953,9 @@ var init_http = __esm({
|
|
|
2953
2953
|
if (skipAssertionJudging !== true) {
|
|
2954
2954
|
payload.judgeAssertions = true;
|
|
2955
2955
|
}
|
|
2956
|
+
if (dryRun) {
|
|
2957
|
+
payload.dryRun = true;
|
|
2958
|
+
}
|
|
2956
2959
|
const git = await resolvedGitState();
|
|
2957
2960
|
if (git && !isEmptyGitState(git)) {
|
|
2958
2961
|
payload.git = git;
|
|
@@ -2966,7 +2969,10 @@ var init_http = __esm({
|
|
|
2966
2969
|
const { testRunId, testRunUrl, ...rest } = response;
|
|
2967
2970
|
const experimentId = response.experimentId ?? testRunId;
|
|
2968
2971
|
const experimentUrl = response.experimentUrl ?? testRunUrl;
|
|
2969
|
-
if (
|
|
2972
|
+
if (dryRun && response.experimentId === null) {
|
|
2973
|
+
return { ...rest, experimentId: null, experimentUrl: null };
|
|
2974
|
+
}
|
|
2975
|
+
if (experimentId === void 0 || experimentId === null || experimentUrl === void 0 || experimentUrl === null) {
|
|
2970
2976
|
throw new BitfabError(
|
|
2971
2977
|
"Replay start response is missing the experiment ID or URL."
|
|
2972
2978
|
);
|
|
@@ -4302,7 +4308,7 @@ async function processItem(httpClient, serverItem, fn, experimentId, mockStrateg
|
|
|
4302
4308
|
const originalTraceId = serverItem.originalTraceId ?? serverItem.sourceTraceId;
|
|
4303
4309
|
const originalSpanId = serverItem.originalSpanId ?? serverItem.sourceSpanId;
|
|
4304
4310
|
try {
|
|
4305
|
-
if (includeDbBranchLease && !lease && !leaseError) {
|
|
4311
|
+
if (includeDbBranchLease && experimentId !== null && !lease && !leaseError) {
|
|
4306
4312
|
let resolved2;
|
|
4307
4313
|
try {
|
|
4308
4314
|
resolved2 = await httpClient.resolveDbBranchLease(
|
|
@@ -4396,7 +4402,7 @@ async function processItem(httpClient, serverItem, fn, experimentId, mockStrateg
|
|
|
4396
4402
|
}
|
|
4397
4403
|
return pending;
|
|
4398
4404
|
} : void 0;
|
|
4399
|
-
if (dryRun) {
|
|
4405
|
+
if (dryRun || experimentId === null) {
|
|
4400
4406
|
return {
|
|
4401
4407
|
traceId: null,
|
|
4402
4408
|
originalTraceId,
|
|
@@ -4684,7 +4690,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4684
4690
|
options?.skipAssertionJudging === true || options?.judgeAssertions === false,
|
|
4685
4691
|
options?.experimentalSelectiveReplay,
|
|
4686
4692
|
options?.notes,
|
|
4687
|
-
options?.metadata
|
|
4693
|
+
options?.metadata,
|
|
4694
|
+
options?.dryRun === true
|
|
4688
4695
|
);
|
|
4689
4696
|
if (started.items.length === 0) {
|
|
4690
4697
|
try {
|
|
@@ -4714,6 +4721,22 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4714
4721
|
);
|
|
4715
4722
|
}
|
|
4716
4723
|
const { experimentId } = session;
|
|
4724
|
+
if (experimentId === null || session.experimentUrl === null) {
|
|
4725
|
+
return runReplaySession(
|
|
4726
|
+
httpClient,
|
|
4727
|
+
fn,
|
|
4728
|
+
session,
|
|
4729
|
+
null,
|
|
4730
|
+
maxConcurrency,
|
|
4731
|
+
() => {
|
|
4732
|
+
},
|
|
4733
|
+
() => {
|
|
4734
|
+
},
|
|
4735
|
+
() => false,
|
|
4736
|
+
options,
|
|
4737
|
+
registeredOverrides
|
|
4738
|
+
);
|
|
4739
|
+
}
|
|
4717
4740
|
const fullExperimentUrl = `${serviceUrl}${session.experimentUrl}`;
|
|
4718
4741
|
const heartbeat = startReplayHeartbeat(
|
|
4719
4742
|
() => httpClient.heartbeatReplay(experimentId)
|
|
@@ -4775,12 +4798,14 @@ function throwIfInterrupted(interrupted, items, experimentId, experimentUrl) {
|
|
|
4775
4798
|
async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxConcurrency, stopInterruptingOnSignal, markCompleteReturned, interrupted, options, registeredOverrides) {
|
|
4776
4799
|
const { experimentId, attempts } = session;
|
|
4777
4800
|
const mockStrategy = options?.mock ?? "marked";
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4801
|
+
if (experimentId !== null && fullExperimentUrl !== null) {
|
|
4802
|
+
try {
|
|
4803
|
+
options?.onExperimentStart?.({
|
|
4804
|
+
experimentId,
|
|
4805
|
+
experimentUrl: fullExperimentUrl
|
|
4806
|
+
});
|
|
4807
|
+
} catch {
|
|
4808
|
+
}
|
|
4784
4809
|
}
|
|
4785
4810
|
const resolvedOverrides = [
|
|
4786
4811
|
...normalizeMockOverrides(options?.mockOverride),
|
|
@@ -4922,17 +4947,18 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
|
|
|
4922
4947
|
interrupted
|
|
4923
4948
|
);
|
|
4924
4949
|
const resultItems = [...carriedOverItems, ...ranItems];
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4950
|
+
if (options?.dryRun === true || experimentId === null || fullExperimentUrl === null) {
|
|
4951
|
+
if (experimentId !== null && fullExperimentUrl !== null) {
|
|
4952
|
+
throwIfInterrupted(
|
|
4953
|
+
interrupted,
|
|
4954
|
+
resultItems,
|
|
4955
|
+
experimentId,
|
|
4956
|
+
fullExperimentUrl
|
|
4957
|
+
);
|
|
4958
|
+
stopInterruptingOnSignal();
|
|
4959
|
+
await httpClient.completeReplay(experimentId).catch(() => void 0);
|
|
4960
|
+
markCompleteReturned();
|
|
4961
|
+
}
|
|
4936
4962
|
const dryResult = {
|
|
4937
4963
|
items: resultItems,
|
|
4938
4964
|
experimentId,
|
|
@@ -4944,6 +4970,7 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
|
|
|
4944
4970
|
await writeReplayResultFile(dryResult);
|
|
4945
4971
|
return dryResult;
|
|
4946
4972
|
}
|
|
4973
|
+
throwIfInterrupted(interrupted, resultItems, experimentId, fullExperimentUrl);
|
|
4947
4974
|
const deliveredTraceIds = await preserveReplayFailure(
|
|
4948
4975
|
() => waitForReplayPersistence(httpClient, experimentId, replayedTraceIds),
|
|
4949
4976
|
resultItems,
|