Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #31257 - support incremental update for debs #10847

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-bucher
Copy link
Contributor

@m-bucher m-bucher commented Jan 12, 2024

What are the changes introduced in this pull request?

Support copying of deb-packages in incremental Update of ContentViews .

Considerations taken when implementing this change?

Adding deb-packages does not support dependency-solving. Trying to do that will fail the incremental update.
#10734 ensures the dependency-solving option is ignored for deb-packages/-repositories.

What are the testing steps for this pull request?

No UI support; use the Content_view_versions / incremental_update REST-API endpoint for testing:

POST /katello/api/content_view_versions/incremental_update
...
{
  "add_content": {
    "deb_ids": [ <pkg_ids> ]
  }
}

@martux69
Copy link

martux69 commented Jul 19, 2024

For test reason I implement the changes manually on my test system and a first test was successfull, though the hammer cli output was the same as before:

[root@foreman ~]# hammer content-view version incremental-update --content-view-version-id 12 --lifecycle-environment-ids 2 --deb-ids 1685
[..........................................................................................................................................................................................................] [100%]
Content View: CV Debian 12 version 1.8
Added Content:
[root@foreman ~]#

But in the GUI the added package is seen now. It would be nice when the CLI output could be corrected.

I would appreciate a quick merge into the next possible release branch :-D

@ianballou
Copy link
Member

Mind doing a rebase to get it back up to speed with the main branch?

@m-bucher
Copy link
Contributor Author

@ianballou rebase is done
@martux69 I also managed to fix the output issue 😁

While testing, I saw that hammer does support specifiying the deb-package names with --debs.
But there is a problem where hammer tries to find the IDs for these packages by doing an API-GET with parameter name, which is not supported by itself. It has to be within the search-parameter.
It works for RPMs. No clue why not for Deb.
Is this an issue in hammer-cli-katello or with the /debs API endpoint implementation?

NOK (hammer): /katello/api/debs?name=dbus
OK: /katello/api/debs?search=name%3Ddbus

@martux69
Copy link

@ianballou
I would kindly ask for the reason of delay?

@ianballou
Copy link
Member

@martux69 folks have been busy fixing bugs and prepping for the latest Foreman and Katello release. Plus once we got close to the 4.14 branching, we didn't want to introduce anything that would risk stability. Broken nightlies means skipped testing, which is no fun.

Now that we're branched though, we should be able to get it in soon. The changes aren't too complicated.

@ianballou
Copy link
Member

One corner case that comes to mind that needs testing is incrementally updating a content view version with both Debs and RPMs.

@martux69
Copy link

Thanks for the information

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

I've discovered a bug. I haven't determined why, but the changes here are causing content view publishing to fail. Specifically, it's triggering the following error:

The repository's publication is missing. Please run a 'complete sync' on Zoo. 

The change that likely caused this is how debs are now being added to the repo mapping for multi-copy workflows.

Here's the reproducer setup:

  • Sync https://jlsherrill.fedorapeople.org/fake-repos/needed-errata/
  • Sync https://fixtures.pulpproject.org/debian and use the ragnarok Release/Distribution
  • Create a content view with both repositories that has dependency solving enabled.
    • This is crucial to reproducing the issue -- without dependency solving enabled, the CV publish succeeds.
  • Create an RPM filter that only includes walrus - noarch - less that version 5
  • Create a deb filter that only includes one of the packages (like frigg)
  • Publish the content view

Hopefully the steps above reproduce it in your environment. There may be a simpler reproducer out there, but it's hard to say until we know what's going wrong.

I confirmed that removing these changes and republishing creates a working content view version.

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

I found an issue when incrementally adding packages and debs together. The debs and packages requested do get added, but all of the remaining debs in my test repo got added even when trying to add only one of them.
To test it, I filtered out all of the debs but one in the test repo, and tried adding back only one of the other debs via hammer. The result was that 3 debs were added instead of one.

@ianballou
Copy link
Member

It appears that incrementally adding RPMs still works as expected.

Comment on lines -62 to +68
elsif separated_repo_map[:pulp3_yum_multicopy].keys.flatten.present?
plan_action(Repository::MultiCloneToVersion, separated_repo_map[:pulp3_yum_multicopy], version)
else
if separated_repo_map[:pulp3_deb_multicopy].keys.flatten.present?
plan_action(Repository::MultiCloneToVersion, separated_repo_map[:pulp3_deb_multicopy], version)
end
if separated_repo_map[:pulp3_yum_multicopy].keys.flatten.present?
plan_action(Repository::MultiCloneToVersion, separated_repo_map[:pulp3_yum_multicopy], version)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ianballou That was the problem. It only did MultiCloneToVersion on either deb or yum, when it has to run for both.
Should be fixed now.

Thanks for testing that was a nice catch 👍

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Publishing with dependency solving is working again, awesome.

I'm still seeing an issue with extra debs being pulled in during the incremental update. Instead of just the one deb I want, all of the missing debs get pulled in.

@m-bucher
Copy link
Contributor Author

@ianballou, sorry for the delay.

I'm still seeing an issue with extra debs being pulled in during the incremental update. Instead of just the one deb I want, all of the missing debs get pulled in.

I only had this behaviour when using hammer content-view version incremental-update with the --debs parameter. There seems to be an issue within hammer-cli, which does not correctly resolve the deb-packages (maybe it also has something to do with Katello's debs API-endpoint.
It works for me, if I specify the --deb-ids.

@m-bucher
Copy link
Contributor Author

I only had this behaviour when using hammer content-view version incremental-update with the --debs parameter.

... and I found the issue for that 😎 Katello/hammer-cli-katello#960

@maximiliankolb
Copy link
Contributor

docs: theforeman/foreman-documentation#3403

Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Working great! Do you mind if we wait to merge until we're out of stabilization week and Katello 4.15 is branched?

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.

4 participants