Skip to content

fix(store): raise error when upload processing status is 'error' - #6310

Open
Tejas-Raj01 wants to merge 3 commits into
canonical:mainfrom
Tejas-Raj01:fix-upload-review-error
Open

fix(store): raise error when upload processing status is 'error'#6310
Tejas-Raj01 wants to merge 3 commits into
canonical:mainfrom
Tejas-Raj01:fix-upload-review-error

Conversation

@Tejas-Raj01

Copy link
Copy Markdown
Contributor

Context:
Currently, when running snapcraft upload --release, the CLI polls the store API for the upload processing status. If the store's automated review fails, the API sometimes returns a status with code: "error" but an empty errors list. Because the existing logic only raised an exception if the errors list was populated, the CLI silently bypassed the error, broke out of the polling loop, and returned a revision number—falsely reporting a successful release to the user when it was actually rejected.

Changes in this PR:

  • Updated the notify_upload method in snapcraft/store/client.py to explicitly check if status.get("code") == "error". If this condition is met, the CLI now properly aborts the process and raises a SnapcraftError.
  • Added a corresponding unit test test_notify_upload_error_status_raises_error in tests/unit/store/test_client.py to ensure regressions are prevented.

Fixes #6299


  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • I've successfully run make lint && make test.

@Tejas-Raj01
Tejas-Raj01 requested a review from mr-cal as a code owner June 26, 2026 10:43
@Tejas-Raj01

Copy link
Copy Markdown
Contributor Author

Hi @mr-cal,

The PR is ready and all the relevant checks (lint, fast tests, slow tests) have passed successfully. The spread test failures appear to be unrelated infrastructure issues.

Could you please review this when you have a moment? Thanks!

@Tejas-Raj01

Copy link
Copy Markdown
Contributor Author

Hi @mr-cal,

Just a quick follow-up on this PR. All relevant unit tests and lint checks have passed successfully. The failing spread tests appear to be caused by unrelated infrastructure issues on the Ubuntu 26.04 runners.

Could you please review the changes when you have a chance? Thanks!

Ensure the CLI raises a SnapcraftError and aborts the process if the store processing review returns an 'error' code, preventing silent failures and misleading success messages. Fixes canonical#6299
@Tejas-Raj01
Tejas-Raj01 force-pushed the fix-upload-review-error branch from da82c90 to 4396eda Compare July 21, 2026 07:41
@Tejas-Raj01
Tejas-Raj01 requested a review from a team as a code owner July 21, 2026 09:38
Signed-off-by: Tejas <rajtejas.xyz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snapcraft upload+release not capturing review error

1 participant