Skip to content

Refactor issue parsing into a shared module#242

Open
AndreaGriffiths11 wants to merge 1 commit into
mainfrom
andreagriffiths11/special-system
Open

Refactor issue parsing into a shared module#242
AndreaGriffiths11 wants to merge 1 commit into
mainfrom
andreagriffiths11/special-system

Conversation

@AndreaGriffiths11

Copy link
Copy Markdown
Collaborator

This PR centralizes the issue body parsing into a single validated shared module used by both update_schedule.py and extract_guest_metadata.py.

Changes Made

  1. Added .github/scripts/osf_issue_parser.py: A shared module containing a ParsedIssue dataclass and parsing logic (parse_field, parse_date_from_title, parse_date, parse_issue, to_schedule_row, to_guest_promo_metadata).
  2. Added .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.
  3. Wired update_schedule.py: Replaced its local parsing logic with osf_issue_parser.to_schedule_row().
  4. Wired extract_guest_metadata.py: Replaced its duplicate logic with osf_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).

- 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>
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