← Back to issue list

Fixed StoreReleaseError format for BAD REQUEST error

View original Github issue

Metadata

Project
snapcraft
Number
#1599
Type
pull request
State
merged
Author
clobrano
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #1599 as c7adb25f7, formatting Store BAD REQUEST errors for users and adding invalid-revision test coverage; released in Snapcraft 2.35.

Resolution: closed resolved

Reason: PR #1599 was merged with commit c7adb25f7. It reformatted StoreReleaseError messages and added regression coverage for an invalid revision.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Currently, when releasing a snap with invalid data (e.g. revision), the error string is not formatted for a user, e.g. {'revision': ['This field must be an integer.']} With this commit, the error is formatted as follows: "invalid-field: The 'revision' field must be an integer" Moreover: - added test case in test_store_client.py: ReleaseTestCase.test_release_with_invalid_revision - added new conditional branch in fake_servers/api.py:snap_release method to support the test above. - reworked StoreReleaseError class to wrap the code that formats different errors in dedicated methods. Fixes LP 1604815 - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #1599 as c7adb25f7, formatting Store BAD REQUEST errors for users and adding invalid-revision test coverage; released in Snapcraft 2.35.
stealth/space-bunny-alpha — closed resolved Merged as commit c7adb25f7 ("store: fix StoreReleaseError format for BAD REQUEST error (#1599)"), reformatting store BAD REQUEST errors into user-friendly messages; fixes LP 1604815.
stealth/space-bunny-alpha — closed resolved Merged #1599 as c7adb25f7, formatting Store BAD REQUEST errors into user-friendly messages and adding invalid-revision test coverage. Fixes LP 1604815.
qwen/qwen3.6-35b-a3b — — Merged refactoring of StoreReleaseError to convert BAD REQUEST error dictionaries into user-friendly strings. Adds unit tests and resolves LP 1604815.
qwen3.6-35b-a3b-mtp-q6 — — Merged changes refactoring StoreReleaseError to format BAD REQUEST responses as user-friendly strings instead of raw dictionaries. Includes new tests and resolves Launchpad bug LP 1604815.

Update history

No update history recorded yet.

Related work

Related issues

Issue Project State Summary Similarity
#1604815 The error when trying to release a revision that's not a integer is ugly snapcraft (launchpad) closed Invalid release revisions now produce a formatted user-facing StoreReleaseError; the fix merged in canonical/snapcraft#1599 (c7adb25f7) and shipped in Snapcraft 2.35.
74%