-
Notifications
You must be signed in to change notification settings - Fork 0
Enhanced multi-arch status handling and results table visual enhancements #14
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the multi-architecture Docker image status handling by introducing a "Partial Quarantine" status for manifest lists where some, but not all, child images are quarantined. Additionally, it improves the visual presentation of the results table with better color coding and styling for multi-arch image hierarchies.
Key Changes:
- Implemented derived status logic that aggregates child image quarantine states to determine parent manifest status
- Enhanced table rendering with improved color schemes and formatting for better visual hierarchy
- Refactored parameter naming from
alltoinclude_allfor clarity
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Check quarantine status of children | ||
| if children_data: | ||
| quarantined_count = sum(1 for c in children_data if "Quarantined" in c.get('status', '')) |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string matching logic "Quarantined" in c.get('status', '') will incorrectly match the new "Partial Quarantine" status as quarantined. This causes inaccurate quarantine counting when aggregating child statuses. Use exact string comparison: c.get('status', '') == "Quarantined" instead.
| quarantined_count = sum(1 for c in children_data if "Quarantined" in c.get('status', '')) | |
| quarantined_count = sum(1 for c in children_data if c.get('status', '') == "Quarantined") |
| next_url = f"{api_url}?{query}" | ||
| def get_image_analysis(workspace, repo, img_name, delete_all=False, delete_tag=None, detailed=False, progress=None, include_all=False): | ||
| # Fetch all tags (including untagged if requested, but logic handled separately) | ||
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query=name:{img_name}" |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query parameter is not URL-encoded, which can cause request failures if img_name contains special characters like spaces, slashes, or ampersands. Use urlencode to properly encode the query parameter as was done in the original implementation.
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query=name:{img_name}" | |
| query_params = urlencode({"query": f"name:{img_name}"}) | |
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?{query_params}" |
| def get_image_analysis(workspace, repo, img_name, delete_all=False, delete_tag=None, detailed=False, progress=None, include_all=False): | ||
| # Fetch all tags (including untagged if requested, but logic handled separately) | ||
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query=name:{img_name}" | ||
| packages = make_request(api_url, {"Cache-Control": "no-cache"}) |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pagination logic has been removed, limiting results to the first page only (default page size varies by API). For images with many packages/tags, this will silently skip data. The original implementation correctly handled pagination via the Link header to retrieve all results across multiple pages.
📄 Summary
Multi-arch image status is now more accurately representative of the child images.
🧪 Type of Change
Please check the relevant type tag for this PR title:
[FIX]Bug fix[NEW]New thing[REFACTOR]Internal changes such as code restructuring or optimization that does not alter functionality[DOC]Documentation-only changes[CHORE]Maintenance, cleanup, or CI configuration