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

feat: add a utility function that determines whether a part has slices #637

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

linostar
Copy link
Contributor

  • Have you signed the CLA?

A utility function is needed in rockcraft to determine whether parts has slices in them.
Instead of implementing such a function in rockcraft, it is better to implement it in craft-parts instead.

@linostar
Copy link
Contributor Author

@tigarmo Ready for review.

@linostar
Copy link
Contributor Author

Tagging @cmatsuoka @lengau @mr-cal for review.

Failing integreation test is due to network connection issue so it needs a retrigger.

craft_parts/parts.py Outdated Show resolved Hide resolved
craft_parts/parts.py Outdated Show resolved Hide resolved
@linostar linostar force-pushed the ROCKS-970/util-function-for-determining-if-parts-have-slices branch 3 times, most recently from c71971d to 71d1b19 Compare February 6, 2024 19:05
@linostar linostar force-pushed the ROCKS-970/util-function-for-determining-if-parts-have-slices branch from 71d1b19 to 727e012 Compare February 6, 2024 19:08
@linostar
Copy link
Contributor Author

linostar commented Feb 6, 2024

I have changed the utility function to a property, and added unit tests for it. This is to accomodate the function to how similar functions are unit tested.
Note the failing unit-tests checks are not related to this PR.

Copy link
Contributor

@lengau lengau left a comment

Choose a reason for hiding this comment

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

Code looks good, thanks :-)

craft_parts/parts.py Outdated Show resolved Hide resolved
@lengau
Copy link
Contributor

lengau commented Aug 28, 2024

@linostar could you rebase this on main and resolve the conflicts here?

Copy link
Collaborator

@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.

LGTM, maybe we could make it slightly more performant with a short-circuit return in has_slice.

craft_parts/parts.py Outdated Show resolved Hide resolved
@linostar
Copy link
Contributor Author

@cmatsuoka @tigarmo Can we merge this PR if there are no further comments, so that we can move forward with canonical/rockcraft#464?

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.

5 participants