Skip to content

Port errata_pkgs_matcher script to new errata models - #1269

Merged
anfimovdm merged 1 commit into
masterfrom
fix-errata-pkgs-matcher-new-models
Oct 23, 2026
Merged

anfimovdm merged 1 commit into
masterfrom
fix-errata-pkgs-matcher-new-models

Conversation

@anfimovdm

Copy link
Copy Markdown
Contributor

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:

  • the not-found counter counted every package instead of only unmatched ones
  • the "Cannot find match" warning never fired when the package had previous links, because deleted links stayed in the relationship collection; old links are now removed with a single bulk delete
  • packages with an empty rpm_sourcerpm no longer crash the script
  • broken log format string in the start message
  • --advisory-id and --build-id are now required

Usage:

python scripts/errata_pkgs_matcher.py --advisory-id ALSA-2025:1234 --platform-id 3 --build-id 12345 [--ignore-release-part]

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.

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.
@anfimovdm
anfimovdm merged commit fb61abf into master Oct 23, 2026
3 of 4 checks passed
@anfimovdm
anfimovdm deleted the fix-errata-pkgs-matcher-new-models branch October 23, 2026 17:33
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.

1 participant