hillclimb 0.9.1 → 0.9.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.
- package/dist/main.js +12 -6
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -568,7 +568,7 @@ var PlatformClient = class {
|
|
|
568
568
|
const sizeBytes = body.kind === "buffer" ? body.buffer.length : body.sizeBytes;
|
|
569
569
|
const prefix = `/api/v1/contributions/${encodeURIComponent(contributionId)}`;
|
|
570
570
|
let digest;
|
|
571
|
-
const verify = async (uploadId) => {
|
|
571
|
+
const verify = async (uploadId, options = {}) => {
|
|
572
572
|
if (digest === void 0) {
|
|
573
573
|
const hash = createHash("sha256");
|
|
574
574
|
let localSize = 0;
|
|
@@ -590,7 +590,8 @@ var PlatformClient = class {
|
|
|
590
590
|
return this.verifyReplayArtifact(
|
|
591
591
|
`${prefix}/uploads/${encodeURIComponent(uploadId)}/download`,
|
|
592
592
|
sizeBytes,
|
|
593
|
-
digest
|
|
593
|
+
digest,
|
|
594
|
+
options
|
|
594
595
|
);
|
|
595
596
|
};
|
|
596
597
|
const put = async (target2) => {
|
|
@@ -642,7 +643,7 @@ var PlatformClient = class {
|
|
|
642
643
|
"UPLOAD_REPLAY_MISMATCH"
|
|
643
644
|
);
|
|
644
645
|
}
|
|
645
|
-
const verified = await verify(existing.id);
|
|
646
|
+
const verified = await verify(existing.id, { forbiddenIsAbsent: true });
|
|
646
647
|
if (verified.exists) return;
|
|
647
648
|
target = await this.request(
|
|
648
649
|
"POST",
|
|
@@ -665,7 +666,7 @@ var PlatformClient = class {
|
|
|
665
666
|
}
|
|
666
667
|
await put(target);
|
|
667
668
|
}
|
|
668
|
-
async verifyReplayArtifact(relative, sizeBytes, expectedDigest) {
|
|
669
|
+
async verifyReplayArtifact(relative, sizeBytes, expectedDigest, options = {}) {
|
|
669
670
|
const redirect = await fetch(this.url(relative), {
|
|
670
671
|
headers: this.headers(),
|
|
671
672
|
redirect: "manual",
|
|
@@ -708,8 +709,13 @@ var PlatformClient = class {
|
|
|
708
709
|
} catch {
|
|
709
710
|
throw new PlatformError("Stored artifact verification request failed");
|
|
710
711
|
}
|
|
711
|
-
if (response.status === 404) {
|
|
712
|
+
if (response.status === 404 || response.status === 403 && options.forbiddenIsAbsent) {
|
|
712
713
|
await response.body?.cancel();
|
|
714
|
+
if (response.status === 403)
|
|
715
|
+
appendLog(
|
|
716
|
+
"info",
|
|
717
|
+
"upload-replay: storage refused the pending artifact (403); treating it as never written and letting the guarded PUT decide"
|
|
718
|
+
);
|
|
713
719
|
return { exists: false, url: location };
|
|
714
720
|
}
|
|
715
721
|
if (!response.ok) {
|
|
@@ -16831,7 +16837,7 @@ async function uploadArtifact(client, contributionId, filename, mimeType, buffer
|
|
|
16831
16837
|
}
|
|
16832
16838
|
|
|
16833
16839
|
// package.json
|
|
16834
|
-
var version = "0.9.
|
|
16840
|
+
var version = "0.9.2";
|
|
16835
16841
|
|
|
16836
16842
|
// src/version.ts
|
|
16837
16843
|
var CLI_VERSION = version;
|