-
Notifications
You must be signed in to change notification settings - Fork 0
Query filtering #16
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
Query filtering #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -267,7 +267,7 @@ def get_digest_data(workspace, repo, img, digest, ntag_display, platform="unknow | |||||||
| "is_child": True | ||||||||
| } | ||||||||
|
|
||||||||
| def fetch_tag_data(workspace, repo, img, ntag, detailed=False, include_all=False): | ||||||||
| def fetch_tag_data(workspace, repo, img, ntag, detailed=False, include_all=False, filtering_digests=None): | ||||||||
| """Fetches the manifest list for a tag and returns a list of data dicts.""" | ||||||||
|
|
||||||||
| manifest_url = f"{CLOUDSMITH_URL}/v2/{workspace}/{repo}/{img}/manifests/{ntag}" | ||||||||
|
|
@@ -302,39 +302,19 @@ def fetch_tag_data(workspace, repo, img, ntag, detailed=False, include_all=False | |||||||
| for d in digests: | ||||||||
| children.append({'digest': d, 'platform': 'unknown'}) | ||||||||
|
|
||||||||
| if is_list and not children: | ||||||||
| if is_list and not children and filtering_digests is None: | ||||||||
| return [] | ||||||||
|
|
||||||||
| # Process children | ||||||||
| children_data = [] | ||||||||
| total_downloads = 0 | ||||||||
| derived_status = None | ||||||||
|
|
||||||||
| if is_list: | ||||||||
| for child in children: | ||||||||
| data = get_digest_data(workspace, repo, img, child['digest'], ntag, platform=child['platform']) | ||||||||
| children_data.append(data) | ||||||||
| total_downloads += data['downloads'] | ||||||||
|
|
||||||||
| # Check quarantine status of children | ||||||||
| if children_data: | ||||||||
| quarantined_count = sum(1 for c in children_data if "Quarantined" in c.get('status', '')) | ||||||||
| count = len(children_data) | ||||||||
|
|
||||||||
| if quarantined_count == count: | ||||||||
| derived_status = "Quarantined" | ||||||||
| elif quarantined_count > 0: | ||||||||
| derived_status = "Partial Quarantine" | ||||||||
|
|
||||||||
| # Fetch parent package info | ||||||||
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query=version:{ntag}" | ||||||||
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query=tag:{ntag}" | ||||||||
|
||||||||
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query=tag:{ntag}" | |
| query_field = "tag" if filtering_digests is not None else "version" | |
| api_url = f"https://api.cloudsmith.io/v1/packages/{workspace}/{repo}/?query={query_field}:{ntag}" |
Copilot
AI
Jan 13, 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.
This file path comment appears to be development/debugging residue and should be removed. It doesn't serve a functional purpose in the code and looks like it was accidentally left from IDE or development tools.
| # filepath: /Users/cmoynes/dev/support-engineering/Docker/Sonar/sonar.py |
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 markdown link syntax is incorrect. It should use square brackets for the text and parentheses for the URL, not the reverse.