← Back to issue list

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

View original Github issue

Metadata

Project
snapcraft
Number
#6310
Type
pull request
State
open
Author
Tejas-Raj01
Labels
Created
Updated
Closed

Current evaluation

Fixes snapcraft upload --release silently reporting success when store review fails by checking status code 'error' in notify_upload. Waiting for maintainer review for 72 days.

Suggested action: needs review

Reason: The PR addresses open issue #6299 where `snapcraft upload --release` falsely reports success when the store review fails. The fix adds a simple `status.get('code') == 'error'` check in `notify_upload` with a corresponding test. The bug still exists in the current codebase, but the PR has been waiting for maintainer review for 72 days with two contributor pings and 2 unresolved review comments.

Impact: 55 Quick Win: 46.75 Staleness: 65 Complexity: 15 Confidence: 80

Issue body

**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 --- - [x] I've followed the contribution guidelines. - [x] I've signed the CLA. - [x] I've successfully run `make lint && make test`.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 55
Quick Win: 46.75
Staleness: 65
Complexity: 15
Confidence: 80
needs review Fixes snapcraft upload --release silently reporting success when store review fails by checking status code 'error' in notify_upload. Waiting for maintainer review for 72 days.
qwen3.6-35b-a3b-mtp-q6
Impact: 55
Quick Win: 46.75
Staleness: 50
Complexity: 15
Confidence: 70
needs review Fixes snapcraft upload --release falsely reporting success when store review fails by checking status code in notify_upload. Waiting for maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 15
Confidence: 95
needs review Fixes silent success bug during snapcraft upload when store API returns error code with empty errors list. Adds explicit status check and unit test. Awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 15
Confidence: 90
needs review Fixes a bug where snapcraft upload silently succeeds when the store API returns an error code with an empty error list. Adds explicit error handling and a unit test. Currently awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 40
Complexity: 10
Confidence: 90
needs review Fixes silent success bug during snapcraft upload when store API returns error code with empty errors list. Adds explicit error check and unit test. Awaiting maintainer review after 13 days of inactivity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 15
Confidence: 90
needs review Fixes silent success bug during snapcraft upload by raising SnapcraftError when store returns error status code. Adds unit test. Currently awaiting maintainer review.

Update history

Date Change
updated
updated
updated
updated
updated
updated

Related work

  • Related To: snapcraft#6299 (confidence 95%)

    This PR explicitly fixes issue #6299, which describes the exact bug: store review failures with code 'error' and empty errors list are silently bypassed.

Related issues

Issue Project State Summary Similarity
#6299 Snapcraft upload+release not capturing review error snapcraft open snapcraft upload --release reports success despite store review failures due to incorrect status handling in notify_upload. Issue is unlabelled and inactive for 74 days.
81%
#1676100 Store review error itself errors out snapcraft (launchpad) open snapcraft crashed with IndexError when logging a StoreReviewError during snap push; the old storeapi error path was replaced by craft-store error handling, so the bug is no longer reproducible in current code.
70%