Skip to content

Commit

Permalink
feat(PartSpec): add source-channel attribute (#981)
Browse files Browse the repository at this point in the history
Signed-off-by: Dariusz Duda <dariusz.duda@canonical.com>
  • Loading branch information
dariuszd21 authored Jan 23, 2025
1 parent a0bcd83 commit 17c86f6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
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

0 comments on commit 17c86f6

Please sign in to comment.