Skip to content

Fix accurate collection failure reporting #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions stage0_mongodb_api/managers/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading