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

DD-1493: Add command for dataverse role assignment #53

Merged

Conversation

PaulBoon
Copy link
Contributor

@PaulBoon PaulBoon commented Feb 8, 2024

Fixes DD-1493

Description of changes

Added dv-dataverse-role-assignment, similar to that for datasets, but needs aliases instead of PIDs

How to test

Assuming you have an assigment like the following; a mail domain for exampleorg and a dataverse with the alias dans:

poetry run dv-dataverse-role-assignment list dans
Should not list that assignment.

poetry run dv-dataverse-role-assignment add '&maildomain/exampleorg=dsContributor' dans
Should be stating it was added

poetry run dv-dataverse-role-assignment add '&maildomain/exampleorg=dsContributor' dans
Should be stating it wasn't needed, because it was already assigned.

poetry run dv-dataverse-role-assignment list dans
Should list that assignment.

poetry run dv-dataverse-role-assignment remove '&maildomain/exampleorg=dsContributor' dans
Should be stating it was removed

poetry run dv-dataverse-role-assignment remove '&maildomain/exampleorg=dsContributor' dans
Should be stating it wasn't needed, because it was not assigned.

poetry run dv-dataverse-role-assignment list dans
Should not list that assignment.

The add and remove commands should be run with a file containing several aliases of dataverses. Producing similar results, but then for all the aliases.

Because of the refactoring it would be wise to also test dv-dataverse-root-collect-permission-overview and dv-dataverse-root-collect-storage-usage.

Related PRs

(Add links)

*#52

Notify

@DANS-KNAW/core-systems

@PaulBoon
Copy link
Contributor Author

PaulBoon commented Feb 8, 2024

Needs refactoring, it is using the batchprocessor, but with dataverses and aliases instead of datasets and pids, which makes the code confusing.
@janvanmansum maybe create separate specific processors for datasets and dataverses, with a common generic processor.

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (cedc59f) 41.66% compared to head (03c099a) 41.42%.

Files Patch % Lines
src/datastation/dataverse/dataverse_api.py 30.55% 25 Missing ⚠️
src/datastation/dataverse/dataverse_client.py 50.00% 1 Missing ⚠️
src/datastation/dataverse/metrics_collect.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   41.66%   41.42%   -0.25%     
==========================================
  Files          18       18              
  Lines         828      857      +29     
==========================================
+ Hits          345      355      +10     
- Misses        483      502      +19     

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

@PaulBoon PaulBoon marked this pull request as ready for review February 14, 2024 13:25
src/datastation/dataverse/roles.py Outdated Show resolved Hide resolved
src/datastation/dataverse/roles.py Outdated Show resolved Hide resolved
src/datastation/dataverse/roles.py Outdated Show resolved Hide resolved
src/datastation/dataverse/roles.py Outdated Show resolved Hide resolved
@PaulBoon PaulBoon merged commit 44cf06e into DANS-KNAW:master Feb 15, 2024
3 of 5 checks passed
@PaulBoon PaulBoon deleted the DD-1493-AddCommandForDataverseRoleAssignment branch February 15, 2024 13:31
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.

3 participants