Skip to content

[PULP-1496] Add repository-specific package blocklist#1187

Open
jobselko wants to merge 1 commit intopulp:mainfrom
jobselko:1166
Open

[PULP-1496] Add repository-specific package blocklist#1187
jobselko wants to merge 1 commit intopulp:mainfrom
jobselko:1166

Conversation

@jobselko
Copy link
Copy Markdown
Member

@jobselko jobselko commented Apr 9, 2026

closes #1166

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@jobselko jobselko self-assigned this Apr 9, 2026
@jobselko jobselko force-pushed the 1166 branch 2 times, most recently from 96b75dd to 5d9caeb Compare April 13, 2026 18:26
Comment thread docs/user/guides/upload.md Outdated
Comment thread pulp_python/app/models.py
@jobselko jobselko marked this pull request as ready for review April 13, 2026 19:49
Comment thread pulp_python/app/models.py Outdated
Comment thread pulp_python/app/models.py Outdated
Comment thread pulp_python/app/models.py Outdated
Comment thread pulp_python/app/serializers.py Outdated
Comment thread pulp_python/app/viewsets.py Outdated
Comment thread pulp_python/app/viewsets.py Outdated
closes pulp#1166
Assisted By: Claude Opus 4.6
Copy link
Copy Markdown
Contributor

@gerrod3 gerrod3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, few more things before approval.

Comment thread pulp_python/app/models.py
if entry.filename and entry.filename == pkg.filename:
blocked.append(pkg.filename)
break
if entry.name and canonicalize_name(entry.name) == pkg.name_normalized:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if entry.name and canonicalize_name(entry.name) == pkg.name_normalized:
if entry.name == pkg.name_normalized:

The entry's name is normalized in the serializer.

"""
if not content_ids:
return
packages = python_models.PythonPackageContent.objects.filter(pk__in=content_ids)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
packages = python_models.PythonPackageContent.objects.filter(pk__in=content_ids)
packages = python_models.PythonPackageContent.objects.filter(pk__in=content_ids).only("filename", "name_normalized", "version")

Comment on lines +89 to +90
def test_upload_blocked(delete_orphans_pre, monitor_task, python_bindings, python_repo):
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see problems running these tests in parallel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: package blocklist to prevent upload of yanked or malicious packages

2 participants