Project

Profile

Help

Issue #4990

Core's serializer should only validate when policy='immediate' (the default)

Added by kersom 10 months ago. Updated 4 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 55

Description

Problem

For a plugin to support on-demand it needs to take extra steps. Core should not allow a user by default to expect to use policy != 'immediate' if a plugin hasn't done the work to enable it. Currently values of policy == 'on_demand' or policy == 'streamed' are also allowed.

Solution

1. Have core's Remote serializer (the Master one) fail validation if policy != 'immediate'.
2. Add docs on how plugins can adjust this validation in their Remote detail serializer to enable either policy='streamed' and/or policy='on_deamand'

Details

We need to advertise to users that they can expect this here: https://docs.pulpproject.org/en/3.0/nightly/workflows/lazy-downloading.html

We need to document to plugin writers what they should do here: https://docs.pulpproject.org/en/pulpcore-plugin/nightly/reference/lazy-support.html#lazy-support

Associated revisions

Revision cef9df92 View on GitHub
Added by bmbouter 9 months ago

Core's Remote only validates 'immediate'

The core's default mode policy='immediate' is the only one that is guaranteed by all plugins to implement. Users of plugins that haven't enabled additional modes should receive an error when then create a Remote.

Now users using policy != 'immediate' will receive an error.

https://pulp.plan.io/issues/4990 closes #4990

Revision ab7e1958 View on GitHub
Added by bmbouter 9 months ago

Allow policy options 'streamed' and 'on_demand'

Pulpcore recently made the RemoteSerializer validate the policy option to only allow 'immediate'. This requires plugins that support on-demand content to specifically allow more permissive validation.

https://pulp.plan.io/issues/4990 closes #4990

Revision b9ffe957 View on GitHub
Added by bmbouter 9 months ago

Add detail Remote 'policy' redefinition docs

To use on-demand content with more 'policy' values the Remote Serializer needs to redefine the 'policy' attribute. This is now included in the docstring so plugin writers can decide.

https://pulp.plan.io/issues/4990 closes #4990

History

#1 Updated by kersom 10 months ago

  • Description updated (diff)

#2 Updated by bmbouter 10 months ago

This is reported against pulp_ansible, but I believe the place to fix this is in core. The core serializer should require the plugin-provided serializer to adjust the allowed values for the 'policy' attribute at Remote creation time. If the plugin doesn't adjust the 'policy' attribute only 'immediate' would be allowed. I believe this will fix this for all plugins.

@daviddavis what do you think?

#3 Updated by daviddavis 10 months ago

+1 from me.

#4 Updated by bmbouter 10 months ago

  • Project changed from Ansible Plugin to Pulp
  • Subject changed from Collection - Sync does not fail when using lazy policies to Core's serializer should only validate when policy='immediate' (the default)
  • Description updated (diff)

Moving to core and rewriting based on open-floor discussion from June 21st.

#5 Updated by daviddavis 10 months ago

  • Groomed changed from No to Yes
  • Sprint set to Sprint 55

#6 Updated by amacdona@redhat.com 9 months ago

  • Triaged changed from No to Yes

#7 Updated by bmbouter 9 months ago

  • Status changed from NEW to POST
  • Assignee set to bmbouter

#8 Updated by bmbouter 9 months ago

  • Status changed from POST to MODIFIED

#11 Updated by bmbouter 9 months ago

Applied in changeset commit:pulpcore-plugin|0ee9d68d1d62d35b2b6023262d63e656c2fe2fbc.

#12 Updated by bmbouter 4 months ago

  • Sprint/Milestone set to 3.0.0

#13 Updated by bmbouter 4 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF