fix(release):完善当前分发证明与质量门禁
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-14 06:39:47 +08:00
parent c17904ee1c
commit 13b0bd5b45
39 changed files with 1590 additions and 228 deletions
+20 -1
View File
@@ -24,12 +24,14 @@ func TestRustContractFixturesPreserveGoMirror(t *testing.T) {
availableRaw := readContractFixture(t, "catalog-status.available.json")
unavailableRaw := readContractFixture(t, "catalog-status.unavailable.json")
manifestRaw := readContractFixture(t, "resource-manifest.page0.json")
attestationRaw := readContractFixture(t, "release-attestation.json")
snapshotRaw := readContractFixture(t, "official-sync-snapshot.json")
for name, raw := range map[string][]byte{
"catalog available": availableRaw,
"catalog unavailable": unavailableRaw,
"resource manifest": manifestRaw,
"attestation": attestationRaw,
"snapshot": snapshotRaw,
} {
if bytes.Contains(raw, []byte("/tmp/")) {
@@ -71,7 +73,12 @@ func TestRustContractFixturesPreserveGoMirror(t *testing.T) {
if err := json.Unmarshal(manifestRaw, &manifest); err != nil {
t.Fatalf("decode resource manifest: %v", err)
}
if !manifest.Available || manifest.ManifestVersion != 1 || manifest.TotalEntries != 2 {
if !manifest.Available || manifest.Channel != "official" ||
manifest.ManifestVersion != 1 || manifest.TotalEntries != 2 ||
manifest.ReleaseID != "${VERSION_ID}" ||
manifest.PublicationIdentity != "${PUBLICATION_IDENTITY}" ||
manifest.ManifestIdentity != "${MANIFEST_IDENTITY}" ||
manifest.Generation != 7 {
t.Fatalf("manifest header=%+v", manifest)
}
if len(manifest.Entries) != 2 {
@@ -84,6 +91,18 @@ func TestRustContractFixturesPreserveGoMirror(t *testing.T) {
t.Fatalf("manifest first entry=%+v", manifest.Entries[0])
}
var attestation backendrpc.DistributionAttestation
if err := json.Unmarshal(attestationRaw, &attestation); err != nil {
t.Fatalf("decode attestation: %v", err)
}
if !attestation.Available || !attestation.Ready ||
attestation.ReleaseID != "${VERSION_ID}" ||
attestation.ManifestIdentity != "${MANIFEST_IDENTITY}" ||
attestation.VerificationGeneration != 7 ||
attestation.VerifiedAt == nil || *attestation.VerifiedAt != 1000 {
t.Fatalf("attestation=%+v", attestation)
}
var snapshot struct {
AppVersion string `json:"app_version"`
BundleVersion string `json:"bundle_version"`