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(PartSpec): add source-channel attribute #981

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions craft_parts/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class PartSpec(BaseModel):
plugin: str | None = None
source: str | None = None
source_checksum: str = ""
source_channel: str | None = None
source_branch: str = ""
source_commit: str = ""
source_depth: int = 0
Expand Down
1 change: 1 addition & 0 deletions craft_parts/sources/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def get_source_handler(
source=part.spec.source,
part_src_dir=part.part_src_dir,
source_checksum=part.spec.source_checksum,
source_channel=part.spec.source_channel,
source_branch=part.spec.source_branch,
source_tag=part.spec.source_tag,
source_depth=part.spec.source_depth,
Expand Down
1 change: 1 addition & 0 deletions craft_parts/state_manager/pull_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def properties_of_interest(
"source-depth",
"source-tag",
"source-type",
"source-channel",
"source-branch",
"source-subdir",
"source-submodules",
Expand Down
15 changes: 15 additions & 0 deletions docs/reference/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ Changelog
X.Y.Z (2025-MM-DD)
------------------

New features:

- Add new PartSpec property ``source-channel``.

Bug fixes:

- Correctly handle ``source-subdir`` values on the ``go-use`` plugin.

Documentation:

- Add missing links to GitHub releases.


2.3.0 (2025-01-20)
------------------
Expand All @@ -30,6 +38,7 @@ Documentation:

- Correct the Maven plugin docstring to refer to Maven from Go.

For a complete list of commits, check out the `2.3.0`_ release on GitHub.

2.2.2 (2025-01-13)
------------------
Expand All @@ -38,6 +47,7 @@ Documentation:

- Add a cross-reference target for Poetry external links.

For a complete list of commits, check out the `2.2.2`_ release on GitHub.

2.2.1 (2024-12-19)
------------------
Expand All @@ -47,6 +57,8 @@ Bug fixes:
- Fix how extras and groups are parsed for the
:ref:`uv plugin<craft_parts_uv_plugin>`.

For a complete list of commits, check out the `2.2.1`_ release on GitHub.

2.2.0 (2024-12-16)
------------------

Expand Down Expand Up @@ -722,6 +734,9 @@ For a complete list of commits, check out the `2.0.0`_ release on GitHub.
.. _craft-cli issue #172: https://github.com/canonical/craft-cli/issues/172
.. _Poetry: https://python-poetry.org

.. _2.3.0: https://github.com/canonical/craft-parts/releases/tag/2.3.0
.. _2.2.2: https://github.com/canonical/craft-parts/releases/tag/2.2.2
.. _2.2.1: https://github.com/canonical/craft-parts/releases/tag/2.2.1
.. _2.2.0: https://github.com/canonical/craft-parts/releases/tag/2.2.0
.. _2.1.4: https://github.com/canonical/craft-parts/releases/tag/2.1.4
.. _2.1.3: https://github.com/canonical/craft-parts/releases/tag/2.1.3
Expand Down
1 change: 1 addition & 0 deletions tests/unit/features/overlay/test_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_marshal_unmarshal(self):
"plugin": "nil",
"source": "http://example.com/hello-2.3.tar.gz",
"source-checksum": "md5/d9210476aac5f367b14e513bdefdee08",
"source-channel": None,
"source-branch": "release",
"source-commit": "2514f9533ec9b45d07883e10a561b248497a8e3c",
"source-depth": 3,
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/state_manager/test_pull_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def test_property_changes(self, properties):
"source-depth",
"source-tag",
"source-type",
"source-channel",
"source-branch",
"source-subdir",
"source-submodules",
Expand Down Expand Up @@ -125,6 +126,7 @@ def test_extra_property_changes(self, properties):
"source-depth",
"source-tag",
"source-type",
"source-channel",
"source-branch",
"source-subdir",
"source-submodules",
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_marshal_unmarshal(self, partitions):
"plugin": "nil",
"source": "http://example.com/hello-2.3.tar.gz",
"source-checksum": "md5/d9210476aac5f367b14e513bdefdee08",
"source-channel": None,
"source-branch": "release",
"source-commit": "2514f9533ec9b45d07883e10a561b248497a8e3c",
"source-depth": 3,
Expand Down
Loading