Skip to content

Conversation

@colinmoynes
Copy link
Collaborator

@colinmoynes colinmoynes commented Jan 14, 2026

📄 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

  • I’ve read and followed the CONTRIBUTING.md.
  • I’ve added or updated documentation as needed.
  • I’ve verified the change is tested and works as intended.
  • CI/CD checks pass and do not break existing functionality.
  • My code follows the style guidelines of this project.

@colinmoynes colinmoynes self-assigned this Jan 14, 2026
Copilot AI review requested due to automatic review settings January 14, 2026 17:17
@colinmoynes colinmoynes merged commit c59604d into main Jan 14, 2026
5 checks passed
@colinmoynes colinmoynes deleted the add_uploaded_date branch January 14, 2026 17:18
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 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 uploaded field to data structures in get_digest_data, fetch_tag_data, and fetch_untagged_data functions
  • 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.

Comment on lines +266 to +268
uploaded_at = find_key_recursive(pkg_details, 'uploaded_at')
if uploaded_at:
uploaded = uploaded_at
Copy link

Copilot AI Jan 14, 2026

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.

Copilot uses AI. Check for mistakes.
"platform": platform,
"status": status_raw,
"downloads": dl,
"uploaded": uploaded,
Copy link

Copilot AI Jan 14, 2026

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.

Copilot uses AI. Check for mistakes.
f"[white]{row.get('type', '')}[/white]",
row.get("platform", ""),
format_status(row.get("status", "")),
f"[dim cyan]{parent.get('uploaded', '')}[/dim cyan]",
Copy link

Copilot AI Jan 14, 2026

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.

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

Copilot AI Jan 14, 2026

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.

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

Copilot AI Jan 14, 2026

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'

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