Implement update feed endpoint for GTFS and GTFS-RT

Open
#1,865 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
firebase, github, openapi, python
Domain
api

Research direction

Start with the existing writeToSheet Firebase function to see how update requests and GitHub issue creation work today, and with the operations API PUT to see how feed data is validated. Define the new public endpoint in the OpenAPI spec, then implement it so it validates the feed and request body and stores a pending update request linked to the feed and user without modifying the feed or the spreadsheet. Done when a request for a GTFS or GTFS-RT feed creates a pending record and a linked GitHub issue.

Written by the indexing model from the issue text.

Description

Describe the problem

Update requests for existing feeds come from the website through the writeToSheet Firebase function. The team then applies the changes by hand. The operations API PUT is an internal admin tool and is not meant for contributor-submitted changes.

Proposed solution

Add an endpoint to the public API that accepts update requests for existing GTFS and GTFS-RT feeds.

  • Validate that the feed exists and validate the request body.
  • Store the submission as a feed request of type update with status pending, linked to the existing feed. Attach the user ID to the request.
  • Do not change the feed. The changes are applied when the request is approved.
  • Create the GitHub issue the same way it is done today and link it to the request.
  • Do not write to the spreadsheet.

Acceptance criteria

  • Endpoint is defined in the OpenAPI spec and implemented.
  • Update requests for GTFS and GTFS-RT feeds create a pending update request linked to the feed and the user.
  • A GitHub issue is created for each update request.

Out of scope

  • Approving a request and applying the changes to the feed.
  • Update the web app to call the new endpoint, then retire writeToSheet. This will be done in its own issue when all required issues are addressed.
Alternatives you've considered

Extend the operations API PUT to handle contributor updates. That mixes admin edits with contributor requests that still need review.

Additional context

No response

Dominant language
Python
Stars
34
Forks
7
Avg merge
2d 22h
Merged PRs (30d)
21

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MobilityData/mobility-feed-api

All issues in MobilityData/mobility-feed-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.