Skip to content

Conversation

@Jazzcort
Copy link
Collaborator

This function used to fetch the Erratum object after it found the previous erratum. However, we encountered an edge case that the erratum_id from the erratatools API's response of

/api/v1/product_versions/{RHEL version}/released_builds/{package name}

cound be null in REHL 8. To address this, we decide to make this function just return the erratum id and build nvr so we can decide whether we should fetch the Erratum object or not after calling this function.

Also adjust the logic where this function is called.

This function used to fetch the Erratum object after it found the previous
erratum. However, we encountered an edge case that the erratum_id from the
erratatools API's response of

<endpoint>/api/v1/product_versions/{RHEL version}/released_builds/{package name}

cound be null in REHL 8. To address this, we decide to make this function just
return the erratum id and build nvr so we can decide whether we should fetch the
Erratum object or not after calling this function.

Also adjust the logic where this function is called.
@Jazzcort Jazzcort requested a review from owtaylor November 25, 2025 14:46
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the get_previous_erratum function to handle an edge case where an erratum ID from the API can be null. The function now returns the erratum ID and build NVR as a tuple, deferring the decision to fetch the full Erratum object to the caller. The changes are correctly propagated to the call sites in erratum_handler.py and issue_handler.py.

My review includes a couple of suggestions to improve maintainability and readability. One suggestion is to refactor a block of code in errata_utils.py for conciseness and to use safer dictionary access. Another suggestion is to centralize the construction of errata advisory URLs to avoid hardcoding them in multiple places.

Adds get_erratum_advisory_url, removes trailing slash from ET_URL,
and updates erratum URL construction across the codebase.
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