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

meta: fix management of snap/local #2502

Merged
merged 2 commits into from
Mar 15, 2019

Conversation

sergiusens
Copy link
Collaborator

@sergiusens sergiusens commented Mar 14, 2019

Do not copy snap/local into the snap, furthermore, improve the copy
logic to work better with embedded directories.

Fixes SNAPCRAFT-J2
Fixes SNAPCRAFT-JB

Signed-off-by: Sergio Schvezov sergio.schvezov@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?

Do not copy snap/local into the snap, furthermore, improve the copy
logic to work better with embedded directories.

Fixes SNAPCRAFT-J2
Fixes SNAPCRAFT-JB

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@codecov-io
Copy link

codecov-io commented Mar 14, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2502   +/-   ##
=========================================
  Coverage          ?   89.92%           
=========================================
  Files             ?      198           
  Lines             ?    13356           
  Branches          ?     2021           
=========================================
  Hits              ?    12011           
  Misses            ?      921           
  Partials          ?      424
Impacted Files Coverage Δ
snapcraft/internal/meta/_snap_packaging.py 90.84% <100%> (ø)

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 636d6be...ae0451a. Read the comment docs.

snap_dir_iter = itertools.product([prime_snap_dir], ["hooks"])
meta_dir_iter = itertools.product([self._meta_dir], ["hooks", "gui"])

for origin in itertools.chain(snap_dir_iter, meta_dir_iter):
Copy link
Contributor

@cmatsuoka cmatsuoka Mar 15, 2019

Choose a reason for hiding this comment

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

This is a bit convoluted way to set src_dir and dst_dir, I hope we still understand the logic in the future. Perhaps we could add a small comment to clarify our intention?

Copy link
Contributor

@cmatsuoka cmatsuoka left a comment

Choose a reason for hiding this comment

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

The current implementation seems much better than the original one, but a brief comment in the iterator logic would make sure we won't be puzzled a few months/years from now.

Copy link
Contributor

@cmatsuoka cmatsuoka left a comment

Choose a reason for hiding this comment

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

Nah, reading the code again it seems pretty obvious. Go ahead.

@sergiusens sergiusens merged commit e48cd84 into canonical:master Mar 15, 2019
@sergiusens sergiusens deleted the sentry-local branch March 15, 2019 22:26
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.

4 participants