story 2-13-importplan-re-import: implemented and reviewed via bmad-loop
This commit is contained in:
1 parent
c562d5368d
commit
f69c36fa65
66 files changed
+11366
-686
No files matched your search
@@ -687,6 +687,94 @@ impl From<RegistryError> for ApiError {
|
||||
format!("import job {job_id} was already applied with different parameters"),
|
||||
json!({ "job_id": job_id }),
|
||||
),
|
||||
RegistryError::InvalidImportPlan { field } => Self::validation_with_context(
|
||||
format!("invalid import plan input for field {field}"),
|
||||
json!({
|
||||
"field": field,
|
||||
"error_code": "import_plan_invalid_input"
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanConflict { plan_id } => Self::conflict_with_context(
|
||||
format!("import plan {plan_id} already exists with different material"),
|
||||
json!({
|
||||
"plan_id": plan_id,
|
||||
"error_code": "import_plan_conflict",
|
||||
"recovery": "repreview_required"
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanJobUnavailable { job_id } => Self::not_found_with_context(
|
||||
format!("import job {job_id} is unavailable for planning"),
|
||||
json!({ "job_id": job_id, "error_code": "import_plan_job_unavailable" }),
|
||||
),
|
||||
RegistryError::ImportPlanJobTerminal { job_id }
|
||||
| RegistryError::ImportPlanJobExpired { job_id } => Self::conflict_with_context(
|
||||
format!("import job {job_id} is not in planning state"),
|
||||
json!({
|
||||
"job_id": job_id,
|
||||
"error_code": "import_plan_job_terminal",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanNotFound { .. } => Self::not_found_with_context(
|
||||
"import plan was not found in this workspace",
|
||||
json!({ "error_code": "import_plan_not_found" }),
|
||||
),
|
||||
RegistryError::ImportPlanExpired { .. } => Self::conflict_with_context(
|
||||
"import plan has expired; create a fresh preview",
|
||||
json!({
|
||||
"error_code": "import_plan_expired",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanPayloadCorrupt { .. } => Self::conflict_with_context(
|
||||
"import plan is invalid; create a fresh preview",
|
||||
json!({
|
||||
"error_code": "import_plan_payload_invalid",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanFingerprintStale { .. } => Self::conflict_with_context(
|
||||
"import plan no longer matches the verified preview; create a fresh preview",
|
||||
json!({
|
||||
"error_code": "import_plan_fingerprint_stale",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanKeyDigestConflict { .. } => Self::conflict_with_context(
|
||||
"idempotency key was already committed for different plan material",
|
||||
json!({
|
||||
"error_code": "import_plan_key_digest_conflict",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanNameConflict { .. } => Self::conflict_with_context(
|
||||
"an operation name changed after the plan was created",
|
||||
json!({
|
||||
"error_code": "import_plan_name_conflict",
|
||||
"recovery": "confirm_skip_rename_or_new_version"
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanTargetStale { .. } => Self::conflict_with_context(
|
||||
"an operation changed after the plan was created; create a fresh preview",
|
||||
json!({
|
||||
"error_code": "import_plan_target_stale",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::ImportPlanAuthUnavailable { .. } => Self::conflict_with_context(
|
||||
"an authentication profile is unavailable; create a fresh preview",
|
||||
json!({
|
||||
"error_code": "import_plan_auth_unavailable",
|
||||
"recovery": "repreview_required",
|
||||
"repreview_required": true
|
||||
}),
|
||||
),
|
||||
RegistryError::SourceNotFound { .. } => Self::not_found_with_context(
|
||||
"artifact source was not found",
|
||||
json!({
|
||||
|
||||
Reference in new issue
Block a user