mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 10:31:20 -08:00
feat(release): [CI-NPM-03] add read-only registry recovery checks
This commit is contained in:
1 parent
783d1e3fd4
commit
5795492f0f
13 files changed
+570
-7
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import type { LedgerSnapshot } from './bundle.ts'
|
||||
import type { BundleExpectation } from './verify.ts'
|
||||
import assert from 'node:assert/strict'
|
||||
import { buildLedger } from '../../refactor/scripts/release-ledger.mjs'
|
||||
import { assessRegistry, observeRegistry, registry } from './registry.ts'
|
||||
import { verifyReleaseBundle } from './verify.ts'
|
||||
|
||||
// The CLI supplies a clean-source inspector. Test seams never enter CLI inputs.
|
||||
export async function checkReleaseRegistry(repository: string, directory: string, expected: BundleExpectation, inspect: (repository: string, names: string[]) => LedgerSnapshot = buildLedger, fetcher: typeof fetch = fetch) {
|
||||
const verified = verifyReleaseBundle(repository, directory, expected, inspect)
|
||||
const startedAt = new Date().toISOString()
|
||||
const packages = []
|
||||
for (const candidate of verified.packages)
|
||||
packages.push(assessRegistry(candidate, expected.tag, await observeRegistry(candidate.name, fetcher)))
|
||||
assert.deepEqual(verifyReleaseBundle(repository, directory, expected, inspect), verified, 'Candidate bundle changed during registry lookup')
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
sourceCommit: verified.sourceCommit,
|
||||
manifestSha256: verified.manifestSha256,
|
||||
registry,
|
||||
tag: expected.tag,
|
||||
startedAt,
|
||||
finishedAt: new Date().toISOString(),
|
||||
packages,
|
||||
conflicts: packages.filter(item => item.state === 'conflict').map(item => item.name),
|
||||
contentVerified: true,
|
||||
workflowProvenanceVerified: false,
|
||||
publicationAuthorized: false,
|
||||
limitations: ['Read-only metadata observations, not downloaded registry tarball verification or publish permission.', 'Registry state can change immediately; recheck at authorized use time.', 'Not-observed versions may have been unpublished and cannot necessarily be reused.', 'Never execute this report as a publication or tag-change command.'],
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user