Skip to content
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

update_group behaviour not as expected #217

Open
bernt-matthias opened this issue Mar 29, 2017 · 6 comments
Open

update_group behaviour not as expected #217

bernt-matthias opened this issue Mar 29, 2017 · 6 comments

Comments

@bernt-matthias
Copy link
Contributor

The documented behavior of update_group is to substitute previous users. But actually it leads to duplicates of user group associations in the galaxy DB.

This has been tested with version 0.7.0 which is shipped with the current release of galaxy.

@bernt-matthias
Copy link
Contributor Author

To me more precise:
If the parameter user_ids=[] it works as expected. But if the list contains a user that is already present in this group it leads to a duplication.

@nsoranzo
Copy link
Member

@bernt-matthias Thanks for the report! It seems this is due to delete_existing_assocs being False at https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/webapps/galaxy/api/groups.py#L128 .
That's been the case since when this Galaxy API call was introduced in 2012, ping author @jmchilton.

@jmchilton
Copy link
Member

jmchilton commented Mar 29, 2017

Well that is unfortunate. I can't speak for distant-past-@jmchilton - that guy made a ton of mistakes and was kind of a moron - but current @jmchilton doesn't think this should work the way it does. Distant-past-@jmchilton implemented this endpoint with only creating groups and roles in mind.

I'm okay with either calling this a bug and just modifying the behavior and hope the backward compatibility doesn't bite anyone or adding a parameter like update_or_append that defaults to append but could be set to update. @nsoranzo do you have a preference for either of these options - I would defer to you on which would be preferable.

@bernt-matthias
Copy link
Contributor Author

Maybe the main question is if duplicate entries in user_group_accessions in the galaxy DB are a problem. I would vote for the update behavior (as default) since this is documented -- and thereby it should not cause compatibility problems. For the original intended purpose (filling empty groups) update / append make no difference anyway. The additional possibility of append would be a nice addition.

@nsoranzo
Copy link
Member

There is already another API call to add a user to a group in https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/webapps/galaxy/api/group_users.py :

PUT /api/groups/{encoded_group_id}/users/{encoded_user_id}
Adds a user to a group

Similarly for adding a role to a group.
So I suppose the best way forward is call it a bug, fix it and see if any test fails or anyone shouts.

@bernt-matthias
Copy link
Contributor Author

bernt-matthias commented Mar 30, 2017

Sounds good to me. Unfortunately I can not help with this since I'm not familiar enough with this or the galaxy project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants