chore(review): 1103 release·CI·성능 조치 브랜치를 합친다
Refs: docs/reviews/2026-11-03-maturity-review/README.md 12-07 13-01~13-03 13-05 15-02~15-07 # Conflicts: # docs/manual/03-outside-feature-folder.md # docs/operations/performance-evidence.md # scripts/lib/hosting-probe.ts
This commit is contained in:
@@ -100,11 +100,20 @@ if (liveTarget?.passed && !slotEmpty) {
|
||||
),
|
||||
);
|
||||
const candidateManifest = await readFile(path.join(distRoot, "release-manifest.json"), "utf8").catch(() => null);
|
||||
const candidate = releaseIdentity(candidateManifest);
|
||||
if (!candidate) {
|
||||
const identity = releaseIdentity(candidateManifest);
|
||||
if (!identity) {
|
||||
throw new Error(`${distRoot}/release-manifest.json does not name a buildId and releaseId`);
|
||||
}
|
||||
const probed = await probeLiveRelease(liveTarget.url, paths, candidate);
|
||||
// 1103/13-01. The served config.json and index.html are compared with the
|
||||
// candidate's, not only the manifest names a rebuild in the same run shares.
|
||||
const candidate = {
|
||||
...identity,
|
||||
runtimeConfig: await readFile(path.join(distRoot, "config.json"), "utf8"),
|
||||
indexHtml: await readFile(path.join(distRoot, "index.html"), "utf8"),
|
||||
};
|
||||
const probed = await probeLiveRelease(liveTarget.url, paths, candidate, {
|
||||
alpnProtocols: strings(recordValue(cachePolicy.transport).alpnProtocols),
|
||||
});
|
||||
responses = probed.responses;
|
||||
probeResults.push(...probed.results);
|
||||
// 1103/06-03. The worker needs every precached asset kind typed exactly.
|
||||
@@ -151,6 +160,19 @@ for (const [surface, policy] of requiredSurfaces) {
|
||||
observed: observedContentType,
|
||||
passed: observedMime !== undefined && contentTypes.includes(observedMime),
|
||||
});
|
||||
// 1103/13-02. The bundle budget counts gzip bytes. The probe's fetch offers
|
||||
// br and gzip, so an uncompressed answer is the host's choice.
|
||||
const contentEncodings = strings(policy.contentEncodings);
|
||||
if (contentEncodings.length > 0) {
|
||||
const observedEncoding = responses[surface]?.["content-encoding"];
|
||||
results.push({
|
||||
surface,
|
||||
header: "content-encoding",
|
||||
expected: contentEncodings,
|
||||
observed: observedEncoding,
|
||||
passed: observedEncoding !== undefined && contentEncodings.includes(observedEncoding.trim().toLowerCase()),
|
||||
});
|
||||
}
|
||||
if (policy.securityHeaders === true) {
|
||||
for (const [header, expected] of Object.entries(securityHeaders)) {
|
||||
const observedSecurity = responses[surface]?.[header.toLowerCase()];
|
||||
@@ -207,7 +229,7 @@ if (status === "FAIL") {
|
||||
}
|
||||
if (status === "UNVERIFIED" && slotEmpty) {
|
||||
process.stderr.write(
|
||||
"Hosting header contract: UNVERIFIED (the deployment slot is empty: nothing deployed this release, so the host was not probed; fill the deployment job in config/ci/gates.json)\n",
|
||||
"Hosting header contract: UNVERIFIED (the deployment slot is empty: nothing deployed this release, so the host was not probed; fill deployment in config/ci/product-gates.json)\n",
|
||||
);
|
||||
process.exit(3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user