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

sources: introduce SnapcraftSourceNotFoundError #2604

Merged
merged 1 commit into from
Jun 20, 2019

Conversation

cjp256
Copy link
Contributor

@cjp256 cjp256 commented Jun 18, 2019

Many of the errors seen by users indicate source not found.

  • introduce SnapcraftSourceNotFoundError with helpful error
    message
  • chain to FileNotFoundError raised by shutil.copy2(), a common
    cause of the captured FileNotFoundError exceptions

Signed-off-by: Chris Patterson chris.patterson@canonical.com

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run ./runtests.sh static?
  • Have you successfully run ./runtests.sh tests/unit?

Copy link
Collaborator

@sergiusens sergiusens left a comment

Choose a reason for hiding this comment

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

Very nice!

Can you please make sure that at least a test for the exception is added to tests.unit.test_errors ?

@cjp256
Copy link
Contributor Author

cjp256 commented Jun 19, 2019

Will do.

@codecov-io
Copy link

codecov-io commented Jun 19, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@adb41b0). Click here to learn what that means.
The diff coverage is 62.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2604   +/-   ##
=========================================
  Coverage          ?   89.06%           
=========================================
  Files             ?      206           
  Lines             ?    14052           
  Branches          ?     2123           
=========================================
  Hits              ?    12516           
  Misses            ?     1085           
  Partials          ?      451
Impacted Files Coverage Δ
snapcraft/internal/sources/_base.py 89.02% <50%> (ø)
snapcraft/internal/sources/errors.py 95.55% <75%> (ø)

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 adb41b0...6089bed. Read the comment docs.

@cjp256
Copy link
Contributor Author

cjp256 commented Jun 19, 2019

Added tests and simplified some crufty logic I noticed while in there...

@sergiusens
Copy link
Collaborator

Fixes SNAPCRAFT-VV
Fixes SNAPCRAFT-VN
Fixes SNAPCRAFT-VV
Fixes SNAPCRAFT-TJ
Fixes SNAPCRAFT-T9
Fixes SNAPCRAFT-TE

@cjp256
Copy link
Contributor Author

cjp256 commented Jun 19, 2019

Fixed formatting issue.

Many of the errors seen by users indicate source not found.

- introduce SnapcraftSourceNotFoundError with helpful error
  message
- chain to FileNotFoundError raised by shutil.copy2(), a common
  cause of the captured FileNotFoundError exceptions
- add tests to validate
- simplify some crufty logic while i'm in here

Fixes SNAPCRAFT-VV
Fixes SNAPCRAFT-VN
Fixes SNAPCRAFT-VV
Fixes SNAPCRAFT-TJ
Fixes SNAPCRAFT-T9
Fixes SNAPCRAFT-TE

Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
@sergiusens sergiusens merged commit 7527d0e into canonical:master Jun 20, 2019
@cjp256 cjp256 deleted the source-error branch June 27, 2019 20:35
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