Skip to content

Commit

Permalink
Merge pull request #692 from gerrod3/package-type-filter-fix
Browse files Browse the repository at this point in the history
Fix package_types filter breaking others

(cherry picked from commit a37d040)
  • Loading branch information
gerrod3 authored and patchback[bot] committed Jun 27, 2024
1 parent 099089b commit b72ceaa
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 @@ -641,6 +641,23 @@ def test_no_platform_sync(self):
)


@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_repo,
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 @@ -155,6 +155,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 b72ceaa

Please sign in to comment.