New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bodhi's REST API should separate the create and edit endpoints #2208
Comments
It turns out that it's not just severity that gets reset, but all fields get reset if not specified in a follow-on post. If I use the CLI to change an update to have a stable karma of 5 and then use it to make a different change and don't specify that karma, it gets set back to 3 in the later update. I think this is rather surprising. |
fixes #2208 Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
The associated PR seems to fix the CLI so that it doesn't suffer from this issue, but the real issue is that the API should not alter fields that it was not given in edit calls. I'd like to fix that issue in a future X release, so I'm going to reopen it. Thanks for fixing the CLI for it though, I think that'll really help with most real-world use cases that hit this problem ☺ |
A fix for the CLI is planned to be included in the upcoming 3.9.0 release: #2477. |
The CLI fix described above was released with 3.9.0. |
The real problem here is that Bodhi's REST API isn't very RESTy. It uses the same URL for creating and editing updates. To signal that you are editing an update, the user includes a key in the JSON with "edited" and the build's title. The REST way to do it would be for the user to POST to the update's URL (i.e., not the By making this change, we can easily give a different schema to the edit API than the create API, which is difficult to do under the current model. |
You could also make use of the PUT and PATCH HTTP method and follow the CRUD principle. CREATE an update --> POST |
It looks like that "overrides" and "releases" apis are not RESTy as well. |
While working on #1814 today I discovered that the REST API will set an update's severity to "unspecified" if the POST data does not include the severity field. This means that users who edit an update with the CLI and don't specify a
--severity
will end up altering the update to reset its severity to "unspecified".The text was updated successfully, but these errors were encountered: