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
@@ -0,0 +1 @@
Add more Pulp Exceptions.
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.

This is not a bug, but rather a feature.

Stage,
)

from pulp_python.app.exceptions import UnsupportedProtocolError
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.

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.

Comment thread pulp_python/app/serializers.py Outdated
filename = data["relative_path"]
except KeyError:
raise serializers.ValidationError(detail={"relative_path": _("This field is required")})
raise ValidationError(_("This field is required: relative_path"))
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.

Why do we need this? (not reported by CI)

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.

We need this to give more information to user/services team. As this exception can't contain any sensitive information we would rather display it to user for easier debugging (serializers.ValidationError will be sanitized)

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.

Discussed on the call that we might want to turn more exceptions into PulpException-based exceptions to avoid later sanitization in core 3.115.

Comment thread pulp_python/app/serializers.py Outdated
Comment on lines +61 to +68
return (
f"[{self.error_code}] "
+ _(
"Found duplicate packages being added with the same filename but different checksums. " # noqa: E501
)
+ _("To allow this, set 'allow_package_substitution' to True on the repository. ")
+ _("Conflicting packages: {duplicates}").format(duplicates=self.duplicates)
)
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.

    return f"[{self.error_code}] " + _(
        "Found duplicate packages being added with the same filename but different "
        "checksums. To allow this, set 'allow_package_substitution' to True on the "
        "repository. Conflicting packages: {duplicates}"
    ).format(duplicates=self.duplicates)

Raised when provenance verification fails.
"""

error_code = "PLPY0001"
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.

Do we already have a naming convention for plugins? Pulpcore uses "PLP", this introduces "PLPY"

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.

We don't have a strict convention for plugins, but some plugins have already created exceptions with codes, so until we have a reason to make it all stricter we will go with it.

@aKlimau aKlimau force-pushed the add-pulp-exceptions branch 3 times, most recently from aaaf34f to 655383c Compare April 14, 2026 15:55
  Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@aKlimau aKlimau force-pushed the add-pulp-exceptions branch from 655383c to 02b7c62 Compare April 14, 2026 15:59
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