Fix modular downstream_component parsing for branch mapping - #784
Open
fila43 wants to merge 1 commit into
Open
Conversation
The Jira Downstream Component Name field (customfield_10669) stores the full modular string "module:stream/package" (e.g. "postgresql:16/postgis") for modular issues, but is_modular() and parse_module_stream() expect just the package name. Extract the package part so modular issues get the correct stream-specific branch (e.g. stream-postgresql-16-rhel-9.8.0) instead of falling through to the non-modular rhel-9.8.0. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
customfield_10669) storesmodule:stream/package(e.g.postgresql:16/postgis) for modular issues, butis_modular()andparse_module_stream()expect just the package name.extract_downstream_package()utility toversion_utils.pythat normalizes the raw field value:"postgresql:16/postgis"→"postgis", plain names like"curl"pass through unchanged.triage_agent.pywherestate.downstream_componentis set, sodetermine_target_branchcorrectly producesstream-postgresql-16-rhel-9.8.0instead of falling through torhel-9.8.0.TriageState.downstream_componentfield description to document the normalization.Without this fix, modular issues get the wrong target branch in triage results and Jira comments.
Test plan
test_extract_downstream_package— covers modular, non-modular, None, and empty inputstest_is_modular_requires_package_not_full_modular_string— proves raw value fails, extracted value workstest_parse_module_stream_requires_package_not_full_modular_string— same for stream parsingtest_map_version_to_module_branch_extracts_package_from_raw_field— end-to-end proofMade with Cursor