Skip to content

Commit 8a84a40

Browse files
committed
[Pages] Hold for missing public product records
1 parent f914843 commit 8a84a40

4 files changed

Lines changed: 28 additions & 14 deletions

File tree

‎abi/staging/request-policy.generated.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎abi/staging/request-policy.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
schema = 1
22
kind = "kandelo-abi-staging-request-policy"
3-
version = 28
3+
version = 29
44
issuer_repository = "Automattic/kandelo"
55
issuer_workflow = ".github/workflows/abi-staging-request-feed.yml"
66
automatic_same_repository = true

‎scripts/abi-staging-pages-producer.test.ts‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
discoverCandidateProductAuthority,
3232
heldPagesReadinessRecord,
3333
immutableRecordReferencesFromTags,
34-
isAbsentPublicAdmissionTagInventory,
34+
isAbsentPublicPagesRecordTagInventory,
3535
isExpectedCurrentInputUnavailable,
3636
producePagesArtifacts,
3737
readCandidateProductAuthority,
@@ -55,11 +55,11 @@ const source = {
5555
};
5656
const targetAbi = { version: 18, snapshot_sha256: "3".repeat(64) };
5757

58-
test("treats only an anonymously absent canonical admission repository as empty", () => {
58+
test("treats only anonymously absent Pages record repositories as empty", () => {
5959
const repository =
6060
"ghcr.io/kandelo-dev/homebrew-tap-core-abi-43/dash/admissions";
6161
assert.equal(
62-
isAbsentPublicAdmissionTagInventory(
62+
isAbsentPublicPagesRecordTagInventory(
6363
repository,
6464
new Error(
6565
"OCI tag inventory anonymous read failed: Error response from registry: " +
@@ -69,7 +69,17 @@ test("treats only an anonymously absent canonical admission repository as empty"
6969
true,
7070
);
7171
assert.equal(
72-
isAbsentPublicAdmissionTagInventory(
72+
isAbsentPublicPagesRecordTagInventory(
73+
"ghcr.io/kandelo-dev/homebrew-tap-core-abi-43-candidates/products/browser-main-shell",
74+
new Error(
75+
"OCI tag inventory anonymous read failed: Error response from registry: " +
76+
"denied: requested access to the resource is denied\n",
77+
),
78+
),
79+
true,
80+
);
81+
assert.equal(
82+
isAbsentPublicPagesRecordTagInventory(
7383
"ghcr.io/kandelo-dev/homebrew-tap-core-abi-43-candidates/dash",
7484
new Error(
7585
"OCI tag inventory anonymous read failed: Error response from registry: " +
@@ -79,7 +89,7 @@ test("treats only an anonymously absent canonical admission repository as empty"
7989
false,
8090
);
8191
assert.equal(
82-
isAbsentPublicAdmissionTagInventory(
92+
isAbsentPublicPagesRecordTagInventory(
8393
repository,
8494
new Error("OCI tag inventory anonymous read failed: request timed out"),
8595
),

‎scripts/abi-staging-pages-producer.ts‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,11 +1705,11 @@ function createAnonymousOciAuthority(): ProductionOciAuthority {
17051705
], MAX_DOCUMENT_BYTES, "OCI tag inventory");
17061706
} catch (error) {
17071707
// GHCR reports an as-yet-uncreated public nested package as `denied`,
1708-
// not as an empty tag inventory. For an exact admission repository,
1708+
// not as an empty tag inventory. For an exact Pages record repository,
17091709
// anonymous inaccessibility means there is no publicly consumable
1710-
// admission. Preserve that as the normal hold-only state; manifest
1711-
// and blob reads remain exact and fail closed.
1712-
if (isAbsentPublicAdmissionTagInventory(repository, error)) return [];
1710+
// candidate or admission. Preserve that as the normal hold-only state;
1711+
// manifest and blob reads remain exact and fail closed.
1712+
if (isAbsentPublicPagesRecordTagInventory(repository, error)) return [];
17131713
throw error;
17141714
}
17151715
const value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(output));
@@ -1788,13 +1788,17 @@ function createAnonymousOciAuthority(): ProductionOciAuthority {
17881788
};
17891789
}
17901790

1791-
export function isAbsentPublicAdmissionTagInventory(
1791+
export function isAbsentPublicPagesRecordTagInventory(
17921792
repository: string,
17931793
error: unknown,
17941794
): boolean {
17951795
return (
1796-
/^ghcr\.io\/kandelo-dev\/homebrew-tap-core-abi-[1-9][0-9]*\/[a-z0-9._-]+\/admissions$/u
1797-
.test(repository) &&
1796+
(
1797+
/^ghcr\.io\/kandelo-dev\/homebrew-tap-core-abi-[1-9][0-9]*\/[a-z0-9._-]+\/admissions$/u
1798+
.test(repository) ||
1799+
/^ghcr\.io\/kandelo-dev\/homebrew-tap-core-abi-[1-9][0-9]*-candidates\/products\/[a-z0-9._-]+$/u
1800+
.test(repository)
1801+
) &&
17981802
error instanceof Error &&
17991803
/^OCI tag inventory anonymous read failed: Error response from registry: denied: requested access to the resource is denied\s*$/u
18001804
.test(error.message)

0 commit comments

Comments
 (0)