Skip to content

Commit

Permalink
Fix package_types filter breaking others
Browse files Browse the repository at this point in the history
fixes: #691
  • Loading branch information
gerrod3 committed Jun 26, 2024
1 parent fc5d0a4 commit 1760d24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/691.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the `package_types` filter breaking other remote filters.
2 changes: 1 addition & 1 deletion pulp_python/app/tasks/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions pulp_python/tests/functional/api/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions pulp_python/tests/functional/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1760d24

Please sign in to comment.