diff --git a/Pipfile.lock b/Pipfile.lock index c9be4bb..d2edf54 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -933,12 +933,12 @@ }, "stage0-py-utils": { "hashes": [ - "sha256:03ae6b101e0f5dcbce47d605509fb47d0ee86ef86e2630fa6685caf0cd7174eb", - "sha256:bfa1a42bf0fe4e942abced9c489e6f2564ceb504b88d77fdfb0c5b66aa3f27ea" + "sha256:23fb80f78dc3e009c8ac22c207f19be06ca3d37f97f536e851bdb84a7edc8a87", + "sha256:fa34fb9e777914c11d77cd1df462cbc0e7365e02faca9bd201995e28158f8651" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==0.2.14" + "version": "==0.2.15" }, "typing-extensions": { "hashes": [ diff --git a/stage0_mongodb_api/managers/config_manager.py b/stage0_mongodb_api/managers/config_manager.py index add897c..821d69c 100644 --- a/stage0_mongodb_api/managers/config_manager.py +++ b/stage0_mongodb_api/managers/config_manager.py @@ -215,17 +215,29 @@ def process_all_collections(self) -> Dict[str, List[Dict]]: # Add the overall status to each collection's results for collection_name in results.keys(): + # Check if this collection had any errors (excluding overall_status operations) + collection_has_errors = any( + isinstance(op, dict) and op.get("status") == "error" + and op.get("operation") != "overall_status" + for op in results[collection_name] + ) + + # Determine this collection's status + collection_status = "error" if collection_has_errors else "success" + collection_message = "Collection processing failed" if collection_has_errors else "Collection processed successfully" + results[collection_name].append({ "operation": "overall_status", - "message": overall_message, + "message": collection_message, "details_type": "overall", "details": { "collections_processed": len(self.collection_configs), "collections_failed": sum(1 for result in results.values() if any(isinstance(op, dict) and op.get("status") == "error" + and op.get("operation") != "overall_status" for op in result)) }, - "status": overall_status + "status": collection_status }) return results