feat(registry): add workspace-scoped artifact metadata

This commit is contained in:
2026-08-27 02:18:09 +03:00
parent 497e1b740f
commit 2eb185b14a
29 changed files with 2264 additions and 181 deletions
+30
View File
@@ -588,6 +588,36 @@ impl From<RegistryError> for ApiError {
format!("import job {job_id} was already applied with different parameters"),
json!({ "job_id": job_id }),
),
RegistryError::SourceNotFound { source_id } => Self::not_found_with_context(
"artifact source was not found",
json!({
"source_id": source_id,
"error_code": "artifact_source_not_found"
}),
),
RegistryError::SourceConflict { source_id } => Self::conflict_with_context(
"artifact source metadata or lifecycle conflicts with the request",
json!({
"source_id": source_id,
"error_code": "artifact_source_conflict",
"recovery": "reload"
}),
),
RegistryError::SourceUnavailable => Self::unprocessable_with_context(
"artifact source is unavailable",
json!({ "error_code": "artifact_source_unavailable" }),
),
RegistryError::SourceIntegrity => Self::unprocessable_with_context(
"artifact source failed integrity verification",
json!({ "error_code": "artifact_source_integrity" }),
),
RegistryError::InvalidArtifactSource { field } => Self::validation_with_context(
"artifact source metadata is invalid",
json!({
"field": field,
"error_code": "artifact_source_invalid"
}),
),
RegistryError::Storage(_) => Self::internal("registry operation failed"),
RegistryError::Migration(_)
| RegistryError::Serialization(_)
+2 -2
View File
@@ -40,7 +40,7 @@ fn plan_is_deterministic_and_committed_contract_is_current() {
);
assert_eq!(first.stdout, second.stdout);
let plan: serde_json::Value = serde_json::from_slice(&first.stdout).unwrap();
assert_eq!(plan["sequence"].as_array().unwrap().len(), 11);
assert_eq!(plan["sequence"].as_array().unwrap().len(), 12);
let checked = command(&["plan", "--check"], None);
assert!(
@@ -82,7 +82,7 @@ async fn database_only_config_can_apply_and_preflight_a_fresh_schema() {
);
let result: serde_json::Value = serde_json::from_slice(&preflight.stdout).unwrap();
assert_eq!(result["status"], "current");
assert_eq!(result["version"], 11);
assert_eq!(result["version"], 12);
}
#[tokio::test]