diff --git a/CHANGES/691.bugfix b/CHANGES/691.bugfix new file mode 100644 index 00000000..448af729 --- /dev/null +++ b/CHANGES/691.bugfix @@ -0,0 +1 @@ +Fixed the `package_types` filter breaking other remote filters. diff --git a/pulp_python/app/tasks/sync.py b/pulp_python/app/tasks/sync.py index 3af26a59..1293c613 100644 --- a/pulp_python/app/tasks/sync.py +++ b/pulp_python/app/tasks/sync.py @@ -83,7 +83,7 @@ def create_bandersnatch_config(remote): config["plugins"]["enabled"] += "prerelease_release\n" if remote.package_types: rrfm = "regex_release_file_metadata" - config["plugins"]["enabled"] += rrfm + config["plugins"]["enabled"] += f"{rrfm}\n" if not config.has_section(rrfm): config.add_section(rrfm) config[rrfm]["any:release_file.packagetype"] = "\n".join(remote.package_types) diff --git a/pulp_python/tests/functional/api/test_sync.py b/pulp_python/tests/functional/api/test_sync.py index 20e6b19c..0a846cf6 100644 --- a/pulp_python/tests/functional/api/test_sync.py +++ b/pulp_python/tests/functional/api/test_sync.py @@ -264,6 +264,23 @@ def test_sync_platform_exclude( assert summary.present["python.python"]["count"] == SCIPY_COUNTS["no_os"] +@pytest.mark.parallel +def test_sync_multiple_filters( + python_repo_with_sync, python_remote_factory, python_content_summary +): + """Tests sync with multiple filters.""" + remote = python_remote_factory( + includes=PYTHON_LG_PROJECT_SPECIFIER, + package_types=["bdist_wheel"], + keep_latest_packages=1, + prereleases=False + ) + repo = python_repo_with_sync(remote) + + summary = python_content_summary(repository_version=repo.latest_version_href) + assert summary.present["python.python"]["count"] == PYTHON_LG_FIXTURE_COUNTS["multi"] + + @pytest.mark.parallel def test_proxy_sync( python_bindings, diff --git a/pulp_python/tests/functional/constants.py b/pulp_python/tests/functional/constants.py index e449fe92..d371db25 100644 --- a/pulp_python/tests/functional/constants.py +++ b/pulp_python/tests/functional/constants.py @@ -135,6 +135,7 @@ "latest_3": 49, "sdist": 27, "bdist_wheel": 63, + "multi": 33, # keep_latest=1, package_types="bdist_wheel", prereleases=False } DJANGO_LATEST_3 = 4 # latest version has 2 dists, each other has 1