← Back to issue list

refactor: migrate upload-metadata

View original Github issue

Metadata

Project
snapcraft
Number
#6109
Type
pull request
State
merged
Author
mr-cal
Labels
PR: Rebase
Created
Updated
Closed

Current evaluation

Merged the upload-metadata migration to modern CLI code with no intended behavior changes; modernized logging, typing, docstrings, and unit tests. Partially completed #5338.

Resolution: closed resolved

Reason: PR #6109 was merged as commit bab4cbf1a after approval, completing the upload-metadata migration while preserving existing behavior.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Migrates all legacy code for the `upload-metadata` command. No behavioral changes. This is as pure of a refactor as I could manage. I made minor changes like updating from `logger` to `craft_cli`, adding type hints, and clarifying docstrings. That means there are plenty of inefficiencies and bugs. For example, you'll see places where we access dict values without guarding against KeyErrors or error messages that begin with "Sorry". I left all this code as-is to limit what reviewers need to focus on (the migration, not the implementation). Otherwise, this review would take forever. The unit tests had to be completely rewritten. They were using `unittest` and a bit of a mess due to their age and neglect. Unfortunately, there was very little code that I could remove from `snapcraft_legacy`, as the code is still used for other store commands still in snapcraft_legacy. I recommend reviewing this by commit. Partially completes #5338 (SNAPCRAFT-764) --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [ ] I've added or updated any relevant documentation. - [ ] I've updated the relevant release notes.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged the upload-metadata migration to modern CLI code with no intended behavior changes; modernized logging, typing, docstrings, and unit tests. Partially completed #5338.
stealth/space-bunny-alpha — closed resolved Merged in commit bab4cbf1a, migrating upload-metadata from snapcraft_legacy to the modern CLI framework with no intended behavior changes and rewritten unit tests.
stealth/space-bunny-alpha — closed resolved Merged PR #6109 migrated upload-metadata to modern CLI code with no intended behavior changes; commit bab4cbf1a partially completed #5338.
stealth/space-bunny-alpha — closed resolved Merged the upload-metadata migration to modern CLI code in commit bab4cbf1a, with no intended behavior changes; partially completed #5338.
stealth/space-bunny-alpha — closed resolved Merged in commit bab4cbf1a: migrated upload-metadata to modern code and rewrote its unit tests with no intended behavior changes, partially completing #5338.
qwen/qwen3.6-35b-a3b — — Merged after two approvals and CI validation. The change refactored and migrated legacy upload-metadata command code to modern standards, incorporating type hints, craft_cli, and rewritten unit tests without behavioral changes. Partially resolves #5338.
qwen3.6-35b-a3b-mtp-q6 — — Merged legacy upload-metadata migration. Updated logging to craft_cli, added type hints, and rewrote unit tests. No behavioral changes. Preserved inefficiencies to streamline review. Addressed API comments and force-pushed for a clean rebase before merge.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#5338 (confidence 100%)

    The migration partially completed the umbrella issue for migrating legacy Snapcraft store commands.

Related issues

No related issues found above the similarity threshold.