-
Notifications
You must be signed in to change notification settings - Fork 0
Add uploaded date #18
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 pull request adds an "Uploaded" date field to the Sonar tool's output to display when packages were uploaded to Cloudsmith. The change affects the data collection functions, table rendering, and CSV output formatting.
Changes:
- Added
uploadedfield to data structures inget_digest_data,fetch_tag_data, andfetch_untagged_datafunctions - Updated table rendering to display the "Uploaded" column
- Updated CSV output header and rows to include the uploaded date field
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| Docker/Sonar/sonar.py | Adds uploaded date field to package data structures, table rendering, and CSV output |
| CHANGELOG.md | Documents the new feature and fixes in version 1.2 release notes |
Comments suppressed due to low confidence (7)
Docker/Sonar/sonar.py:295
- This comment appears to contain commented-out code.
# if not is_list and not include_all:
# return []
Docker/Sonar/sonar.py:6
- Import of 'csv' is not used.
import csv
Docker/Sonar/sonar.py:14
- Import of 'datetime' is not used.
from datetime import datetime
Docker/Sonar/sonar.py:21
- Import of 'Text' is not used.
from rich.text import Text
Docker/Sonar/sonar.py:112
- 'except' clause does nothing but pass and there is no explanatory comment.
except Exception:
Docker/Sonar/sonar.py:622
- 'except' clause does nothing but pass and there is no explanatory comment.
except Exception:
Docker/Sonar/sonar.py:657
- 'except' clause does nothing but pass and there is no explanatory comment.
except Exception:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uploaded_at = find_key_recursive(pkg_details, 'uploaded_at') | ||
| if uploaded_at: | ||
| uploaded = uploaded_at |
Copilot
AI
Jan 14, 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 variable uploaded_at is assigned from find_key_recursive which returns a list, but then it's used to assign to uploaded without extracting the first element. This should check if the list is not empty and extract the first element, similar to how downloads are handled above. This will likely result in incorrect data being stored in the returned dictionary.
| "platform": platform, | ||
| "status": status_raw, | ||
| "downloads": dl, | ||
| "uploaded": uploaded, |
Copilot
AI
Jan 14, 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 variable uploaded is referenced here but it's never defined in this function. The code assigns to uploaded_at on line 253 and attempts to use uploaded on line 276, but uploaded is never initialized. This will cause a NameError when this code path is executed.
| f"[white]{row.get('type', '')}[/white]", | ||
| row.get("platform", ""), | ||
| format_status(row.get("status", "")), | ||
| f"[dim cyan]{parent.get('uploaded', '')}[/dim cyan]", |
Copilot
AI
Jan 14, 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 line references parent.get('uploaded', '') but row is the child element being processed. This should be row.get('uploaded', '') instead to display the child's uploaded date rather than the parent's uploaded date.
| ## [Sonar] [v1.2] [2026-01-14] | ||
|
|
||
| ### Added | ||
| - Added `--filter` flag which accepts the (Package Search Syntax)[https://docs.cloudsmith.com/artifact-management/search-filter-sort-packages] string. e.g. `--filter "downloads:>0"`. |
Copilot
AI
Jan 14, 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 markdown link syntax is incorrect. It should be [Package Search Syntax](https://docs.cloudsmith.com/artifact-management/search-filter-sort-packages) with square brackets around the link text and parentheses around the URL, not the other way around.
| - `Uploaded` date of the package now added to the results. | ||
|
|
||
| ### Fixed | ||
| - Deletion now correctly works against non multi-arch images. Previously they where ignored and only multi-arch images were being deleted. Additionally improved log output for deletions. |
Copilot
AI
Jan 14, 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.
Corrected spelling of 'where' to 'were'
📄 Summary
Added uploaded date to the results
🔍 Related Issues
Link to any related GitHub issues (e.g.,
Fixes #12,Closes #34):🧪 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🧪 How Has This Been Tested?
Describe how you tested your changes. Include CI runs, local tests, manual verification, or screenshots if applicable.
📸 Screenshots (if applicable)
If UI or logs are affected, include before/after screenshots or output.
✅ Checklist