@bitfab/sdk 0.64.5 → 0.64.7

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/cloudReplay.py CHANGED
@@ -33,6 +33,8 @@ API_VERSION = "2026-03-10"
33
33
  REPLAY_COMMAND_ENV = "BITFAB_REPLAY_COMMAND"
34
34
  SDK_LANGUAGE_ENV = "BITFAB_SDK_LANGUAGE"
35
35
  CHECK_COMMAND_ENV = "BITFAB_REPLAY_CHECK"
36
+ EXECUTION_TARGET_ENV = "BITFAB_REPLAY_EXECUTION_TARGET"
37
+ HOSTED_EXECUTION_TARGET = "hosted"
36
38
  REQUEST_VERSION = 3
37
39
  OLDEST_DISPATCHED_VERSION = 2
38
40
  RESULT_LINE = "bitfab-replay-result "
@@ -169,6 +171,9 @@ fullOutput (true) match --cloud-timeout and --cloud-full-output. version and id
169
171
  optional: version names the request format (3 now, 2 still accepted), and id is the
170
172
  execution UUID, which must match an execution_id input when the workflow has one.
171
173
 
174
+ The runner's job exits with the replay's exit code, so the Actions run fails when
175
+ the replay does. Traces that errored fail it only under --fail-on-error.
176
+
172
177
  Follow a replay by the execution UUID it prints:
173
178
  --cloud-watch ID | --cloud-status ID | --cloud-cancel ID | --cloud-cleanup ID
174
179
 
@@ -1727,12 +1732,18 @@ def annotate(result):
1727
1732
  if result.get("stoppedEarly"):
1728
1733
  message = f"Replay stopped early: {result['stoppedEarly']}"
1729
1734
  elif result["exitCode"]:
1730
- message = f"Replay exited {result['exitCode']}; bitfab-replay --cloud reports it as its own exit code"
1735
+ message = f"Replay exited {result['exitCode']}, so this job exits with it too"
1731
1736
  else:
1732
1737
  return
1733
1738
  print(f"::warning title=Bitfab replay::{message}", flush=True)
1734
1739
 
1735
1740
 
1741
+ def runner_exit_code(result):
1742
+ if result.get("stoppedEarly"):
1743
+ return result["exitCode"] or 1
1744
+ return result["exitCode"]
1745
+
1746
+
1736
1747
  def summary_markdown(result):
1737
1748
  summary = result_summary(result["stdout"]) or {}
1738
1749
  counts = summary.get("counts", {})
@@ -1767,6 +1778,7 @@ def run_command(directory, args, timeout, experiment, *, summarize=True):
1767
1778
  with subprocess.Popen(
1768
1779
  args,
1769
1780
  cwd=directory,
1781
+ env={**os.environ, EXECUTION_TARGET_ENV: HOSTED_EXECUTION_TARGET},
1770
1782
  stdout=output,
1771
1783
  stderr=subprocess.PIPE,
1772
1784
  stdin=subprocess.DEVNULL,
@@ -2200,8 +2212,9 @@ def main():
2200
2212
  print_json(configure_secrets(argv[1:]))
2201
2213
  return 0
2202
2214
  if argv == ["--cloud-execute"]:
2203
- annotate(execute())
2204
- return 0
2215
+ result = execute()
2216
+ annotate(result)
2217
+ return runner_exit_code(result)
2205
2218
  if "-h" in argv or "--help" in argv:
2206
2219
  print(HELP, end="")
2207
2220
  return 0
@@ -189,7 +189,7 @@ function encodeRequestBody(body) {
189
189
  }
190
190
 
191
191
  // src/version.generated.ts
192
- var __version__ = "0.64.5";
192
+ var __version__ = "0.64.7";
193
193
  var __packageName__ = "@bitfab/sdk";
194
194
 
195
195
  // src/constants.ts
@@ -2615,7 +2615,7 @@ var HttpClient = class {
2615
2615
  * Start a replay session by fetching historical traces.
2616
2616
  * Blocking call - creates an experiment and returns lightweight item references.
2617
2617
  */
2618
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun) {
2618
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata, dryRun, invocation) {
2619
2619
  const payload = { traceFunctionKey };
2620
2620
  if (experimentalSelectiveReplay !== void 0) {
2621
2621
  payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
@@ -2676,6 +2676,9 @@ var HttpClient = class {
2676
2676
  if (dryRun) {
2677
2677
  payload.dryRun = true;
2678
2678
  }
2679
+ if (invocation !== void 0) {
2680
+ payload.invocation = invocation;
2681
+ }
2679
2682
  const git = await resolvedGitState();
2680
2683
  if (git && !isEmptyGitState(git)) {
2681
2684
  payload.git = git;
@@ -2946,4 +2949,4 @@ export {
2946
2949
  HttpClient,
2947
2950
  experimentIdWireFields
2948
2951
  };
2949
- //# sourceMappingURL=chunk-6WC55EAH.js.map
2952
+ //# sourceMappingURL=chunk-54JYZXMF.js.map