@percy/client 1.32.11-beta.0 → 1.32.11-beta.2

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.
Files changed (2) hide show
  1. package/dist/client.js +22 -3
  2. package/package.json +5 -5
package/dist/client.js CHANGED
@@ -277,7 +277,7 @@ export class PercyClient {
277
277
  dropinBaselineCandidate,
278
278
  dropinBaselineSetup
279
279
  } = {}) {
280
- var _this$config$percy2;
280
+ var _this$config$percy2, _this$env$machine;
281
281
  this.log.debug('Creating a new build...');
282
282
  let visualConfig = parseVisualConfigFromEnv(this.log);
283
283
  let source = 'user_created';
@@ -325,6 +325,14 @@ export class PercyClient {
325
325
  'skip-base-build': (_this$config$percy2 = this.config.percy) === null || _this$config$percy2 === void 0 ? void 0 : _this$config$percy2.skipBaseBuild,
326
326
  'testhub-build-uuid': this.env.testhubBuildUuid,
327
327
  'testhub-build-run-id': this.env.testhubBuildRunId,
328
+ // machine identity for slow-build diagnostics (server-validated;
329
+ // percy-api may discard any of these)
330
+ ...((_this$env$machine = this.env.machine) !== null && _this$env$machine !== void 0 && _this$env$machine.id ? {
331
+ 'machine-id': this.env.machine.id,
332
+ 'machine-hostname': this.env.machine.hostname,
333
+ 'machine-ci-run-url': this.env.machine.runUrl,
334
+ 'machine-ci-platform': this.env.machine.platform
335
+ } : {}),
328
336
  ...(dropinBaselineCandidate ? {
329
337
  'dropin-baseline-candidate': true
330
338
  } : {}),
@@ -355,6 +363,17 @@ export class PercyClient {
355
363
  });
356
364
  }
357
365
 
366
+ // Machine-identity header for per-machine liveness on parallel builds.
367
+ // Attached per-call (never in headers()) so it only ever reaches percy.io
368
+ // API endpoints — headers() is also used for off-domain requests.
369
+ machineHeaders() {
370
+ var _this$env$machine2;
371
+ let id = (_this$env$machine2 = this.env.machine) === null || _this$env$machine2 === void 0 ? void 0 : _this$env$machine2.id;
372
+ return id ? {
373
+ 'X-Percy-Machine-Id': id
374
+ } : {};
375
+ }
376
+
358
377
  // Finalizes the active build. When `all` is true, `all-shards=true` is
359
378
  // added as a query param so the API finalizes all other build shards.
360
379
  async finalizeBuild(buildId, {
@@ -365,7 +384,7 @@ export class PercyClient {
365
384
  this.log.debug(`Finalizing build ${buildId}...`);
366
385
  return this.post(`builds/${buildId}/finalize?${qs}`, {}, {
367
386
  identifier: 'build.finalze'
368
- });
387
+ }, this.machineHeaders());
369
388
  }
370
389
 
371
390
  // Retrieves build data by id. Requires a read access token.
@@ -662,7 +681,7 @@ export class PercyClient {
662
681
  }, {
663
682
  identifier: 'snapshot.post',
664
683
  ...meta
665
- });
684
+ }, this.machineHeaders());
666
685
  }
667
686
 
668
687
  // Finalizes a snapshot.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/client",
3
- "version": "1.32.11-beta.0",
3
+ "version": "1.32.11-beta.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,11 +33,11 @@
33
33
  "test:coverage": "yarn test --coverage"
34
34
  },
35
35
  "dependencies": {
36
- "@percy/config": "1.32.11-beta.0",
37
- "@percy/env": "1.32.11-beta.0",
38
- "@percy/logger": "1.32.11-beta.0",
36
+ "@percy/config": "1.32.11-beta.2",
37
+ "@percy/env": "1.32.11-beta.2",
38
+ "@percy/logger": "1.32.11-beta.2",
39
39
  "pac-proxy-agent": "^7.0.2",
40
40
  "pako": "^2.1.0"
41
41
  },
42
- "gitHead": "db20253878f6ee43d2c277698ba021ae41adaa86"
42
+ "gitHead": "a05b0ac1efc0d136fa15c2330b55e1e207c6e797"
43
43
  }