| Summary: | Stash REST API gives ambiguous errors when handling DELETE requests | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Remy Suen <remy.suen> |
| Component: | Node | Assignee: | Remy Suen <remy.suen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | 15.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Remy Suen
I forgot to mention that the /blah/blah repository should have nothing in the stash. If there is something in the stash and you give it an incorrect stash revision SHA hash, the same error will occur. $ curl -X DELETE "http://localhost:8081/gitapi/stash/abc/file/orionode" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 58 100 58 0 0 1870 0 --:--:-- --:--:-- --:--:-- 3625{"Severity":"Error","Message":"Number index is required."} First pass pushed to master.
-try to drop the stash when it is empty
-try to drop an invalid stash revision when the stash is not empty
{"Severity":"Error","Message":"Failed to drop stashed changes due to an empty stash."}
-try to drop an invalid stash revision when the stash is not empty
{"Severity":"Error","Message":"Invalid stash reference abc."}
https://github.com/eclipse/orion.client/commit/2cee3036bd2cd6e1d084752b3f16097b6995553c
1. Stash something so that your stash is non-empty. 2. Try to delete everything from your stash. $ curl -X DELETE "http://localhost:8081/gitapi/stash/file/orionode" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 82 100 82 0 0 1051 0 --:--:-- --:--:-- --:--:-- 1322{"Severity":"Error","Message":"No stashed state at position 18446744073709551615"} Second pass pushed to master. This fixes the scenario described in comment 3. https://github.com/eclipse/orion.client/commit/e3c979fb639caee4f5cbca37beb52bc69d85f68b |