Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement RESTful API for stop page data #23

Merged
merged 7 commits into from
Dec 14, 2023

Conversation

boringcactus
Copy link
Member

@boringcactus boringcactus commented Dec 12, 2023

Asana task: Determine how back-end service will provide non-real-time data to the client › Set up HTTP queries

I'm using the JSONAPI Elixir library to make this easier, but that name conflicts (in extremely annoying to debug ways) with the un-namespaced JsonApi module from dotcom, so I've moved that module to MBTAV3API.JsonApi and added in aliases in the places it's used.

Also changes how we manage test data.

This comment was marked as outdated.

@boringcactus boringcactus marked this pull request as ready for review December 12, 2023 00:18
@boringcactus boringcactus requested a review from a team as a code owner December 12, 2023 00:18
@boringcactus boringcactus requested review from EmmaSimon and removed request for a team December 12, 2023 00:18

This comment was marked as outdated.

Copy link

Coverage of commit 60826ba

Summary coverage rate:
  lines......: 55.3% (487 of 880 lines)
  functions..: 51.9% (257 of 495 functions)
  branches...: no data found

Files changed coverage rate:
                                                              |Lines       |Functions  |Branches    
  Filename                                                    |Rate     Num|Rate    Num|Rate     Num
  ==================================================================================================
  lib/mbta_v3_api/json_api.ex                                 |91.3%     46| 100%    15|    -      0
  lib/mbta_v3_api/mbta_v3_api.ex                              |77.3%     44|81.8%    11|    -      0
  lib/mbta_v3_api/mbta_v3_api/routes.ex                       | 7.1%     14|10.0%    10|    -      0
  lib/mbta_v3_api/route_patterns/route_pattern.ex             | 9.1%     11|14.3%     7|    -      0
  lib/mbta_v3_api/routes/parser.ex                            |58.5%     41| 100%    12|    -      0
  lib/mbta_v3_api/routes/repo.ex                              | 8.7%     46|37.5%    16|    -      0
  lib/mbta_v3_api/stops/api.ex                                |68.2%    110|96.8%    31|    -      0
  lib/mix/tasks/mock_api.ex                                   | 0.0%     16| 0.0%     2|    -      0
  lib/mobile_app_backend_web/controllers/route_pattern_view.ex| 100%      2|31.8%    22|    -      0
  lib/mobile_app_backend_web/controllers/route_view.ex        | 100%      5|50.0%    24|    -      0
  lib/mobile_app_backend_web/controllers/stop_controller.ex   | 100%      7|85.7%     7|    -      0
  lib/mobile_app_backend_web/controllers/stop_view.ex         | 100%      5|54.2%    24|    -      0
  lib/mobile_app_backend_web/router.ex                        |80.0%     10|71.4%    14|    -      0
  test/support/helpers.ex                                     | 100%      2|75.0%     4|    -      0
  test/support/mock_api_data.ex                               | 100%      8| 100%     1|    -      0

Download coverage report

Copy link
Contributor

@EmmaSimon EmmaSimon left a comment

Choose a reason for hiding this comment

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

Love how much this cleans up the tests, and the view and controller code is nice and straightforward, good work. 👍 I've got a few general questions, but nothing blocking.

Copy link

Coverage of commit 6303b92

Summary coverage rate:
  lines......: 55.9% (492 of 880 lines)
  functions..: 52.1% (258 of 495 functions)
  branches...: no data found

Files changed coverage rate:
                                                              |Lines       |Functions  |Branches    
  Filename                                                    |Rate     Num|Rate    Num|Rate     Num
  ==================================================================================================
  lib/mbta_v3_api/json_api.ex                                 |91.3%     46| 100%    15|    -      0
  lib/mbta_v3_api/mbta_v3_api.ex                              |88.6%     44|90.9%    11|    -      0
  lib/mbta_v3_api/mbta_v3_api/routes.ex                       | 7.1%     14|10.0%    10|    -      0
  lib/mbta_v3_api/route_patterns/route_pattern.ex             | 9.1%     11|14.3%     7|    -      0
  lib/mbta_v3_api/routes/parser.ex                            |58.5%     41| 100%    12|    -      0
  lib/mbta_v3_api/routes/repo.ex                              | 8.7%     46|37.5%    16|    -      0
  lib/mbta_v3_api/stops/api.ex                                |68.2%    110|96.8%    31|    -      0
  lib/mix/tasks/mock_api.ex                                   | 0.0%     16| 0.0%     2|    -      0
  lib/mobile_app_backend_web/controllers/route_pattern_view.ex| 100%      2|31.8%    22|    -      0
  lib/mobile_app_backend_web/controllers/route_view.ex        | 100%      5|50.0%    24|    -      0
  lib/mobile_app_backend_web/controllers/stop_controller.ex   | 100%      7|85.7%     7|    -      0
  lib/mobile_app_backend_web/controllers/stop_view.ex         | 100%      5|54.2%    24|    -      0
  lib/mobile_app_backend_web/router.ex                        |80.0%     10|71.4%    14|    -      0
  test/support/helpers.ex                                     | 100%      2|75.0%     4|    -      0
  test/support/mock_api_data.ex                               | 100%      8| 100%     1|    -      0

Download coverage report

@boringcactus boringcactus merged commit f573654 into main Dec 14, 2023
4 checks passed
@boringcactus boringcactus deleted the mth-rest-static-data branch December 14, 2023 16:55
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.

2 participants