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

Parse project specific errors from API #491

Merged
merged 11 commits into from
May 12, 2022
Merged

Parse project specific errors from API #491

merged 11 commits into from
May 12, 2022

Conversation

i-oden
Copy link
Member

@i-oden i-oden commented May 11, 2022

Description

Returns the parsing of the project related "errors", specifically when adding a user to a project you do not have access to (i.e. your project key does not exist). The PR also returns these errors to the underlying functions, which means all calls to perform_request are changed by adding an extra returned variable (_ because unused for most cases).

  • Summary of the changes and the related issue
  • Relevant motivation and context
  • Any dependencies that are required for this change

Fixes DDS-1265

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

Please delete options that are not relevant.

  • Any dependent changes have been merged and published in downstream modules
  • Rebase/merge the branch which this PR is made to
  • Product Owner / Scrum Master: This PR is made to the master branch and I have updated the version

Formatting and documentation

  • I have added a row in the changelog
  • The code follows the style guidelines of this project: Black / Prettier formatting
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Tests

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Manual tests to try out

  1. Start up the dds_web
  2. Remove all rows in ProjectUserKeys
  3. Test dds user add
    a. Invite a new Researcher to project --> Error: dds user add [email protected] -r Researcher -p project_1
    b. Invite new Unit Personnel --> Error: dds user add [email protected] -r Unit Personnel
    c. Add existing Unit Personnel to project as Researcher --> Error: dds user add [email protected] -r Researcher -p project_1
    d. Add existing Researcher to project --> Error: dds user add [email protected] -r Researcher -p project_1
  4. Test dds project access fix
    a. Fix project access for all projects for Unit Personnel --> Error: dds project access fix [email protected]
    b. Fix project access for Researcher
  5. Test the other commands that are mentioned in this part of the code, play around and make sure that they still work as intended
    a. dds project create
    b. dds motd add

@i-oden i-oden changed the title Dds 1265 parse errors Parse project specific errors from API May 11, 2022
@i-oden i-oden self-assigned this May 11, 2022
@codecov
Copy link

codecov bot commented May 11, 2022

Codecov Report

Merging #491 (5610aa1) into dev (2eb9760) will increase coverage by 0.62%.
The diff coverage is 22.22%.

@@           Coverage Diff            @@
##             dev    #491      +/-   ##
========================================
+ Coverage   6.54%   7.17%   +0.62%     
========================================
  Files         29      29              
  Lines       2430    2440      +10     
========================================
+ Hits         159     175      +16     
+ Misses      2271    2265       -6     
Impacted Files Coverage Δ
dds_cli/account_manager.py 0.00% <0.00%> (ø)
dds_cli/base.py 0.00% <0.00%> (ø)
dds_cli/data_getter.py 0.00% <0.00%> (ø)
dds_cli/data_lister.py 0.00% <0.00%> (ø)
dds_cli/data_putter.py 0.00% <0.00%> (ø)
dds_cli/data_remover.py 0.00% <0.00%> (ø)
dds_cli/file_handler_local.py 0.00% <0.00%> (ø)
dds_cli/file_handler_remote.py 0.00% <0.00%> (ø)
dds_cli/motd_manager.py 0.00% <0.00%> (ø)
dds_cli/project_creator.py 0.00% <0.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eb9760...5610aa1. Read the comment docs.

@i-oden i-oden requested review from a user and valyo and removed request for valyo May 11, 2022 11:48
@i-oden i-oden requested review from a user and removed request for a user May 12, 2022 09:05
@i-oden i-oden merged commit b4c1a31 into dev May 12, 2022
@i-oden i-oden deleted the DDS-1265_parse_errors branch May 12, 2022 09:30
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.

1 participant