Skip to content

feat: web page revalidation#1653

Merged
cka-y merged 14 commits intomainfrom
feat/mdb-web-67
Apr 9, 2026
Merged

feat: web page revalidation#1653
cka-y merged 14 commits intomainfrom
feat/mdb-web-67

Conversation

@cka-y
Copy link
Copy Markdown
Contributor

@cka-y cka-y commented Apr 8, 2026

Summary:
Closes MobilityData/mobilitydatabase-web#67
This pull request introduces a new mechanism to trigger web app cache revalidation via Google Cloud Tasks whenever certain backend processes update or modify feed data. The integration ensures that the web application remains in sync with backend changes by scheduling deduplicated revalidation tasks for affected feeds.
Web app revalidation integration:

  • Added a new function create_web_revalidation_task in gcp_utils.py to enqueue deduplicated Cloud Tasks for web app cache revalidation, with error handling and logging. This function is called after feed updates in batch_process_dataset, pmtiles_builder, process_validation_report, and reverse_geolocation_processor to ensure the web app reflects backend changes promptly. [1] [2] [3] [4] [5]
  • Updated the Cloud Function tasks_executor configuration to include the WEB_APP_REVALIDATE_SECRET secret, which is used for secure revalidation requests.
  • Added comprehensive unit tests for the revalidation task creation logic in test_web_revalidation.py, covering edge cases and error handling.

Workflow and deployment updates:

  • Updated GitHub Actions workflows (api-deployer.yml, api-dev.yml, api-qa.yml, api-prod.yml) to support new inputs and secrets for web app revalidation, including passing the revalidation URL and secret from 1Password. [1] [2] [3] [4] [5] [6]

Dependency management:

  • Added google-cloud-tasks to api/requirements.txt to support the new task scheduling functionality.

Codebase imports and structure:

  • Updated imports in several modules to use the new create_web_revalidation_task function where appropriate. [1] [2] [3] [4] [5]

These changes collectively ensure that the web application cache is automatically and efficiently revalidated after backend feed updates, improving data consistency and user experience.
Summarize the changes in the pull request including how it relates to any issues (include the #number, or link them).
Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@cka-y cka-y changed the title Feat/mdb web 67 feat: web revalidation backend logic Apr 8, 2026
@cka-y cka-y changed the title feat: web revalidation backend logic feat: web page revalidation Apr 8, 2026
@cka-y cka-y marked this pull request as ready for review April 8, 2026 17:47
Copy link
Copy Markdown
Contributor

@Alessandro100 Alessandro100 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

We are missing changes in the operations API, which is an entry point for feed updates.

cka-y and others added 4 commits April 9, 2026 11:07
- Delete functions-python/tasks_executor/src/tasks/data_import/transitfeeds/ directory
- Delete functions-python/tasks_executor/tests/tasks/data_import/test_transitfeeds_sync.py
- Delete functions-data/transitfeeds_data_import/ directory
- Remove sync_transitfeeds_handler import and task registry entry from main.py
- Remove transitfeeds-specific producer_url guard in populate_db_gtfs.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TransitFeeds is no longer active. This removes:
- The 'transitfeeds' entry from externalIdSourceMap
- The transitfeeds redirect banner (Alert) from Header.tsx
- The utm_source=transitfeeds URL param handling in Feeds/index.tsx
- TransitFeeds URLs from isValidFeedLink test cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverts web-app and api/src/scripts/populate_db_gtfs.py to their
state before the transitfeeds removal commits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cka-y
Copy link
Copy Markdown
Contributor Author

cka-y commented Apr 9, 2026

We are missing changes in the operations API, which is an entry point for feed updates.

Good catch @davidgamez - added the revalidation to the operations api

@cka-y cka-y requested a review from davidgamez April 9, 2026 15:45
pycountry
pytz No newline at end of file
pytz
google-cloud-tasks No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see this library used in the API. We need it in the operations API requirements.txt.

Copy link
Copy Markdown
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM!

@cka-y cka-y merged commit 32d2b91 into main Apr 9, 2026
3 checks passed
@cka-y cka-y deleted the feat/mdb-web-67 branch April 9, 2026 16:23
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.

Optimize revalidate of feed detail pages

3 participants