Skip to content

Add more Pulp Exceptions.#1186

Open
aKlimau wants to merge 1 commit intopulp:mainfrom
aKlimau:add-pulp-exceptions
Open

Add more Pulp Exceptions.#1186
aKlimau wants to merge 1 commit intopulp:mainfrom
aKlimau:add-pulp-exceptions

Conversation

@aKlimau
Copy link
Copy Markdown

@aKlimau aKlimau commented Apr 9, 2026

Assisted-by: Claude Sonnet 4.5 noreply@anthropic.com

📜 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

@aKlimau aKlimau marked this pull request as draft April 9, 2026 13:29
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch 8 times, most recently from 5ebcc3a to 88bc331 Compare April 10, 2026 12:23
@aKlimau aKlimau marked this pull request as ready for review April 10, 2026 12:38
Comment thread CHANGES/+add-pulp-exceptions.feature
Stage,
)

from pulp_python.app.exceptions import UnsupportedProtocolError
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this? I do not remember that is was reported by CI. It also looks like sth that should be in pulpcore.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we replace UnsupportedProtocolError by SyncError?

Comment thread pulp_python/app/serializers.py Outdated
Comment thread pulp_python/app/serializers.py Outdated
Comment thread pulp_python/app/exceptions.py Outdated
Comment thread pulp_python/app/exceptions.py Outdated
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch 5 times, most recently from 02b7c62 to d0d8812 Compare April 16, 2026 12:10
@aKlimau aKlimau requested a review from jobselko April 16, 2026 13:57
Comment thread pulp_python/app/exceptions.py
Comment thread pulp_python/app/serializers.py
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch from d0d8812 to 005810f Compare April 22, 2026 14:03
@github-actions github-actions Bot added the multi-commit Add to bypass single commit lint check label Apr 22, 2026
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch 3 times, most recently from 510c96a to 10fe205 Compare April 22, 2026 14:39
@github-actions github-actions Bot removed the multi-commit Add to bypass single commit lint check label Apr 22, 2026
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch from 10fe205 to c6d6bf7 Compare April 23, 2026 10:20
raise serializers.ValidationError(_("Invalid attestations: {}".format(e)))
return attestations

def handle_attestations(self, filename, sha256, attestations, offline=True):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is called by PythonPackageContentUploadSerializer.validate, where it should raise a serializers.ValidationError

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's still catching the same error as before the changes, I just renamed it from ValidationError to PydanticValidationError:
from pydantic import TypeAdapter, ValidationError as PydanticValidationError
Or am I getting smt wrong?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

handle_attestations now raises AttestationVerificationError instead of serializers.ValidationError

Comment thread pulp_python/app/models.py Outdated
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch 2 times, most recently from 6ff02e1 to d3c83d3 Compare April 27, 2026 10:50
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch from d3c83d3 to 6698572 Compare April 27, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants