Skip to content

feat: add availability endpoint#1721

Merged
davidgamez merged 7 commits into
mainfrom
availability_endpoint
Jun 10, 2026
Merged

feat: add availability endpoint#1721
davidgamez merged 7 commits into
mainfrom
availability_endpoint

Conversation

@davidgamez

@davidgamez davidgamez commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary:

This PR adds the /v1/gtfs_feeds/{id}/availability endpoint, returning GET/HEAD checks for GTFS endpoints.

Expected behavior:

Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).

Testing tips:

Using local development:

  • Execute
./scripts/init-local-folder.sh
./scripts/docker-localdb-rebuild-data.sh --populate-data --populate-test-data
  • Start the api
./scripts/api-start./sh
  • Execute the curl command
curl --request GET \
  --url http://localhost:8080/v1/gtfs_feeds/mdb-1/availability
  • Verify the response

From our ai friend

This pull request adds support for querying historical availability checks for GTFS feeds via a new API endpoint. It includes the implementation of the endpoint, model mapping, test data population, and comprehensive integration tests to validate filtering, pagination, and error handling.

API and Model Implementation:

  • Added a new endpoint get_gtfs_feed_availability to feeds_api_impl.py that returns historical availability checks for a GTFS feed, with support for filtering by date range, sorting, pagination, and error handling for invalid parameters.
  • Introduced GtfsFeedAvailabilityCheckImpl to map database ORM objects to API models, including mapping of request_type to HTTP method names.
  • Registered new models in the OpenAPI generator file for availability check and response.
  • Added a new error message for when the 'from' timestamp is after the 'to' timestamp.

Test Data and Integration Testing:

  • Updated test data population script and test data JSON to include GTFS feed availability checks, ensuring the new endpoint has fixture data for testing. [1] [2]
  • Added comprehensive integration tests for the new endpoint, covering basic response, ordering, filtering, pagination, and error scenarios.

Imports and Supporting Changes:

  • Added necessary imports for new models and implementation classes throughout the codebase. [1] [2] [3] [4] [5]

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)

@davidgamez davidgamez marked this pull request as ready for review June 4, 2026 21:38
@davidgamez davidgamez linked an issue Jun 4, 2026 that may be closed by this pull request
confidence=0.95,
matched_name=heuristic_match,
matched_source="pattern-heuristics",
if db_session is not None:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This fixes local testing

@davidgamez davidgamez requested a review from cka-y June 10, 2026 13:18
Comment thread docs/DatabaseCatalogAPI.yaml
Comment thread docs/OperationsAPI.yaml Outdated
Comment thread functions-python/operations_api/.openapi-generator/VERSION
@davidgamez davidgamez requested a review from cka-y June 10, 2026 15:02

@cka-y cka-y left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@davidgamez davidgamez merged commit 152c80e into main Jun 10, 2026
38 of 40 checks passed
@davidgamez davidgamez deleted the availability_endpoint branch June 10, 2026 15:21
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.

Add GTFS feed availability history endpoint

2 participants