Skip to content

Conversation

@rockythorn
Copy link
Collaborator

Red Hat includes the minor version for Rocky 10 advisories meaning we need to include the minor version in our repo config tables for Rocky 10. Red Hat 8 and 9 don't seem to include the minor version so our config should also NOT contain minor versions. This allows for generation to correctly NOT include minor versions.

This branch fixes a bug in the generate_rocky_config.py script related
to version filtering when generating Rocky Linux repository
configurations.

The Specific Change, The script now supports flexible version matching
when filtering repositories:
- Major-only filtering (e.g., --version 9): Matches any minor version
  within that major version (9.0, 9.1, 9.2, 9.6, etc.)
- Full version filtering (e.g., --version 9.6): Requires exact match to
  the specified major.minor version Why This Change Is Needed

The Problem, Red Hat's advisory format varies across RHEL versions:
- RHEL 8 & 9: Red Hat advisories typically don't include minor versions
  (they just reference "RHEL 8" or "RHEL 9")
- RHEL 10+: Red Hat now includes minor versions in advisories (e.g.,
  "RHEL 10.2", "RHEL 10.3")

This creates a version matching issue in Apollo's mirror configuration
system:

1. The supported_products_rh_mirrors table defines which Red Hat
   advisories to match against Rocky Linux versions
2. The table has match_major_version and match_minor_version columns to
   control matching For
3. RHEL 8/9, match_minor_version should be NULL (matches any minor
   version)
4. For RHEL 10+, match_minor_version should be set (matches specific
   minor versions)

Without this fix:
- If you run generate_rocky_config.py --version 9 against a Rocky 9.6
  mirror, it would fail to include repos because it expected an exact
  version match
- This makes it impossible to generate configs that match the "major
  version only" pattern needed for RHEL 8/9 mirroring

With thisfix:
- Using --version 9 correctly generates configs with NULL
  match_minor_version (matches RHEL 9.x advisories)
- Using --version 9.6 generates configs with match_minor_version = 6
  (for RHEL 10+ style matching)

How It Fits Into Apollo; Apollo's Advisory Mirroring Workflow:
1. Ingestion: The rhworker polls Red Hat for new advisories (RHSA, RHBA,
   RHEA)
2. Matching: Apollo uses supported_products_rh_mirrors to determine
   which Rocky Linux products each Red Hat advisory applies to and
   matches by variant (RHEL), major version, minor version (if specified),
   and architecture
3. Package Mapping: The rpmworker finds equivalent packages in Rocky
   repos and generates Rocky advisories
4. Config Generation: The generate_rocky_config.py script
   creates/updates the supported_products_rpm_repomds and
   supported_products_rh_mirrors tables
@rockythorn rockythorn force-pushed the fix/generate-rocky-config-minor-version branch from ead860f to 671e464 Compare November 10, 2025 22:48
@rockythorn
Copy link
Collaborator Author

This is included with #69

@rockythorn rockythorn closed this Nov 17, 2025
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