diff --git a/CHANGES/+python-remote-vulnerabilities.feature b/CHANGES/+python-remote-vulnerabilities.feature new file mode 100644 index 000000000..89db96ae7 --- /dev/null +++ b/CHANGES/+python-remote-vulnerabilities.feature @@ -0,0 +1 @@ +Added `--vulnerabilities`/`--no-vulnerabilities` options to Python remotes to control automatic vulnerability scans after sync. diff --git a/src/pulpcore/cli/python/remote.py b/src/pulpcore/cli/python/remote.py index 33c98a49f..f214e8df5 100644 --- a/src/pulpcore/cli/python/remote.py +++ b/src/pulpcore/cli/python/remote.py @@ -88,6 +88,12 @@ def remote() -> None: help=_("Sync available package provenances"), needs_plugins=[PluginRequirement("python", specifier=">=3.22.0")], ), + pulp_option( + "--vulnerabilities/--no-vulnerabilities", + default=None, + help=_("Scan new repository versions for vulnerabilities after each successful sync"), + needs_plugins=[PluginRequirement("python", specifier=">=3.37.0")], + ), ] remote.add_command(list_command(decorators=remote_filter_options)) diff --git a/tests/scripts/pulp_python/test_remote.sh b/tests/scripts/pulp_python/test_remote.sh index 5f5111b0c..1d17ffef8 100755 --- a/tests/scripts/pulp_python/test_remote.sh +++ b/tests/scripts/pulp_python/test_remote.sh @@ -37,9 +37,15 @@ test "$(echo "$OUTPUT" | jq -r .includes[1])" = "shelf-reader" test "$(echo "$OUTPUT" | jq -r .includes[2])" = "pulp_python" expect_succ pulp python remote list -expect_succ pulp python remote create --name "cli_test_complex_remote" --url "$PYTHON_REMOTE_URL" --keep-latest-packages 3 --package-types '["sdist", "bdist_wheel"]' --exclude-platforms '["windows"]' +expect_succ pulp python remote create --name "cli_test_complex_remote" \ + --url "$PYTHON_REMOTE_URL" --keep-latest-packages 3 \ + --package-types '["sdist", "bdist_wheel"]' --exclude-platforms '["windows"]' if pulp debug has-plugin --name "python" --specifier ">=3.22.0" then expect_succ pulp python remote update --remote "cli_test_complex_remote" --provenance fi +if pulp debug has-plugin --name "python" --specifier ">=3.37.0" +then + expect_succ pulp python remote update --remote "cli_test_complex_remote" --vulnerabilities +fi expect_succ pulp python remote destroy --remote "cli_test_python_remote"