Skip to content

Conversation

@rockythorn
Copy link
Collaborator

Apollo Improvements: Bug Fixes, New Features, and API Enhancements

Overview

This consolidated PR includes six related improvements to Apollo's errata management system, developed and thoroughly reviewed by CIQ across multiple PRs in a staging repository:

  1. Config generation flexibility (#15) - Enhanced version matching and naming for mirror configurations
  2. Modular package extraction (#16) - Fixed critical CSAF parsing bugs and added EUS filtering
  3. OSV API improvements (#17) - Return all CVE-containing advisories regardless of type
  4. Config import/export fixes (#18) - Fixed validation issues preventing environment sync
  5. Mirror management (#19) - Added active/inactive toggle for mirrors
  6. Updateinfo v2 endpoint (#20) - New API with FK-based filtering and module package fix

Impact: Fixes 230+ missing module advisories, adds major version aggregation, improves operational workflows, and enhances API completeness.

Review Process: Each PR was individually reviewed and approved by CIQ team members, with comprehensive testing and validation at each stage before being merged to the staging repository.


1. Config Generation Flexibility (#15)

Problem

  • generate_rocky_config.py required exact version matches, preventing generation of configs for RHEL 8/9 (which don't use minor versions in advisories)
  • No way to customize mirror names for legacy products or special configurations

Solution

Flexible version matching:

  • --version 9 matches all 9.x releases (generates NULL match_minor_version)
  • --version 10.2 matches only 10.2 (generates match_minor_version: 2)

Custom naming:

  • --mirror-name-base "Rocky Linux 9" produces "Rocky Linux 9 x86_64" instead of "Rocky Linux 9.6 x86_64"
  • Enables legacy product entries like "Rocky Linux 8.5 (Legacy)"

Files Changed

  • scripts/generate_rocky_config.py

Full details in PR #15 →


2. Modular Package Extraction and EUS Filtering (#16)

Problems

  1. Modular packages missing: 12+ security advisories with modular packages (Redis, Node.js, etc.) had zero packages extracted
  2. EUS overhead: ~50% of processed advisories were EUS/E4S/AUS/TUS-only and irrelevant to Rocky Linux
  3. CSV timestamp order: Missing advisory updates because releases.csv was overwriting changes.csv

Solutions

  1. New parser: Added _extract_packages_from_product_tree() to handle modular CSAF format with ::module:stream suffixes
  2. EUS filtering: Added _is_eus_product() to detect and skip EUS products via CPE patterns and product names
  3. CSV merge fix: Changed merge order to prioritize changes.csv over releases.csv
  4. Admin UI: Added /admin/workflows interface for viewing/updating CSAF last_indexed_at timestamp

Impact:

  • RHSA-2025:12008 (redis:7): 0 packages → 18 packages extracted
  • 50% reduction in processed advisories
  • Advisory updates now trigger reprocessing

Files Changed

  • apollo/rhcsaf/__init__.py - Parser refactor with modular/EUS handling
  • apollo/rhworker/poll_rh_activities.py - CSV merge order fix
  • apollo/server/routes/admin_workflows.py - New timestamp management UI
  • apollo/server/services/database_service.py - Database methods
  • apollo/server/templates/admin_workflows.jinja - UI template
  • apollo/tests/test_csaf_processing.py - Fixed for Bazel
  • apollo/tests/test_rhcsaf.py - 240 new lines (EUS/modular tests)
  • apollo/tests/test_database_service.py - 226 new lines

Full details in PR #16 →


3. OSV API Improvements (#17)

Problem

OSV API filtered by kind="Security", missing bug fix and enhancement advisories that contain CVEs.

Solution

  • Remove kind filter from queries
  • Filter by CVE presence instead: len(advisory.cves) > 0
  • Return 404 for advisories without CVEs (OSV is CVE-focused)

Result: All CVE-containing advisories now discoverable via OSV API, regardless of classification (RLSA, RLBA, RLEA).

Files Changed

  • apollo/server/routes/api_osv.py - Filter by CVE not kind
  • apollo/tests/test_api_osv.py - 248 new lines

Full details in PR #17 →


4. Config Import/Export Fixes (#18)

Problems

  1. Float conversion: Export serialized version numbers as floats (9.0), import rejected them (expects int)
  2. Parentheses rejected: Validation regex didn't allow parentheses in names like "Rocky Linux 8.5 (Legacy)"

Solutions

  1. Integer serialization: Updated _json_serializer() to convert whole-number Decimals to int
  2. Name validation: Updated NAME_PATTERN to include parentheses: r"^[a-zA-Z0-9._\s()\-]+$"

Result: Configs can be exported from production and imported to staging/dev without manual editing.

Files Changed

  • apollo/server/routes/admin_supported_products.py - Serializer fix
  • apollo/server/validation.py - Allow parentheses
  • apollo/tests/test_admin_routes_supported_products.py - Test updates

Full details in PR #18 →


5. Mirror Active Field (#19)

Problem

No way to disable mirrors without deleting them (loses historical data and advisory relationships).

Solution

Added active boolean field to supported_products_rh_mirrors:

  • Database migration with default TRUE (backward compatible)
  • UI toggles in list/edit/create views with status indicators
  • Workflow integration (RHMatcherWorkflow skips inactive mirrors)
  • Export/import support

Use cases:

  • Stage new mirrors before activation
  • Temporarily disable problematic mirrors
  • Deprecate old version mirrors while preserving history
  • Test configurations without affecting production

Files Changed

  • apollo/migrations/20251104111759_add_mirror_active_field.sql - Migration
  • apollo/schema.sql - Schema update
  • apollo/db/__init__.py - ORM model
  • apollo/rpmworker/rh_matcher_activities.py - Workflow filter
  • apollo/server/routes/admin_supported_products.py - UI handlers
  • apollo/server/services/workflow_service.py - Workflow list
  • apollo/server/templates/admin_supported_product*.jinja - UI components (3 files)
  • apollo/tests/test_admin_routes_supported_products.py - 217 new lines

Full details in PR #19 →


6. Updateinfo V2 Endpoint and Module Package Fix (#20)

Problems

  1. Module package source RPM mapping bug: ~8,908 packages with "module." prefix in package_name field caused NEVRA mismatch

    • Database: "module.postgresql" vs NEVRA: "postgresql" → no match
    • Impact: 230+ module advisories missing from Rocky 8 AppStream updateinfo.xml
  2. V1 endpoint limitations:

    • Denormalized filtering (string-based product_name)
    • No major version aggregation (separate XML per minor version)
    • URL encoding required for product names with spaces

Solutions

ORM-Level Module Prefix Fix (Trinity Quirk)

Added Python property pattern to AdvisoryPackage model to transparently strip "module." prefix:

class AdvisoryPackage(Model):
    _package_name = fields.TextField(source_field='package_name')

    @property
    def package_name(self):
        return self._clean_package_name(self._package_name)
  • No database migration required
  • Works for existing data (reads) and new data (writes)
  • Transparent to all business logic

V2 Updateinfo API Endpoint

New endpoint: /api/v3/updateinfo/{product_slug}/{major_version}/{repo}/updateinfo.xml?arch={arch}

Example: /api/v3/updateinfo/rocky-linux/8/BaseOS/updateinfo.xml?arch=x86_64

Key improvements:

  • FK-based filtering using supported_product_id
  • Major version aggregation (8 → all 8.x minor versions)
  • Required architecture parameter (validated against centralized Architecture enum)
  • Product slug mapping (rocky-linux → Rocky Linux)
  • Data integrity validation via FK relationships

Simplified Business Logic

Removed manual .removeprefix("module.") calls since ORM handles it automatically.

Architecture Validation

Replaced hardcoded architecture list with centralized Architecture enum from validation module.

API Comparison

Feature V1 V2
URL /Rocky%20Linux%208%20x86_64/BaseOS/updateinfo.xml /rocky-linux/8/BaseOS/updateinfo.xml?arch=x86_64
Filtering String-based product_name FK-based supported_product_id
Version aggregation None (one-to-one) Major version aggregation
Architecture Optional query param Required query param
URL encoding Required (spaces) Not needed (slugs)

Testing

  • 14 new unit tests for helper functions
  • Integration testing shows 230 module advisories now appear
  • V1 endpoint produces identical output (backward compatible)
  • Fixed source RPM version matching bug (el8_7 binary → el8_7 source, not el8_6)

Files Changed

  • apollo/db/__init__.py - ORM property pattern for module prefix
  • apollo/server/routes/api_updateinfo.py - V2 endpoint, helpers, architecture validation
  • apollo/tests/test_api_updateinfo.py - 182 new lines
  • apollo/tests/BUILD.bazel - Add test target
  • .github/workflows/test.yaml - Add test to CI

Full details in PR #20 →


Combined Statistics

Test Coverage

  • New test files: 3 (test_api_osv.py, test_api_updateinfo.py, test_database_service.py)
  • New test lines: 900+ across all changes
  • Updated test files: 2 (test_csaf_processing.py, test_admin_routes_supported_products.py)

Code Changes

  • Files modified: 25
  • Files added: 8 (migrations, templates, tests)
  • Lines added: ~2,000+
  • Lines modified/removed: ~200

Database Changes

  • Migrations: 1 (add_mirror_active_field)
  • Schema updates: supported_products_rh_mirrors table (added active boolean)
  • ORM changes: Module prefix handling, active field

Impact Summary

  1. 230+ module advisories now included in updateinfo.xml
  2. 50% reduction in advisory processing (EUS filtering)
  3. Major version aggregation for v2 endpoint (single updateinfo for all 8.x, 9.X, 10.X)
  4. Complete OSV API (all CVE-containing advisories)
  5. Zero-downtime mirror management (active/inactive toggle)
  6. Environment sync (export/import fixes)
  7. Operational flexibility (config generation improvements)

Deployment Notes

Backward Compatibility

  • ✅ All changes backward compatible
  • ✅ V1 updateinfo endpoint unchanged
  • ✅ Database migration adds field with default TRUE
  • ✅ Existing configs import without modification

Database Migration Required

Migration file: apollo/migrations/20251104111759_add_mirror_active_field.sql

Optional Post-Deployment Actions

  1. Update CSAF timestamp to reprocess recent modular advisories
  2. Regenerate RHEL 8/9 configs with major-only version filtering
  3. Review and deactivate any obsolete mirrors instead of deleting
  4. Clean up EUS advisories from database (optional space savings)

Breaking Changes

  • OSV API now returns 404 for advisories without CVEs (previously returned advisory anyway)

Testing Recommendations

  1. Modular advisories: Verify RHSA-2025:12008 and similar now have packages
  2. V2 endpoint: Test /api/v3/updateinfo/rocky-linux/8/BaseOS/updateinfo.xml?arch=x86_64
  3. OSV API: Query for bug fix advisories with CVEs
  4. Config sync: Export from one environment, import to another
  5. Mirror toggle: Disable a mirror, verify workflow skips it
  6. Version matching: Generate configs with --version 9 (major only)

Contributors

  • Trinity Quirk - ORM module prefix fix
  • Sam Thornton - All other changes

This commit enhances the generate_rocky_config.py script with two key improvements:

1. Flexible version matching for RHEL 8/9/10+ compatibility:
   - 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

   This addresses differences in Red Hat's advisory format across RHEL versions:
   - RHEL 8 & 9: Advisories typically don't include minor versions
   - RHEL 10+: Advisories now include minor versions (e.g., "RHEL 10.2")

   The flexible matching ensures that repository configurations can be generated
   with appropriate version matching rules (NULL match_minor_version for RHEL 8/9,
   specific match_minor_version for RHEL 10+).

2. Custom mirror naming with --mirror-name-base option:
   - Allows specifying a custom base name for generated mirror configurations
   - Example: --mirror-name-base "Rocky Linux 9" generates "Rocky Linux 9 x86_64"
     instead of "Rocky Linux 9.6 x86_64"
   - Useful for creating legacy product entries or custom naming schemes
   - Works in combination with --name-suffix for additional flexibility

These changes improve Apollo's ability to generate configurations that align
with Red Hat's advisory matching requirements across different major versions.
- Remove redundant None and empty string checks in mirror name building
- Consolidate version filtering logic into single condition block
- Eliminate unnecessary ternary operator in version parsing
Any advisory that addresses at least one CVE should be considered a
Security Advisory and should returned by the OSV api. Instead of
filtering strictly on the advisory "kind" (eg- Security, Bug Fix,
Enhancement) we should instead filter based on if there are associated
CVEs for the given advisory.
Remove self-explanatory comments that restate what the code does:
- Removed obvious filter condition comments
- Removed type conversion comment
- Removed severity calculation comment
This commit refactors the Red Hat CSAF parser to fix two major issues:

1. Modular Package Extraction Bug
   - Old code failed to extract modular packages due to ::module:stream suffix
   - New code extracts NEVRA directly from product_tree product_id field
   - Strips ::module:stream suffix while preserving full NEVRA with epoch
   - Fixes 12+ affected advisories (e.g., RHSA-2025:12008 for redis:7)

2. EUS Advisory Filtering
   - Detects EUS/E4S/AUS/TUS products via CPE and product name
   - Filters out EUS-only advisories during ingestion
   - Reduces processed advisories by ~50%
   - Skips advisories where all products are EUS-related

Changes:
- apollo/rhcsaf/__init__.py:
  - Added _is_eus_product() helper for EUS detection
  - Added _extract_packages_from_product_tree() for product_tree parsing
  - Updated extract_rhel_affected_products_for_db() to filter EUS products
  - Updated red_hat_advisory_scraper() to use new extraction and skip EUS-only

- apollo/tests/test_rhcsaf.py:
  - Updated test data to include product_version entries
  - Added TestEUSDetection class (3 tests)
  - Added TestModularPackages class (1 test)
  - Added TestEUSAdvisoryFiltering class (1 test)

Validation:
- Standalone testing in temp/modular_package_fix/ confirmed:
  - 18 modular packages extracted (was 0)
  - Regular packages work identically (no regression)
  - EUS advisories correctly filtered
  - All data fields preserved (CVEs, Bugzillas, metadata)
The previous code incorrectly let releases.csv overwrite changes.csv timestamps.
This caused the workflow to miss advisory updates, as changes.csv contains the
most recent modification times while releases.csv contains original publication
dates.

With this fix, when Red Hat updates advisories (like the mass update on
2025-11-07), the workflow will correctly detect and reprocess them.

Changes:
- Reversed merge order: {**releases, **changes} so changes.csv takes precedence
- Updated comment to clarify the intended behavior
- Ensures updated advisories are reprocessed to catch corrections/additions
Add admin interface to view and update the last_indexed_at timestamp
that controls which CSAF advisories are processed by the Poll RHCSAF
workflow.

Changes:
- Add DatabaseService methods for getting and updating last_indexed_at
- Add admin route handlers for timestamp management
- Add UI section with date picker and automatic ISO 8601 conversion
- Remove duplicate timestamp display from Poll RHCSAF section
- Fix preview results text readability
- Add comprehensive unit tests for DatabaseService
- Update BUILD.bazel and CI workflow to include new tests
This commit fixes multiple issues in test_csaf_processing.py that caused
CI failures:

1. Missing unittest.main() call
   - Added 'if __name__ == "__main__": unittest.main()' block
   - Without this, Bazel's py_test runs the file as a script but never
     executes the tests, causing false positives
   - pytest doesn't need this (auto-discovers tests), but Bazel does

2. Fixed async test lifecycle methods
   - Changed 'async def tearDown' to 'async def asyncTearDown'
   - Removed incorrect @classmethod decorators from asyncSetUp/asyncTearDown
   - These must be instance methods in unittest.IsolatedAsyncioTestCase
   - Consolidated setUp logic into asyncSetUp
   - Added close_test_db() call to asyncTearDown for proper cleanup

3. Updated test CSAF data structure
   - Added product_version entries in product_tree (required by refactored parser)
   - Changed from EUS to MAIN product variant (EUS products are filtered out)
   - Added proper product_id, purl, and CPE format
   - The refactored CSAF parser (commit ccb297e) extracts packages from
     product_tree instead of vulnerabilities.product_status.fixed

4. Fixed test assertions
   - Changed minor_version expectation from 4 to None (CPE has no minor version)
   - Fixed test_no_fixed_packages to remove product_tree entries instead of
     just clearing the fixed array

Root cause analysis:
- Bazel tests were never actually running (missing unittest.main())
- GitHub Actions tests were running via pytest in Integration Tests step
- pytest auto-discovers unittest tests without needing __main__ block
- This is why CI showed failures while local Bazel tests appeared to pass

All tests now pass in both Bazel and pytest environments.
Extracted magic constants from _is_eus_product() function to improve
maintainability and readability:

- EUS_CPE_PRODUCTS: CPE product identifiers for EUS variants
- EUS_PRODUCT_NAME_KEYWORDS: Keywords for identifying EUS products

Using frozenset for better performance on membership checks.
- Move product_name and cpe declarations closer to usage
- Simplify modular package NEVRA extraction using split directly
- Remove redundant nevra variable and empty string check
Replace explicit length comparison with truthiness check for
red_hat_affected_products set.
Removed comments that simply restated what the code clearly does.
Kept only comments that provide non-obvious context such as:
- CPE format examples
- Product ID format variations
- Business logic explanations
- Remove redundant str() calls in f-strings
- Use 'raise ... from e' to preserve exception chain
Converted nested helper functions to standalone pure functions:
- _traverse_for_eus: Now takes and returns product_eus_map explicitly
- _extract_packages_from_branches: Now takes and returns packages explicitly

This makes the code more testable, readable, and eliminates hidden
state mutations from closure variables.
Check if advisory only affects EUS products immediately after
verifying vulnerabilities exist, before extracting packages,
CVEs, and other data. This saves processing time for advisories
that will be skipped anyway.

Also cleaned up redundant product_full_name variable.
This commit addresses two validation issues that prevented importing
configuration files exported from production:

1. Export serializer converting version numbers to floats:
   - The _json_serializer in admin_supported_products.py was converting
     all Decimal types to float, including version numbers
   - Version numbers (match_major_version, match_minor_version) should
     be integers, not floats
   - Updated serializer to check if Decimal is a whole number and
     convert to int, preserving proper type semantics

2. Name validation rejecting parentheses:
   - Production database contains legacy products with names like
     "Rocky Linux 8.5 x86_64 (Legacy)"
   - Validation pattern only allowed: letters, numbers, spaces, dots,
     hyphens, and underscores
   - Updated NAME_PATTERN to allow parentheses for legacy product naming
   - Updated error message to reflect allowed characters

These changes ensure that configurations exported from production can
be successfully imported into development environments without manual
data cleanup.
Update test expectations to match the new behavior where whole number
Decimal values are serialized as integers instead of floats. This aligns
with the change to _json_serializer that preserves integer types for
version numbers and other integer values.
Add boolean active field to supported_products_rh_mirrors table to allow
disabling mirrors without deleting them. This preserves historical data
and mirror relationships while preventing the mirror from being used in
new advisory processing.

Changes:
- Add active column with default true to supported_products_rh_mirrors
- Add database index on active field for query performance
- Add migration script for schema change
- Update DB model with active field
- Add active field to admin UI forms (create and edit)
- Update mirror filtering in workflow service to respect active flag
- Update configuration import/export to handle active field
- Add active field validation in form processing
The active checkbox wasn't saving properly when unchecked because HTML
forms don't send unchecked checkbox values. This caused the field to
always default to "true" in the backend.

Added hidden input with value "false" before each checkbox, so the form
always sends a value. Backend now parses all "active" values and takes
the last one (which will be "true" if checked, "false" if unchecked).

Changes:
- Add hidden input to mirror edit and new templates
- Update both POST endpoints to manually parse form data for active field
- Remove default="true" from Form parameters that was masking the issue
Implemented multi-level sorting and visual status indicators for mirrors
in the admin UI to improve usability and organization.

Changes:
- Sort mirrors by active status (active first), then major version (desc),
  then name (asc) for logical grouping
- Add Status column with green "Active" and gray "Inactive" tags for
  clear visual differentiation
- Update validation to allow parentheses in mirror names for descriptive
  naming like "Rocky Linux 9 (BaseOS)"
- Fetch mirrors with explicit ordering in backend instead of relying on
  database insertion order
The RHMatcherWorkflow was processing all mirrors regardless of their
active status, causing unnecessary fetches from mirrors that should
be skipped. This adds a check to skip mirrors where active=False
in the match_rh_repos activity.
The block_remaining_rh_advisories function had a nested loop bug where
it would iterate over all mirrors from a prefetch, then inside that loop
query for active mirrors and iterate over them again. This caused:

1. Redundant database queries (N queries for N total mirrors)
2. Processing each active mirror N times instead of once
3. Variable shadowing with the reused 'mirror' variable name

Simplified to a single query for active mirrors and one processing loop.
Removed unnecessary hidden input fields and simplified the form parsing
logic for the active checkbox in mirror creation and editing forms.

Changes:
- Replaced complex list indexing with simple membership check
- Removed hidden input fields from both Jinja templates
- Updated comments to reflect simpler approach

The functionality remains identical, but the code is more readable
and maintainable.
Add comprehensive tests for the simplified checkbox parsing logic
and active field functionality:

- Checkbox parsing for checked/unchecked/missing states
- Active field in configuration export (true/false cases)
- Active field in configuration import validation
- Backwards compatibility for imports without active field

All tests pass successfully.
Both admin_supported_product_mirror_repomd_new_post and
admin_supported_product_mirror_repomd_post had identical code for
building form_data and calling validation. Extracted this into
_validate_repomd_form helper that returns validated_data, errors,
and the original form_data for use in error templates.

This eliminates 14 lines of duplication across the two functions.
rockythorn and others added 4 commits November 14, 2025 19:12
Implements new v2 endpoint that uses normalized database relationships
(supported_product_id, major_version) instead of denormalized product_name
strings to enable aggregation across minor versions within a major release.

Key improvements:
- FK-based package filtering prevents cross-product contamination
- Fixes module prefix bug by stripping "module." consistently
- Enables major version aggregation (e.g., all Rocky 8.x advisories)
- Maintains v1 backward compatibility with no functional changes
- Fixes source RPM mapping bug where binaries were incorrectly mapped to
  source RPMs from different minor versions (e.g., el8_7 binary mapped to
  el8_6 source). The refactored build_source_rpm_mapping() now correctly
  matches each binary package to its exact source RPM version.

New endpoint: /{product}/{major_version}/{repo}/updateinfo.xml?arch={arch}
Example: /rocky-linux/8/BaseOS/updateinfo.xml?arch=x86_64
Implements transparent stripping of 'module.' prefix from package_name field
at the ORM layer using Python property pattern.

The package_name field contains 'module.' prefix for module packages
(e.g., 'module.postgresql' instead of 'postgresql'), causing source RPM
mapping failures.

No database migration required. The ORM property pattern handles the data
quality issue transparently.

Co-authored-by: Trinity Quirk <[email protected]>
Removes manual module. prefix stripping from business logic now that
the AdvisoryPackage ORM model handles it transparently via property getter.

Changes:
- get_source_package_name(): Removed .removeprefix(module.) call
- build_source_rpm_mapping(): Removed manual prefix stripping before comparison
- Updated function docstrings to remove references to prefix handling
- Updated tests to use clean package names (ORM already stripped prefix)

The ORM property pattern ensures pkg.package_name always returns a clean
value without the module. prefix, eliminating the need for defensive
prefix stripping throughout the codebase.

Benefits:
- Simpler, more maintainable code
- Single source of truth for prefix handling (ORM layer)
- No risk of forgetting to strip prefix in future code
- Business logic focuses on domain concerns, not data quality issues
Replaces hardcoded architecture list with the Architecture enum from
apollo.server.validation module to eliminate duplication and ensure
consistency across the codebase.

The centralized enum supports all architectures Rocky Linux uses,
including riscv64 which was missing from the hardcoded list but exists
in the database.

Changes:
- Import Architecture enum from validation module
- Replace hardcoded list check with enum validation
- Remove duplicate architecture test (already tested in test_validation.py)

Benefits:
- Single source of truth for valid architectures
- Supports full set of architectures (x86_64, aarch64, i386, i686, ppc64, ppc64le, s390x, riscv64, noarch)
- Consistent validation behavior across all Apollo endpoints
- No risk of architecture lists diverging between modules
@rockythorn rockythorn marked this pull request as ready for review November 15, 2025 02:59
@rockythorn rockythorn requested a review from mstg November 15, 2025 03:40
The AdvisoryPackage.__init__() method was dropping all package_name values
due to incorrect field attribute handling when using Tortoise ORM source_field
mapping. The field _package_name maps to DB column package_name, but __init__
was setting kwargs['package_name'] instead of kwargs['_package_name'], causing
values to be silently ignored.

Also adds null checks in package extraction logic to skip packages when
package_name cannot be determined from source RPM metadata.
Copy link
Contributor

@trinity-q trinity-q 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 approved all of the PRs which make this one up, so this one is also fine to go.

…ibility

Adds optional v2 API endpoint support while maintaining full backwards
compatibility with existing v3 API usage patterns.

New v2 API enables major version aggregation (e.g., all Rocky 9.x advisories)
and optional minor version filtering, providing 80% more advisory coverage
compared to v3's single-version matching.

Backwards compatibility:
- Default behavior unchanged (uses v3 API)
- All existing scripts work without modification
- New parameters only required when opting into v2
Improves code quality and API ergonomics based on PR feedback.

Key changes:
- Use aiohttp's params parameter instead of manual query string construction
- Remove explicit --api-version flag in favor of auto-detection
- API version determined by presence of --major-version parameter
- Extract API_BASE_URL as module constant for reusability
@rockythorn rockythorn requested a review from trinity-q November 21, 2025 16:48
@mstg mstg merged commit 5f9264f into resf:main Nov 22, 2025
1 check passed
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.

3 participants