Skip to content

Conversation

pmoravec
Copy link
Member

@pmoravec pmoravec commented Oct 4, 2024

What are the changes introduced in this pull request?

Set properly (non)optimised pulp repo sync for Optimised/Full Capsule Sync. Currently, optimised pulp repo sync is always triggered, even for Full Capsule Sync.

Considerations taken when implementing this change?

Keep in mind, skip_metadata_check = ! optimise.

What are the testing steps for this pull request?

See reproducer in #37879 .

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the full-caps-sync-fires-optimised-pulp-sync branch from a7f7936 to 4811d0f Compare October 4, 2024 12:45
@sjha4
Copy link
Member

sjha4 commented Oct 18, 2024

Able to reproduce the issue, this was what katello sent pulp with complete sync:

14:13:18 rails.1   | 2024-10-18T14:13:18 [D|kat|72c80f12] Calling API: RepositoriesRpmApi.sync ...
14:13:18 rails.1   | 2024-10-18T14:13:18 [D|kat|72c80f12] HTTP request body param ~BEGIN~
14:13:18 rails.1   |  72c80f12 | {"remote":"/pulp/api/v3/remotes/rpm/rpm/01929fe5-a96c-7a47-a499-db474414acf3/",
"sync_policy":"mirror_complete",
"optimize":true}
14:13:18 rails.1   |  72c80f12 | ~END~

Note: "optimize":true

@sjha4
Copy link
Member

sjha4 commented Oct 18, 2024

On this branch, katello correctly sends optimize:false to pulp.

14:23:32 rails.1   | 2024-10-18T14:23:32 [D|kat|756893c0] HTTP request body param ~BEGIN~
14:23:32 rails.1   |  756893c0 | {"remote":"/pulp/api/v3/remotes/rpm/rpm/01929fe5-3f01-7f0e-93c3-75176f040d6d/",
"sync_policy":"mirror_complete",
"optimize":false}
14:23:32 rails.1   |  756893c0 | ~END~
14:23:32 rails.1   |  756893c0 | 

@sjha4
Copy link
Member

sjha4 commented Oct 18, 2024

Although, Isee ansible sync API getting called with optimized: true..Looking into the difference there..

What I see is a missing override in ansible service in katello.
We want to add :

def sync_url_params(sync_options)
       params = super
       params[:optimize] = sync_options[:optimize] if sync_options.key?(:optimize)
       params
 end

to katello/app/services/katello/pulp3/repository/ansible_collection.rb so that the optimize flag is correctly set for those.

@sjha4 sjha4 self-assigned this Oct 25, 2024
Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

Opened a separate issue for changes needed for collections. This one is good to go..Ack and merging 👍🏼
Thanks @pmoravec for catching and fixing this.

@sjha4 sjha4 merged commit 27741e8 into Katello:master Oct 30, 2024
27 checks passed
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.

2 participants