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

Clarify dds-failed-delivery.json information on error #616

Merged

Conversation

i-oden
Copy link
Member

@i-oden i-oden commented Feb 28, 2023

1. This PR contains the following changes...

When there's an error during upload, the CLI currently says 'see this file for more information'. This message does not make it clear enough that we may ask them to send it. Therefore this PR changes the message and clarifies that they should not be deleting it.

This also reverts the previous PR slightly -- only error code 1 when there's an error. Only warn (code 0 - OK) when partial upload.

2. The following additional changes are required for this to work

X

3. The PR fixes the following GitHub issue / Jira task

  • GitHub issue (link):
  • Jira task (ID, DDS-xxxx): DDS-1483
  • The PR does not fix a specific GitHub issue or Jira task

4. What type of change(s) does the PR contain?

  • New feature
    • Breaking: Please describe the reason for the break and how we can fix it.
    • Non-breaking
  • Bug fix
    • Breaking: Please describe the reason for the break and how we can fix it.
    • Non-breaking
  • Security Alert fix
  • Documentation
  • Tests (only)
  • Workflow

5. Checklist

Always

If PR consists of code change(s)

  • Self review
    • Done
  • Comments, docstrings, etc
    • Added / Updated
  • Documentation
    • Updated
    • Update not needed

6. Actions / Scans

  • Black: Python code formatter. Does not execute. Only tests.
    Run black . locally to execute formatting.
    • Passed
  • Prettier: General code formatter. Our use case: MD and yaml mainly.
    Run npx prettier --write . locally to execute formatting.
    • Passed
  • Yamllint: Linting of yaml files.
    • Passed
  • Tests: Pytest to verify that functionality works as expected.
    • New tests added
    • No new tests
    • Passed
  • TestPyPi: Build CLI and publish to TestPyPi in order to verify before release.
    • Passed
  • CodeQL: Scan for security vulnerabilities, bugs, errors
    • New alerts: Go through them and either fix, dismiss och ignore. Add reasoning in items below.
    • Alerts fixed: What?
    • Alerts ignored / dismissed: Why?
    • Passed
  • Trivy: Security scanner
    • New alerts: Go through them and either fix, dismiss och ignore. Add reasoning in items below.
    • Alerts fixed: What?
    • Alerts ignored / dismissed: Why?
    • Passed
  • Snyk: Security scanner
    • New alerts: Go through them and either fix, dismiss och ignore. Add reasoning in items below.
    • Alerts fixed: What?
    • Alerts ignored / dismissed: Why?
    • Passed

@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #616 (1137554) into dev (733ffd6) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##              dev     #616      +/-   ##
==========================================
- Coverage   46.73%   46.69%   -0.05%     
==========================================
  Files          31       31              
  Lines        2788     2782       -6     
==========================================
- Hits         1303     1299       -4     
+ Misses       1485     1483       -2     
Impacted Files Coverage Δ
dds_cli/__main__.py 42.00% <0.00%> (-0.33%) ⬇️
dds_cli/base.py 42.71% <0.00%> (+1.20%) ⬆️
dds_cli/exceptions.py 89.36% <ø> (-0.23%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@i-oden i-oden self-assigned this Mar 6, 2023
@i-oden i-oden marked this pull request as ready for review March 6, 2023 10:26
@i-oden i-oden requested a review from valyo March 6, 2023 10:26
@i-oden
Copy link
Member Author

i-oden commented Mar 7, 2023

How to test manually:

  1. Partial uploads

    a) dds data put --source [file / directory 1] --project [project ID]
    b) The printout should be

    Upload completed!

    c) echo $? should return 0
    d) dds data put --source [file / directory 1] --source [file / directory 2] --project [project ID]
    e) The printout should be

    WARNING X files were already uploaded.
    Upload partially completed!

    f) echo $? should return 0

  2. True failed

    a) Change line 202 in base.py from if true_failed: to if not true_failed:
    b) dds data put --source [file / directory 3] --project [project ID]
    c) The printout should be

    ERROR Errors occurred during upload.
    If you wish to retry the upload, re-run the dds data put command again,
    specifying the same options as you did now. To also overwrite the files
    that were uploaded, also add the --overwrite flag at the end of the command.

    Please verify that the following error log has been generated: dds_failed_delivery.json
    Do not delete this file; The Data Centre may need it during DDS support.

    d) echo $? should return 1

  3. Download: Do the same thing but run the dds data get command and check that the printouts etc match.

@i-oden i-oden closed this Mar 7, 2023
@i-oden i-oden reopened this Mar 7, 2023
@i-oden i-oden merged commit 9874a57 into dev Mar 8, 2023
@i-oden i-oden deleted the DDS-1483-add-contact-dc-info-to-cli-if-failed-to-add-to-db branch March 8, 2023 09:41
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.

2 participants