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

Data Manager #518

Merged
merged 47 commits into from
May 14, 2024
Merged

Data Manager #518

merged 47 commits into from
May 14, 2024

Conversation

jterry64
Copy link
Member

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Only admins with "gfw" app can manage datasets.

Issue Number: GTC-2791

What is the new behavior?

  • Any user with a "manager" role can create and modify datasets they own.
  • Specific apps are no longer checked

Does this introduce a breaking change?

  • Yes
  • No

Other information

jterry64 and others added 30 commits April 25, 2024 12:33
Add owner_id column to datasets
Write owner_id on new dataset creation
Pass user details when authenticating instead of a bool, check for manager on dataset creation
GTC-2794: Only owner or admin can use mutate dataset endpoints
solomon-negusse and others added 16 commits May 10, 2024 13:12
Make use of get_owner in the asset operations.

The checks for the pure asset operations were slightly trickier than
dataset/version operations, because the dataset name is available in the
URL path. You need to do a DB operation to get the dataset name. So, I
put the actual get_owner() call in the main function rather than in a
Depends() argument. I didn't try to add a new Depends() function that
magically does the DB operation, since some of the functions already do
the DB operation for other reasons.

Updated the test for update_metadata and update_field_metadata to test
success and failure cases for different users.

Added a missing check for the ADMIN role in get_owner() and updated its
comment.

Updated the detail of the various permission exceptions to be more
informative (GTC-2795). Let me know what you think. We could put a bit
more information in these messages if we did these errors in the main
functions, rather than in the Depends functions, but that is probably
not worth it.

In test_dataset.py, several tests were being skipped unintentionally
because they were missing the '@pytyest.mark.asyncio' annotation, so I
added that in where needed.
point to production rw api - needed for interacting with users
GTC-2822 Check for dataset ownership on asset requests
Allow reassigning data owner.
Copy link
Collaborator

@danscales danscales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. You're not quite caught up with 'develop', so you might want to merge develop over one more time, and run the tests again. Or just check in and see that the tests run fine on develop.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 64.54545% with 39 lines in your changes are missing coverage. Please review.

Project coverage is 81.69%. Comparing base (83cb15e) to head (9dc42aa).

Files Patch % Lines
app/authentication/token.py 40.00% 12 Missing ⚠️
app/routes/assets/asset.py 33.33% 12 Missing ⚠️
app/routes/authentication/authentication.py 14.28% 6 Missing ⚠️
app/utils/rw_api.py 72.22% 5 Missing ⚠️
app/routes/datasets/dataset.py 90.90% 2 Missing ⚠️
app/routes/datasets/versions.py 60.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #518      +/-   ##
===========================================
- Coverage    81.79%   81.69%   -0.11%     
===========================================
  Files          124      125       +1     
  Lines         5538     5610      +72     
===========================================
+ Hits          4530     4583      +53     
- Misses        1008     1027      +19     
Flag Coverage Δ
unittests 81.69% <64.54%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jterry64 jterry64 merged commit 6d407b2 into develop May 14, 2024
2 checks passed
@jterry64 jterry64 deleted the feature/data_manager branch May 14, 2024 18:18
@dmannarino dmannarino restored the feature/data_manager branch May 22, 2024 20:24
@dmannarino dmannarino deleted the feature/data_manager branch May 22, 2024 20:45
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

Successfully merging this pull request may close these issues.

5 participants