Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #692/a37d040b backport][3.12] Fix package_types filter breaking others #694

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading