Skip to content

Commit 2777e0f

Browse files
gerrod3jobselko
authored andcommitted
Merge pull request #692 from gerrod3/package-type-filter-fix
Fix package_types filter breaking others (cherry picked from commit a37d040)
1 parent 3af33a5 commit 2777e0f

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

CHANGES/691.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the `package_types` filter breaking other remote filters.

pulp_python/app/tasks/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def create_bandersnatch_config(remote):
8080
config["plugins"]["enabled"] += "prerelease_release\n"
8181
if remote.package_types:
8282
rrfm = "regex_release_file_metadata"
83-
config["plugins"]["enabled"] += rrfm
83+
config["plugins"]["enabled"] += f"{rrfm}\n"
8484
if not config.has_section(rrfm):
8585
config.add_section(rrfm)
8686
config[rrfm]["any:release_file.packagetype"] = "\n".join(remote.package_types)

pulp_python/tests/functional/api/test_sync.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,23 @@ def test_no_platform_sync(self):
641641
)
642642

643643

644+
@pytest.mark.parallel
645+
def test_sync_multiple_filters(
646+
python_repo_with_sync, python_remote_factory, python_content_summary
647+
):
648+
"""Tests sync with multiple filters."""
649+
remote = python_remote_factory(
650+
includes=PYTHON_LG_PROJECT_SPECIFIER,
651+
package_types=["bdist_wheel"],
652+
keep_latest_packages=1,
653+
prereleases=False
654+
)
655+
repo = python_repo_with_sync(remote)
656+
657+
summary = python_content_summary(repository_version=repo.latest_version_href)
658+
assert summary.present["python.python"]["count"] == PYTHON_LG_FIXTURE_COUNTS["multi"]
659+
660+
644661
@pytest.mark.parallel
645662
def test_proxy_sync(
646663
python_repo,

pulp_python/tests/functional/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
"latest_3": 37,
156156
"sdist": 24,
157157
"bdist_wheel": 54,
158+
"multi": 33, # keep_latest=1, package_types="bdist_wheel", prereleases=False
158159
}
159160

160161
DJANGO_LATEST_3 = 4 # latest version has 2 dists, each other has 1

0 commit comments

Comments
 (0)