refactor: migrate promote command
Metadata
Current evaluation
Migrated the promote command from snapcraft_legacy to the main codebase as a near-verbatim port to preserve complex legacy behaviors. Approved by two reviewers and merged after passing most CI checks, despite one store integration test failure.
Suggested action: —
No scores available.
Issue body
Migrates the `promote` command from snapcraft_legacy.
I would have loved to do more refactoring and integrate this with the existing classes, but this command is complex and there are too many subtle behaviors and corner cases baked into the legacy code. So I kept this is as near-verbatim migration.
(SNAPCRAFT-1316)
---
- [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.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [ ] I've updated the relevant release notes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Migrated the promote command from snapcraft_legacy to the main codebase as a near-verbatim port to preserve complex legacy behaviors. Approved by two reviewers and merged after passing most CI checks, despite one store integration test failure. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a near-verbatim migration of the promote command from snapcraft_legacy to preserve complex legacy behaviors and corner cases. Resolves SNAPCRAFT-1316. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a near-verbatim migration of the promote command from snapcraft_legacy to preserve complex legacy behaviors. Resolves SNAPCRAFT-1316. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #6145 refactor: migrate gated command | snapcraft | merged | Merged the refactoring that migrates the gated command from snapcraft_legacy. Approved by two reviewers and passed most CI checks. Resolves SNAPCRAFT-1314. | |
| #6141 refactor: migrate create-key command | snapcraft | merged | Merged after approval. The create-key command was successfully migrated from snapcraft_legacy. Integration test failures were dismissed as unrelated by the author, and the PR was squash merged. | |
| #5338 Migrate snapcraft_legacy store commands | snapcraft | closed | Partially completed. Migrated upload-metadata and set-default-track to modern snapcraft code. Promote and metrics commands deferred to a separate effort. Issue closed. | |
| #6228 refactor: migrate sign-build command | snapcraft | merged | Merged refactoring PR that migrates the sign-build command out of the legacy codebase (SNAPCRAFT-1320). Approved by two reviewers and integrated after a lint failure was resolved in a separate PR. | |
| #6144 refactor: migrate keys | snapcraft | merged | Squash merged the migration of the keys command from snapcraft_legacy. Approved by two reviewers, the change modified 12 files with a net reduction of 157 lines. Resolves SNAPCRAFT-1315. | |
| #6304 fix(commands/promote): exit non-zero when promotion is cancelled | snapcraft | merged | Merged as a squash commit. Fixes #6294 by ensuring the promote command exits non-zero when cancelled. Updates documentation to guide CI workflows previously relying on the SNAPCRAFT_HAS_TTY workaround for #5958. Approved by three reviewers. | |
| #2082 feat(store): promote command | charmcraft | merged | Merged a promote command for channel transfers with stability constraints. Approved by three reviewers, it resolves issue 1633 and modifies 12 files with 951 additions and 67 deletions. | |
| #4830 refactor: migrate commands to craft-application | snapcraft | merged | Merged following three approvals and passing CI. Migrates remaining commands to core24/craft-application, updating snapcraft init to generate core24 files, correcting list-plugins output, and refreshing command docs. Resolves #4742. | |
| #6207 refactor: migrate metrics command | snapcraft | merged | Merged the refactor migrating the metrics command from the legacy codebase to the new implementation. The change modified 21 files, adding 683 lines and removing 1002, resolving SNAPCRAFT-1319 after successful review and CI validation. | |
| #4586 refactor: move core22 commands for versioned implementation | snapcraft | merged | Merged a pure rename refactor moving core22 commands for versioned implementation. Approved by four reviewers and passed CI. Full spread tests were enabled per request; failures attributed to external craft-application updates. |