Project

Profile

Help

Story #5708

closed

Allow operation specific plugin-input for validation and/or content modification

Added by bmbouter over 4 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Motivation

Plugins have a need to provide RepositoryVersion validation and/or modification for specific operations but not others. For example, for the pulp_rpm sync case, it's not important to check modulemd consistency, while for "modify" it's critical.

The RepositoryVersion.finalize_new_version runs with all operations so it's not viable to put operation-specific code there.

Design

Add a class attribute named PLUGIN_VALIDATE_MODIFY to the following core-provided objects and have it default to None. Then a plugin writer would subclass the object and specify the callable on their subclass.

  • DeclarativeVersion
  • SingleContentArtifactUploadSerializer
  • ModifyRepositoryActionMixin

The PLUGIN_VALIDATE_MODIFY callable must accept a single argument, new_version so it has the reference to the RepositoryVersion it should validate/modify.

Note these new operation-specific validation should be called before the Repository.finalize_new_version

Also available in: Atom PDF