Skip to content
Open
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 CHANGES/+error-on-reject.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `--error-on-reject`/`--no-error-on-reject` options to `pulp python repository`.
2 changes: 2 additions & 0 deletions pulp-glue/src/pulp_glue/python/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def preprocess_entity(self, body: EntityDefinition, partial: bool = False) -> En
body = super().preprocess_entity(body, partial=partial)
if "allow_package_substitution" in body:
self.pulp_ctx.needs_plugin(PluginRequirement("python", specifier=">=3.28.0"))
if "error_on_reject" in body:
self.pulp_ctx.needs_plugin(PluginRequirement("python", specifier=">=3.34.0"))
return body

def repair_metadata(self) -> t.Any:
Expand Down
10 changes: 10 additions & 0 deletions src/pulpcore/cli/python/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ def repository() -> None:
" different checksum. When blocked, such operations are rejected."
),
),
pulp_option(
"--error-on-reject/--no-error-on-reject",
needs_plugins=[PluginRequirement("python", specifier=">=3.34.0")],
default=None,
help=_(
"Fail the entire repository version when packages are rejected by the"
" package substitution or blocklist policies. When disabled, rejected"
" packages are skipped and remaining packages are added."
),
),
retained_versions_option,
pulp_labels_option,
]
Expand Down
8 changes: 8 additions & 0 deletions tests/scripts/pulp_python/test_repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ if pulp debug has-plugin --name "python" --specifier ">=3.28.0"; then
expect_succ test "$(echo "$OUTPUT" | jq -r '.allow_package_substitution')" = "false"
fi

if pulp debug has-plugin --name "python" --specifier ">=3.34.0"; then
expect_succ pulp python repository show --repository "cli_test_python_repo"
expect_succ test "$(echo "$OUTPUT" | jq -r '.error_on_reject')" = "true"
expect_succ pulp python repository update --repository "cli_test_python_repo" --no-error-on-reject
expect_succ pulp python repository show --repository "cli_test_python_repo"
expect_succ test "$(echo "$OUTPUT" | jq -r '.error_on_reject')" = "false"
fi

expect_succ pulp python repository destroy --name "cli_test_python_repo"
Loading