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

Add the ReleaseComponent content create command #101

Merged
merged 1 commit into from
May 6, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/118.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added the create command for content of type release_component.
16 changes: 14 additions & 2 deletions pulpcore/cli/deb/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _sha256_artifact_callback(
"Repository to add the content to in the form '[[<plugin>:]<resource_type>:]<name>' or by "
"href."
),
allowed_with_contexts=(PulpDebPackageContext,),
allowed_with_contexts=(PulpDebPackageContext, PulpDebReleaseComponentContext),
)


Expand Down Expand Up @@ -272,12 +272,24 @@ def content() -> None:
callback=_sha256_artifact_callback,
allowed_with_contexts=(PulpDebPackageContext,),
),
pulp_option(
"--distribution",
required=True,
help=_("The APT repo distribution to use"),
allowed_with_contexts=(PulpDebReleaseComponentContext,),
),
pulp_option(
"--component",
required=True,
help=_("The APT repo component to use"),
allowed_with_contexts=(PulpDebReleaseComponentContext,),
),
repository_option,
]
content.add_command(
create_command(
decorators=create_options,
allowed_with_contexts=(PulpDebPackageContext,),
allowed_with_contexts=(PulpDebPackageContext, PulpDebReleaseComponentContext),
)
)

Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/pulp_deb/test_deb_content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,8 @@ expect_succ test "$(echo "${OUTPUT}" | jq -r 'length')" -eq 4

# make sure the package we've been playing with is cleaned up immediately
expect_succ pulp orphan cleanup --content-hrefs "[\"${PACKAGE_HREF}\"]" --protection-time 0 || true

# Test creating a release_component:
expect_succ pulp deb content --type release_component create --distribution foo --component bar
RELEASE_COMPONENT_HREF=$(echo "${OUTPUT}" | jq -r .pulp_href)
expect_succ pulp orphan cleanup --content-hrefs "[\"${RELEASE_COMPONENT_HREF}\"]" --protection-time 0 || true