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

feature: add partitions #517

Merged
merged 20 commits into from
Aug 14, 2023
Merged

feature: add partitions #517

merged 20 commits into from
Aug 14, 2023

Conversation

lengau
Copy link
Contributor

@lengau lengau commented Aug 10, 2023

This adds an optional feature for partitions (as specified in ST086). An application that enables this will have the ability to create multiple binary outputs as separate partitions, which can then be used to build multiple packages or a single package with multiple root directory trees.

Based on 075eac2 by @mr-cal

@lengau lengau force-pushed the craft-1846 branch 7 times, most recently from 7c0939b to d95e1c3 Compare August 10, 2023 06:41
@lengau lengau marked this pull request as ready for review August 10, 2023 06:47
@lengau lengau requested a review from mr-cal August 10, 2023 16:57
@lengau lengau changed the title partitions: completed partitions feature feature: add partitions Aug 10, 2023
craft_parts/executor/step_handler.py Outdated Show resolved Hide resolved
craft_parts/executor/step_handler.py Outdated Show resolved Hide resolved
craft_parts/lifecycle_manager.py Outdated Show resolved Hide resolved
@cmatsuoka
Copy link
Collaborator

Looks nice, added a few comments about always using part-defined variables instead of assuming the layout of the partition dirs. Also it would be interesting to have a PR description telling what we're implementing here, since that will become the git commit description for this change.

Copy link
Contributor

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

Alex, this is a lot of great work! I haven't finished reviewing the tests and I don't think I can review all of them today, so is there a subset of them that you think you/we should prioritize reviewing?

craft_parts/executor/environment.py Outdated Show resolved Hide resolved
craft_parts/executor/environment.py Outdated Show resolved Hide resolved
craft_parts/utils/path_utils.py Outdated Show resolved Hide resolved
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.

Awesome work, thank you. +1, but please check @tigarmo's comments about hardcoded paths in environment setup.

@lengau lengau requested a review from tigarmo August 11, 2023 22:17
Copy link
Contributor

@tigarmo tigarmo 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!

@lengau lengau merged commit 16db872 into main Aug 14, 2023
7 checks passed
@lengau lengau deleted the craft-1846 branch August 14, 2023 16:57
syu-w referenced this pull request in canonical/charmcraft Sep 15, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [craft-cli](https://togithub.com/canonical/craft-cli) | `==2.0.1` ->
`==2.1.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/craft-cli/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/craft-cli/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/craft-cli/2.0.1/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/craft-cli/2.0.1/2.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [craft-parts](https://togithub.com/canonical/craft-parts) | `==1.23.0`
-> `==1.24.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/craft-parts/1.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/craft-parts/1.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/craft-parts/1.23.0/1.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/craft-parts/1.23.0/1.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [snap-helpers](https://togithub.com/albertodonato/snap-helpers)
([changelog](https://togithub.com/albertodonato/snap-helpers/blob/main/CHANGES.rst))
| `==0.4.0` -> `==0.4.2` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/snap-helpers/0.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/snap-helpers/0.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/snap-helpers/0.4.0/0.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/snap-helpers/0.4.0/0.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>canonical/craft-cli (craft-cli)</summary>

###
[`v2.1.0`](https://togithub.com/canonical/craft-cli/releases/tag/2.1.0)

[Compare
Source](https://togithub.com/canonical/craft-cli/compare/2.0.1...2.1.0)

Special thanks to the contributors that made this release happen:
[@&#8203;lengau](https://togithub.com/lengau) and
[@&#8203;tigarmo](https://togithub.com/tigarmo)

##### Full list of changes

- tests: move test module from unit/ to integration/
[@&#8203;tigarmo](https://togithub.com/tigarmo)
([#&#8203;167](https://togithub.com/canonical/craft-cli/issues/167))
- ci: fix renovate schedule
[@&#8203;lengau](https://togithub.com/lengau)
([#&#8203;168](https://togithub.com/canonical/craft-cli/issues/168))
- emitter: add "streaming brief" feature
[@&#8203;tigarmo](https://togithub.com/tigarmo)
([#&#8203;166](https://togithub.com/canonical/craft-cli/issues/166))

</details>

<details>
<summary>canonical/craft-parts (craft-parts)</summary>

###
[`v1.24.1`](https://togithub.com/canonical/craft-parts/compare/1.24.0...1.24.1)

[Compare
Source](https://togithub.com/canonical/craft-parts/compare/1.24.0...1.24.1)

###
[`v1.24.0`](https://togithub.com/canonical/craft-parts/releases/tag/1.24.0)

[Compare
Source](https://togithub.com/canonical/craft-parts/compare/1.23.1...1.24.0)

##### What's Changed

- Release 1.19.6 by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka)
in
[https://github.com/canonical/craft-parts/pull/473](https://togithub.com/canonical/craft-parts/pull/473)
- partitions: add feature and validation by
[@&#8203;mr-cal](https://togithub.com/mr-cal) in
[https://github.com/canonical/craft-parts/pull/489](https://togithub.com/canonical/craft-parts/pull/489)
- tests: add jammy packages to stage package apt cache by
[@&#8203;mr-cal](https://togithub.com/mr-cal) in
[https://github.com/canonical/craft-parts/pull/494](https://togithub.com/canonical/craft-parts/pull/494)
- partitions: validate usage of partitions in parts by
[@&#8203;mr-cal](https://togithub.com/mr-cal) in
[https://github.com/canonical/craft-parts/pull/493](https://togithub.com/canonical/craft-parts/pull/493)
- deps: freeze pydantic-yaml <1.0.0 by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/498](https://togithub.com/canonical/craft-parts/pull/498)
- docs: update Sphinx theme by
[@&#8203;dboddie](https://togithub.com/dboddie) in
[https://github.com/canonical/craft-parts/pull/501](https://togithub.com/canonical/craft-parts/pull/501)
- docs: fix product page URL by
[@&#8203;dboddie](https://togithub.com/dboddie) in
[https://github.com/canonical/craft-parts/pull/506](https://togithub.com/canonical/craft-parts/pull/506)
- deps: freeze pydantic version by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/511](https://togithub.com/canonical/craft-parts/pull/511)
- tests: add jammy packages to stage package apt cache
([#&#8203;494](https://togithub.com/canonical/craft-parts/issues/494))
by [@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/512](https://togithub.com/canonical/craft-parts/pull/512)
- partitions: add utility to make partition compatible filepaths by
[@&#8203;mr-cal](https://togithub.com/mr-cal) in
[https://github.com/canonical/craft-parts/pull/497](https://togithub.com/canonical/craft-parts/pull/497)
- sequencer: only load project vars in adopting part by
[@&#8203;cmatsuoka](https://togithub.com/cmatsuoka) in
[https://github.com/canonical/craft-parts/pull/509](https://togithub.com/canonical/craft-parts/pull/509)
- Release 1.19.7 by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka)
in
[https://github.com/canonical/craft-parts/pull/515](https://togithub.com/canonical/craft-parts/pull/515)
- docs: disable pdf in .readthedocs.yml by
[@&#8203;sergiusens](https://togithub.com/sergiusens) in
[https://github.com/canonical/craft-parts/pull/510](https://togithub.com/canonical/craft-parts/pull/510)
- executor: add prologue INFO-level log messages by
[@&#8203;tigarmo](https://togithub.com/tigarmo) in
[https://github.com/canonical/craft-parts/pull/518](https://togithub.com/canonical/craft-parts/pull/518)
- feature: add partitions by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/517](https://togithub.com/canonical/craft-parts/pull/517)
- Merge/1.19.7 by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka) in
[https://github.com/canonical/craft-parts/pull/522](https://togithub.com/canonical/craft-parts/pull/522)
- docs: make Python plugin reference reusable by
[@&#8203;dboddie](https://togithub.com/dboddie) in
[https://github.com/canonical/craft-parts/pull/505](https://togithub.com/canonical/craft-parts/pull/505)
- ci: fix renovate scheduling by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/523](https://togithub.com/canonical/craft-parts/pull/523)
- Merge 1.23.1 by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka) in
[https://github.com/canonical/craft-parts/pull/527](https://togithub.com/canonical/craft-parts/pull/527)
- chore: fix doc and yaml linting by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/529](https://togithub.com/canonical/craft-parts/pull/529)
- lint: update and freeze pyright by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/531](https://togithub.com/canonical/craft-parts/pull/531)
- partitions: make partitions optional in ProjectDirs by
[@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/528](https://togithub.com/canonical/craft-parts/pull/528)
- docs: fix tox documentation builds by
[@&#8203;dboddie](https://togithub.com/dboddie) in
[https://github.com/canonical/craft-parts/pull/502](https://togithub.com/canonical/craft-parts/pull/502)
- environment: add build-on and build-for architectures by
[@&#8203;cmatsuoka](https://togithub.com/cmatsuoka) in
[https://github.com/canonical/craft-parts/pull/532](https://togithub.com/canonical/craft-parts/pull/532)
- autotools plugin: support bootstrap parameters by
[@&#8203;sergiusens](https://togithub.com/sergiusens) in
[https://github.com/canonical/craft-parts/pull/533](https://togithub.com/canonical/craft-parts/pull/533)
- Release 1.24.0 by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka)
in
[https://github.com/canonical/craft-parts/pull/534](https://togithub.com/canonical/craft-parts/pull/534)

**Full Changelog**:
canonical/craft-parts@1.23.1...1.24.0

###
[`v1.23.1`](https://togithub.com/canonical/craft-parts/releases/tag/1.23.1)

[Compare
Source](https://togithub.com/canonical/craft-parts/compare/1.23.0...1.23.1)

##### What's Changed

- deps: freeze pydantic-yaml <1.0.0
([#&#8203;498](https://togithub.com/canonical/craft-parts/issues/498))
by [@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/519](https://togithub.com/canonical/craft-parts/pull/519)
- tests: add jammy packages to stage package apt cache
([#&#8203;494](https://togithub.com/canonical/craft-parts/issues/494))
by [@&#8203;lengau](https://togithub.com/lengau) in
[https://github.com/canonical/craft-parts/pull/520](https://togithub.com/canonical/craft-parts/pull/520)
- sequencer: only load project vars in adopting part
([#&#8203;509](https://togithub.com/canonical/craft-parts/issues/509))
by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka) in
[https://github.com/canonical/craft-parts/pull/516](https://togithub.com/canonical/craft-parts/pull/516)
- Release 1.23.1 by [@&#8203;cmatsuoka](https://togithub.com/cmatsuoka)
in
[https://github.com/canonical/craft-parts/pull/526](https://togithub.com/canonical/craft-parts/pull/526)

**Full Changelog**:
canonical/craft-parts@1.23.0...1.23.1

</details>

<details>
<summary>albertodonato/snap-helpers (snap-helpers)</summary>

###
[`v0.4.2`](https://togithub.com/albertodonato/snap-helpers/blob/HEAD/CHANGES.rst#v042---2023-08-06)

[Compare
Source](https://togithub.com/albertodonato/snap-helpers/compare/0.4.1...0.4.2)

\===================

-   Rebuild to fix version

###
[`v0.4.1`](https://togithub.com/albertodonato/snap-helpers/blob/HEAD/CHANGES.rst#v041---2023-08-06)

[Compare
Source](https://togithub.com/albertodonato/snap-helpers/compare/0.4.0...0.4.1)

\===================

-   Add missing py.typed marker to package
-   \[docs] Fix ReadTheDocs setup

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" in timezone Etc/UTC,
Automerge - "before 07:00" in timezone Etc/UTC.

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/canonical/charmcraft).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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