Skip to content

Enhance Meetup sync: merge iCal with past events, improve parsing, update workflow triggers, and add tests#16

Merged
carloshvp merged 2 commits intomainfrom
codex/find-workflow-for-updating-events-c5u5a4
Apr 3, 2026
Merged

Enhance Meetup sync: merge iCal with past events, improve parsing, update workflow triggers, and add tests#16
carloshvp merged 2 commits intomainfrom
codex/find-workflow-for-updating-events-c5u5a4

Conversation

@carloshvp
Copy link
Copy Markdown
Member

Motivation

  • Ensure the Meetup sync gathers recent historical events missing from the iCal feed and make parsing more robust for real-world Meetup HTML/JSON-LD shapes.
  • Prevent the Actions job from committing changes during pull requests while still running syncs on PRs for validation.

Description

  • Update GitHub Actions workflow to also run on pull_request and to only commit changes when the event was triggered by push, schedule, or workflow_dispatch, and update README to document trigger and a new MEETUP_PAST_EVENTS_URL option.
  • Add DEFAULT_PAST_EVENTS_URL, unescape_ical_text, and unescape ical fields in parse_ical_events to correctly handle escaped line breaks and characters from iCal.
  • Extend parse_ld_json_events to expand @graph nodes and parse richer JSON-LD shapes, and add merge_events to deduplicate and combine multiple sources.
  • Add HTML helpers extract_event_urls_from_html and fetch_url and update fetch_events to first try iCal, then pull recent past events from the events/past page (including individual event pages for details), merge results, and fall back to the main events page as needed.
  • Add unit tests in tests/test_sync_meetup_events.py covering relative/absolute event link extraction and JSON-LD @graph node parsing.

Testing

  • Ran the unit tests with python -m unittest tests/test_sync_meetup_events.py and both tests passed.
  • The updated workflow was validated locally by inspecting trigger logic and README updates were applied to reflect new behavior.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5280d3a6f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +292 to +293
if merged_events:
return merged_events
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Continue fallback to events page when iCal data is unavailable

Returning immediately on merged_events skips the /events/ fallback path whenever events/past has any data. In the scenario where the iCal source is down or empty but events/past succeeds, this function returns only past events and never fetches upcoming events from MEETUP_EVENTS_URL, so the site can silently lose all upcoming listings during an iCal outage. Only short-circuit here when iCal data is present, or merge in /events/ results before returning.

Useful? React with 👍 / 👎.

@carloshvp carloshvp merged commit 1e9ba0b into main Apr 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant