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

chore: merge feature/components into feature/craft-application #4654

Merged
merged 33 commits into from
Mar 19, 2024

Conversation

sergiusens
Copy link
Collaborator

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run tox run -m lint?
  • Have you successfully run tox run -e test-py310? (supported versions: py39, py310, py311, py312)

mr-cal and others added 12 commits December 11, 2023 17:02
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Co-authored-by: Sheng Yu <sheng.yu@canonical.com>
Upcoming Chisel (and chisel-releases) changes will break older versions
of the tool; update it to v0.8.1 which is compatible with this change
and gives us some breathing room before we change the way Chisel is
provisioned.

Ref: canonical/rockcraft#449

Co-authored-by: Tiago Nobrega <tiago.nobrega@canonical.com>
…4566)

Components beginning with `snap-` are reserved for future use by snapd.

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
@sergiusens sergiusens changed the title Craft 2581/merge components chore: merge feature/components into feature/craft-application Mar 11, 2024
@sergiusens sergiusens force-pushed the CRAFT-2581/merge-components branch from 35bd29b to b5db5b5 Compare March 12, 2024 16:57
@sergiusens sergiusens marked this pull request as ready for review March 12, 2024 17:04
@sergiusens sergiusens requested review from mr-cal and syu-w March 12, 2024 17:04
Copy link
Collaborator

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Looks good. The CI failures are due to #4651, but once canonical/craft-parts#684 lands and you revert the changes to the requirement files here, the new top-level partition implementation will cause tests to start failing (like tests that assert for prime/default/<file>).

snapcraft/providers.py Show resolved Hide resolved
@sergiusens
Copy link
Collaborator Author

Looks good. The CI failures are due to #465, but once canonical/craft-parts#684 lands and you revert the changes to the requirement files here, the new top-level partition implementation will cause tests to start failing (like tests that assert for prime/default/<file>).

Wrong issue linked?

@mr-cal
Copy link
Collaborator

mr-cal commented Mar 12, 2024

Looks good. The CI failures are due to #465, but once canonical/craft-parts#684 lands and you revert the changes to the requirement files here, the new top-level partition implementation will cause tests to start failing (like tests that assert for prime/default/<file>).

Wrong issue linked?

Whoops, yes. I corrected the original comment from 465 to 4651

Copy link
Contributor

@syu-w syu-w left a comment

Choose a reason for hiding this comment

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

Not sure if we need to wait the fixes

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@sergiusens sergiusens requested a review from tigarmo March 13, 2024 18:59
@tigarmo
Copy link
Contributor

tigarmo commented Mar 14, 2024

There are quite a few test failures

@sergiusens
Copy link
Collaborator Author

yeah, the version check tests are all failing, I am not sure what happened, because I am certain I fixed them 😓

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@sergiusens sergiusens force-pushed the CRAFT-2581/merge-components branch from f11914c to 035a981 Compare March 14, 2024 17:00
A refactor happened in Craft Parts and the logic was not carried over
to Snapcraft in the Craft Parts commit
9fe38d11637f037b37fe76aa5ecc013a9bc39695

This is however an irrelevant test with regards to the Snapcraft
Application itself.

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@sergiusens sergiusens force-pushed the CRAFT-2581/merge-components branch from 035a981 to 2cf7751 Compare March 14, 2024 17:55
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 95.20958% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 89.42%. Comparing base (a019fe7) to head (7b083e6).
Report is 41 commits behind head on feature/craft-application.

Files Patch % Lines
snapcraft/parts/lifecycle.py 91.48% 4 Missing ⚠️
snapcraft/models/project.py 95.38% 3 Missing ⚠️
snapcraft/pack.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feature/craft-application    #4654      +/-   ##
=============================================================
+ Coverage                      89.14%   89.42%   +0.27%     
=============================================================
  Files                            331      336       +5     
  Lines                          22078    22433     +355     
=============================================================
+ Hits                           19682    20061     +379     
+ Misses                          2396     2372      -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tigarmo
Copy link
Contributor

tigarmo commented Mar 14, 2024

@sergiusens I see the component-related spread tests are still failing, do you want me to review the PR still?

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Also make the clean actually clean the correct provider

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
It was cd-ing into snap but not cleaning from within.

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@sergiusens
Copy link
Collaborator Author

@tigarmo organize is not organizing from the looks of it. Would be great if anyone can figure out why. I added a couple more test fixes and a spread cleanup as there were errors in how it was done (left overs)

@sergiusens
Copy link
Collaborator Author

we also do not need 3 tests for components, one could have been enough

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Partitions/Components are not working in non-destructive-mode

Clean up testing

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
use better naming for easier error detection

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
# exclude a file in the default partition
- -(default)/other-file-in-snap
prime:
# exclude a file in a partitionk
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# exclude a file in a partitionk
# exclude a file in a partition

setup.py Outdated
@@ -101,7 +101,7 @@ def recursive_data_files(directory, install_directory):
"craft-cli",
"craft-grammar",
"craft-parts",
"craft-providers",
"craft-providers @ git+https://github.com/canonical/craft-providers@main#egg=craft-providers",
Copy link
Collaborator

Choose a reason for hiding this comment

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

craft-providers 1.23.1 is released, I don't think you need to bring this in

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great! I thought I had gotten rid of this!

snap refresh snapd --stable

execute: |
# Craft Parts is not partitions aware during organize in managed mode
Copy link
Collaborator

@mr-cal mr-cal Mar 18, 2024

Choose a reason for hiding this comment

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

I tested, canonical/craft-parts#689 fixes this, so we'll be able to fix this in a subsequent PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

might as well have @cmatsuoka release that tomorrow and I can just ensure we update the test here

cmatsuoka pushed a commit to canonical/craft-parts that referenced this pull request Mar 19, 2024
Fixes an issue discovered via canonical/snapcraft#4654 where `organize_files()`
would organize in the cwd instead of the project's base_dir.

The problem was that `organize_files()` was redefining a part's install directories
incorrectly by creating relative filepaths.

To fix this, organize_files now accepts the part's install directories instead of
redefining them.

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
cmatsuoka pushed a commit to cmatsuoka/craft-parts that referenced this pull request Mar 19, 2024
Fixes an issue discovered via canonical/snapcraft#4654 where `organize_files()`
would organize in the cwd instead of the project's base_dir.

The problem was that `organize_files()` was redefining a part's install directories
incorrectly by creating relative filepaths.

To fix this, organize_files now accepts the part's install directories instead of
redefining them.

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
cmatsuoka added a commit to canonical/craft-parts that referenced this pull request Mar 19, 2024
Fixes an issue discovered via canonical/snapcraft#4654 where `organize_files()`
would organize in the cwd instead of the project's base_dir.

The problem was that `organize_files()` was redefining a part's install directories
incorrectly by creating relative filepaths.

To fix this, organize_files now accepts the part's install directories instead of
redefining them.

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
They need fixing and should be added as part of the task to implement
the feature itself.

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@sergiusens sergiusens merged commit 76e909d into feature/craft-application Mar 19, 2024
9 of 12 checks passed
@sergiusens sergiusens deleted the CRAFT-2581/merge-components branch March 19, 2024 18:55
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