Review feed requests in the operations API

Open
#1,866 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
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, yaml
Domain
api, backend

Research direction

Start with the endpoint definitions in OperationsAPI.yaml, then find the existing create-feed and update-feed logic that approval should reuse. Done means the list, get, approve and reject endpoints exist and work, approving an add request links the new feed to the request, approving an update applies changes to the linked feed, and only pending requests can be reviewed. The issue depends on an unresolved decision about how approved feeds reach each environment and who assigns stable IDs, so confirm that first.

Written by the indexing model from the issue text.

Description

Describe the problem

Add and update feed requests (#1864, #1865) are stored as pending and do not change any feed. There is no way to review them and apply the approved ones.

Proposed solution

Add operations API endpoints to review feed requests.

  • List feed requests, filtered by type, status and feed ID, and get a single request.
  • Approve a request:
    • add: create the GTFS or GTFS-RT feed using the existing create feed logic, and set the request's feed ID.
    • update: apply the changes to the linked feed using the existing update feed logic.
  • Reject a request with a reason.
  • Set the request status to approved or rejected and record who reviewed it and when. Keep the record so the feed's request history is preserved.
  • Allow the reviewer to edit the request payload before approving.
  • Close GitHub related issue with comment.

Acceptance criteria

  • Endpoints are defined in OperationsAPI.yaml and implemented.
  • Approving an add request creates the feed and links it to the request.
  • Approving an update request applies the changes to the linked feed.
  • Only pending requests can be approved or rejected.

Out of scope

  • Admin web UI for reviewing requests (mobilitydata-operations-web).
  • Notifying the submitter and closing the GitHub issue.
Alternatives you've considered

Reviewers copy the request data into the existing create/update feed endpoints by hand. That keeps the manual step and doesn't link the feed to its request.

Additional context

Depends on the decision on how approved feeds reach every environment and who assigns stable IDs. If approval opens a PR on the catalogs repo instead of writing to the database directly, the approve step changes accordingly.

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.