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

Vector users are not automatically added to SAVIO_PROJECT_FOR_VECTOR_USERS when already associated #656

Open
matthew-li opened this issue Jan 17, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@matthew-li
Copy link
Collaborator

Describe the bug
When a user is added to (or joins) a project on the Vector cluster, our policy is to automatically grant them access to a specific project on the Savio cluster (namely, the one specified in the SAVIO_PROJECT_FOR_VECTOR_USERS setting).

This is handled in the add_vector_user_to_designated_savio_project function.

In this function, we check whether a ProjectUser already exists to determine whether to update an existing object or create a new one. The return value of this check is a boolean. In the affirmative case, we then try to call .first() on this boolean (expecting it to be a queryset), which fails.

Thus, if the user is already associated with the Savio project (with any status, like "Removed"), they are not automatically added and set to "Active", even though they should be.

We ran into a case in the last few days wherein a user manually requested to join the Savio project prior to being added to a Vector project, causing the auto-add to fail, since a ProjectUser already existed.

To Reproduce
Steps to reproduce the behavior:

  1. Choose a Savio project to be SAVIO_PROJECT_FOR_VECTOR_USERS, and set that setting to the project's name.
  2. Join the Savio project.
  3. Join a Vector project. Upon approval, the logic for adding you to the Savio project should run, and fail because of the bug.
  4. A log message from BRCNewProjectUserRunner should note that the failure occurred. (Oddly, on production, the details of the exception were not logged. Confirm whether this is the case for you.)

Expected behavior
The user should be made "Active" on the Savio project, whether they were already associated with it or not.

Additional context

  • There is currently a test for this auto-add functionality for the case when no ProjectUser existed. Add a separate test for the case when one already existed (e.g., in a "Removed" state).
    • Search for test_add_vector_user_to_designated_savio_project_success.
  • Outside of the repository, write some query code to list any active Vector users who are not active on co_rosalind. This will help to determine additional users affected by this bug, so we can potentially add them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants