Skip to content

Conversation

@colinmoynes
Copy link
Collaborator

@colinmoynes colinmoynes commented Jan 7, 2026

📄 Summary

Multi-arch image status is now more accurately representative of the child images.

  • If ALL child images are quarantined, the parent manifest/list is quarantined.
  • If one or more but not all child images are quarantined, the parent manifest/list reports "partial quarantine"
  • Enhanced visuals to the results table for better readability against multi-arch images.
image

🧪 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

@colinmoynes colinmoynes self-assigned this Jan 7, 2026
Copilot AI review requested due to automatic review settings January 7, 2026 10:50
@colinmoynes colinmoynes merged commit 30e99ed into main Jan 7, 2026
5 checks passed
@colinmoynes colinmoynes deleted the multi-arch-status branch January 7, 2026 10:51
Copy link

Copilot AI left a 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 all to include_all for 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', ''))
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
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")

Copilot uses AI. Check for mistakes.
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}"
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
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}"

Copilot uses AI. Check for mistakes.
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"})
Copy link

Copilot AI Jan 7, 2026

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants