fix(openapi): harden story 2.1 production lifecycle
CI / Rust Checks (push) Failing after 4m6s
CI / UI Checks (push) Has been skipped
CI / Frontend E2E (push) Has been skipped
CI / Community Image Smoke (push) Has been skipped
CI / Deploy (push) Has been skipped

This commit is contained in:
2026-08-29 00:48:22 +03:00
parent 2c94af6791
commit bc03c33387
46 changed files with 2198 additions and 276 deletions
@@ -329,6 +329,16 @@ async fn source_relations_are_scoped_replayable_pageable_and_detachable() {
.await
.unwrap();
assert_eq!(retry, detached);
let unconditional_retry = registry
.detach_artifact_source(DetachArtifactSourceRequest {
workspace_id: &workspace_a,
source_id: &source_id,
expected_updated_at: None,
detached_at: timestamp("2026-08-26T10:05:00Z"),
})
.await
.unwrap();
assert_eq!(unconditional_retry, detached);
assert!(matches!(
registry
.detach_artifact_source(DetachArtifactSourceRequest {
@@ -350,7 +360,7 @@ async fn source_relations_are_scoped_replayable_pageable_and_detachable() {
);
assert!(matches!(
registry
.read_artifact_source(&store, &workspace_a, &source_id)
.read_artifact_source(std::sync::Arc::new(store.clone()), &workspace_a, &source_id)
.await,
Err(RegistryError::SourceUnavailable)
));
@@ -439,7 +449,7 @@ async fn verified_read_returns_only_digest_and_size_verified_bytes() {
.await
.unwrap();
let verified = registry
.read_artifact_source(&store, &workspace_id, &valid_id)
.read_artifact_source(std::sync::Arc::new(store.clone()), &workspace_id, &valid_id)
.await
.unwrap();
assert_eq!(verified.bytes, bytes);
@@ -473,7 +483,11 @@ async fn verified_read_returns_only_digest_and_size_verified_bytes() {
.unwrap();
assert!(matches!(
registry
.read_artifact_source(&store, &workspace_id, &missing_id)
.read_artifact_source(
std::sync::Arc::new(store.clone()),
&workspace_id,
&missing_id
)
.await,
Err(RegistryError::SourceUnavailable)
));
@@ -504,7 +518,11 @@ async fn verified_read_returns_only_digest_and_size_verified_bytes() {
.unwrap();
assert!(matches!(
registry
.read_artifact_source(&store, &workspace_id, &wrong_size_id)
.read_artifact_source(
std::sync::Arc::new(store.clone()),
&workspace_id,
&wrong_size_id
)
.await,
Err(RegistryError::SourceIntegrity)
));
@@ -529,7 +547,11 @@ async fn verified_read_returns_only_digest_and_size_verified_bytes() {
.unwrap();
assert!(matches!(
registry
.read_artifact_source(&store, &workspace_id, &unavailable_id)
.read_artifact_source(
std::sync::Arc::new(store.clone()),
&workspace_id,
&unavailable_id
)
.await,
Err(RegistryError::SourceUnavailable)
));
@@ -543,7 +565,7 @@ async fn verified_read_returns_only_digest_and_size_verified_bytes() {
fs::write(&tampered, vec![b'x'; bytes.len()]).unwrap();
assert!(matches!(
registry
.read_artifact_source(&store, &workspace_id, &valid_id)
.read_artifact_source(std::sync::Arc::new(store.clone()), &workspace_id, &valid_id)
.await,
Err(RegistryError::SourceIntegrity)
));
@@ -749,12 +771,16 @@ async fn reconciliation_claims_are_fenced_global_and_allow_verified_revival() {
.unwrap(),
ArtifactClaimOutcome::ActiveReference
));
let detached_at: OffsetDateTime = sqlx::query_scalar("select clock_timestamp()")
.fetch_one(registry.pool())
.await
.unwrap();
registry
.detach_artifact_source(DetachArtifactSourceRequest {
workspace_id: &workspace_b,
source_id: &active_id,
expected_updated_at: Some(active.updated_at),
detached_at: timestamp("2026-08-27T10:02:00Z"),
detached_at,
})
.await
.unwrap();