Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is intended to allow for faster incremental updates to the errata based on how recently they were issued.
For example, doing --recent=90 will only attempt to import errata which have a issued date in the XML of within 90 days of today.
The change requires perl-DateTime package be installed.
It also replaces the find_packages subroutine, the packages.get_details API call and building the name2id/name2channel hash tables.
The replacement to find_packages is find_packages_by_advisory which uses find_package_by_name. Then in find_package_by_name the API calls of packages.findByNvrea and packages.listProvidingChannels is used. These API calls are listed as supported in Spacewalk 1.4 API and still supported in Uyuni. They probably are supported by earlier versions but I can't find the API documents for version previous to 1.4.
During testing, I get the following results:
Full import - find_packages: 1 hour 55 miinutes
Full import - find_packages_by_advisory: 2 hours 9 minutes
90 day import - find_packages: 1 hour 18 minutes
90 day import - find_packages_by_advisory: 4 minutes
So, while during my own testing the change is 12% slower for a full import, it is much faster for incremental errata imports.
It should be noted that the issue date may not be the same exact day that an errata is publised in the XML file. I figured daily imports with a 90 day period should be long enough to catch previously issued but recently published errata. The change gives the user the flexability to choose their own time period with the --recent flag.
Hopefully others find this change useful or can provide feedback if I'm doing something incorrectly.