Repository navigation
Port errata_pkgs_matcher script to new errata models - #1269
Merged
Merged
Conversation
The script still read and wrote the legacy errata_records, errata_packages and errata_to_albs_packages tables, which the current errata workflow no longer uses, so relinking an advisory to a build had no effect on what gets released. Switch to NewErrataRecord, NewErrataPackage and NewErrataToALBSPackage. Since new errata records are keyed by (id, platform_id), add a required --platform-id argument and only take artifacts from build tasks of that platform. Match packages the same way get_matching_albs_packages does: keep the .alma release suffix and use the approved status for AlmaLinux-issued advisories. Also fix the not-found counter, which counted every package, the match warning that never fired once old links existed, a crash on packages with an empty rpm_sourcerpm, and a broken log format string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The errata_pkgs_matcher script still read and wrote the legacy errata_records, errata_packages and errata_to_albs_packages tables. The current errata workflow (matching, resetting, release) only uses the new_errata_* tables, so relinking an advisory to a build with this script had no effect on what gets released.
The script now uses NewErrataRecord, NewErrataPackage and NewErrataToALBSPackage. New errata records are keyed by (id, platform_id), so there is a new required --platform-id argument, and only artifacts from build tasks of that platform are considered. Package matching follows get_matching_albs_packages: for AlmaLinux-issued advisories the .alma release suffix is kept and matches get the approved status, otherwise proposal.
Other fixes:
Usage:
Note that, as before, the script replaces all existing links of the advisory packages, including released ones, so it should not be used on already released advisories.