Skip to content

Single file shuttle export - #1424

Open
zyxw59 wants to merge 10 commits into
masterfrom
emily-shuttle-export
Open

zyxw59 wants to merge 10 commits into
masterfrom
emily-shuttle-export

Conversation

@zyxw59

@zyxw59 zyxw59 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Asana Ticket: 🏹 Single file describing a shuttle for use in gtfs_input

Adds a new endpoint, /api/shuttle/:id which returns a JSON description of a shuttle.

This endpoint only includes stop IDs, not names/locations/other info, since stops may be shared between multiple shuttle routes.

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

@zyxw59
zyxw59 requested a review from a team as a code owner September 8, 2026 19:41
@zyxw59
zyxw59 requested review from jzimbel-mbta and removed request for a team September 8, 2026 19:41
@zyxw59

zyxw59 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Once again, I would very much appreciate advice on the download button (where to put it, how to style it), since the current place I've put it (right next to the save/cancel buttons) is not great. Also it completely breaks when creating a new shuttle 🫠

Comment thread test/arrow_web/controllers/api/shuttle_controller_test.exs Outdated

@jzimbel-mbta jzimbel-mbta left a comment

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.

Couple of comments on the controller setup, I'll take a look at the UI side as well shortly.

Comment thread lib/arrow_web/router.ex Outdated
Comment thread lib/arrow_web/controllers/api/shuttle_controller.ex Outdated
@zyxw59

zyxw59 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

I decided to just include the download button on the index page, since you will generally need to save anyway, and saving takes you back to the index page.

@jzimbel-mbta

Copy link
Copy Markdown
Member

From checking this locally, it looks like a shuttle with no shape assigned to it (which is allowed while it's in draft state, see Arrow.Shuttles.Shuttle.validate_for_active_status and validate_for_inactive_status) causes the download action to fail.

Probably other fields/relations that are allowed to be missing on draft shuttles would also cause the action to fail.

Given that, do you think it would make sense to:

  1. hide the download button, and
  2. have API.ShuttleController's show action send a 400 response

for inactive shuttles?

@zyxw59

zyxw59 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Yeah that sounds like a good idea

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.

3 participants