-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[24.1] Allow to change only the description of a quota #18775
[24.1] Allow to change only the description of a quota #18775
Conversation
Since we can now update just the description, this message needs to be edited too. I'd keep it simple (e.g. "has been updated") and not worry about specifying what exactly was updated (name or description or both, etc.) |
@bernt-matthias Sorry, I'm confused; can you, please, explain why "If one wants to change just the description of a quota the used select statement gets the quota itself and the elif branch hits resulting in an exception."? I'm looking at this: |
Those messages are not the most insightful anyway, I would follow up on dev and remove them all. Either we got a 200 response and it's good or we got an exception. |
Strongly agree. An update can mean a lot of things, including any combination of updated values, some derived from others, etc. Besides, even if we constructed a detailed message, I don't think it would be useful. And a generic "has been updated" message, if at all needed, can be constructed on the client. |
Lets say there is a quota with name Instead of checking: Is there a quota with name X it needs to check is there another quota with name X. |
Thanks! But still, I'm looking at the old code: it'll raise an error only if both conditions are true: That said, I think your version is better, because it's immediately clear from looking at the statement that it answers the question "is there a quota record with that name that is not the quota I am editing?" - which is very easy to read! Also, with this statement, I think you don't need to check |
That is correct.
:)
I think we should not change this in a bug fix. But I think you are right as long as we assume that we have unique names. I was wondering if the attempt to introduce a change to the DB that would violate unique names would raise an exception anyway, i.e. are our if statements redundant anyway? |
I think it's part of the bug fix: we've effectively moved that check into the statement filtering clause, so we don't need to check it again.
We can assume that: there's a unique constraint on that field. We could delegate that to the database; however, that's a little more involved. You'd wrap the |
@bernt-matthias Everything looks good, thanks! Would you mind rebasing to get rid of the last empty commit (for a cleaner history)? |
A [quota update via API](https://github.com/galaxyproject/galaxy/blob/67b4a69c1b36eec4dc5871c5eeb97b6bdea8a288/lib/galaxy/webapps/galaxy/services/quotas.py#L85) requires name or quota to be set, but the [manager](https://github.com/galaxyproject/galaxy/blob/67b4a69c1b36eec4dc5871c5eeb97b6bdea8a288/lib/galaxy/managers/quotas.py#L119) requires a name to be set. If one wants to change just the description of a quota the used select statement gets the quota itself and the elif branch hits resulting in an exception. With the change one can change just the description, but one still needs to specify the name of the quota. We could change this such that also in the manager the name of the quota needs to be specified.
Co-authored-by: Marius van den Beek <[email protected]>
4498da6
to
fc9d2f1
Compare
This PR was merged without a "kind/" label, please correct. |
It looks to me that this ended up being more a refactoring than a bugfix? Should the PR title be updated, as it ends up in the release notes? |
It's a mix, but in my opinion more a bugfix, since we changed behavior. |
this should make the quota manager a bit more siltent when updating quotas, i.e. only message when something is changed In galaxyproject#18775 (comment) it was suggested to remove all messages, but I find it quite useful when using bioblend.
this should make the quota manager a bit more siltent when updating quotas, i.e. only message when something is changed In galaxyproject#18775 (comment) it was suggested to remove all messages, but I find it quite useful when using bioblend.
this should make the quota manager a bit more siltent when updating quotas, i.e. only message when something is changed In galaxyproject#18775 (comment) it was suggested to remove all messages, but I find it quite useful when using bioblend.
this should make the quota manager a bit more siltent when updating quotas, i.e. only message when something is changed In galaxyproject#18775 (comment) it was suggested to remove all messages, but I find it quite useful when using bioblend.
A quota update via API requires name or quota to be set, but the manager requires a name to be set.
If one wants to change just the description of a quota the used select statement gets the quota itself and the elif branch hits resulting in an exception.
With the change one can change just the description, but one still needs to specify the name of the quota. We could hange this such that also in the manager the name of the quota needs to be specified.
I guess in the admin UI this has not been a problem because the name and description are prefilled with the old values.
How to test the changes?
(Select all options that apply)
License