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

Return exit code 1 if only partial upload #615

Merged

Conversation

i-oden
Copy link
Member

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

1. This PR contains the following changes...

NGI noticed that some files were not uploaded, but the DDS had not returned an error code 1, which meant that they were not aware of any error. This should fix that.

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-1484
  • 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

  • Changelog
    • Added
    • Not needed (E.g. PR contains only tests)
  • Rebase / Update / Merge from base branch (the branch from which the current is forked)
    • Done
    • Not needed
  • Blocking PRs
    • Merged
    • No blocking PRs
  • PR to master branch

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

@i-oden i-oden self-assigned this Feb 28, 2023
@i-oden i-oden marked this pull request as ready for review February 28, 2023 14:02
@i-oden i-oden requested a review from valyo February 28, 2023 14:02
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #615 (10181a0) into dev (8db3f1e) will increase coverage by 0.07%.
The diff coverage is 14.28%.

@@            Coverage Diff             @@
##              dev     #615      +/-   ##
==========================================
+ Coverage   46.65%   46.73%   +0.07%     
==========================================
  Files          31       31              
  Lines        2784     2788       +4     
==========================================
+ Hits         1299     1303       +4     
  Misses       1485     1485              
Impacted Files Coverage Δ
dds_cli/__main__.py 42.33% <0.00%> (+0.32%) ⬆️
dds_cli/base.py 41.50% <0.00%> (-0.40%) ⬇️
dds_cli/exceptions.py 89.58% <100.00%> (+0.22%) ⬆️

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

Copy link
Member

@valyo valyo left a comment

Choose a reason for hiding this comment

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

Looks fine, but not sure how it can be tested manually

@i-oden
Copy link
Member Author

i-oden commented Mar 6, 2023

Looks fine, but not sure how it can be tested manually

👍🏻

How to test manually:

  1. Partial uploads

    a) dds data put --source [file / directory 1] --project [project ID]
    b) echo $? should return 0
    c) dds data put --source [file / directory 1] --source [file / directory 2] --project [project ID]
    d) echo $? should return 1

  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) echo $? should return 1

@valyo
Copy link
Member

valyo commented Mar 6, 2023

Followed the manual testing protocol and everything works as expected.

@i-oden
Copy link
Member Author

i-oden commented Mar 6, 2023

Followed the manual testing protocol and everything works as expected.

Great!

@i-oden i-oden merged commit 733ffd6 into dev Mar 6, 2023
@i-oden i-oden deleted the DDS-1484-error-code-to-be-returned-from-cli-if-any-error branch March 6, 2023 10:24
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