Refactor issue parsing into a shared module#242
Open
AndreaGriffiths11 wants to merge 1 commit into
Open
Conversation
- Created osf_issue_parser.py for shared issue parsing logic - Added unit tests in test_osf_issue_parser.py - Updated update_schedule.py and extract_guest_metadata.py to use the unified parser Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
This PR centralizes the issue body parsing into a single validated shared module used by both
update_schedule.pyandextract_guest_metadata.py.Changes Made
.github/scripts/osf_issue_parser.py: A shared module containing aParsedIssuedataclass and parsing logic (parse_field,parse_date_from_title,parse_date,parse_issue,to_schedule_row,to_guest_promo_metadata)..github/scripts/test_osf_issue_parser.py: Unit tests covering different scenarios like issue-template body, Calendly-style body, title date fallback, multiple assignees vs single assignee.update_schedule.py: Replaced its local parsing logic withosf_issue_parser.to_schedule_row().extract_guest_metadata.py: Replaced its duplicate logic withosf_issue_parser.to_guest_promo_metadata().A parity testing script was run successfully against 87 live open/closed scheduled issues to ensure 100% parity with the previous implementations (with minor expected corrections for missing fields).