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

Don't consider a vehicle "invalid" when on a shuttle run #546

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

arkadyan
Copy link
Contributor

@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #546 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #546      +/-   ##
==========================================
+ Coverage   97.60%   97.63%   +0.02%     
==========================================
  Files         171      171              
  Lines        3845     3845              
  Branches      528      528              
==========================================
+ Hits         3753     3754       +1     
+ Misses         88       87       -1     
  Partials        4        4              
Impacted Files Coverage Δ
assets/src/models/vehicle.ts 100.00% <ø> (ø)
assets/src/models/vehicleData.ts 100.00% <ø> (ø)
assets/src/components/propertiesList.tsx 100.00% <100.00%> (ø)
assets/src/components/propertiesPanel/header.tsx 94.11% <100.00%> (ø)
...ponents/propertiesPanel/vehiclePropertiesPanel.tsx 97.91% <100.00%> (ø)
assets/src/components/routeVariantName.tsx 100.00% <100.00%> (ø)
assets/src/models/vehicleStatus.ts 100.00% <100.00%> (ø)
assets/src/settings.ts 100.00% <100.00%> (ø)
lib/concentrate/consumer/vehicle_positions.ex 100.00% <100.00%> (ø)
lib/realtime/vehicle.ex 95.00% <100.00%> (+0.08%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d13cab...6741640. Read the comment docs.

Copy link
Member

@paulswartz paulswartz left a comment

Choose a reason for hiding this comment

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

What about changing the interface that clients use to tell if a vehicle is off course from vehicle.is_off_course to Vehicle.off_course?(vehicle)? That simplifies the arguments to the function, allows you to avoid the modification (and weird @spec) for shuttle?/1, and allows other changes in the future about which vehicles are off course.

@arkadyan
Copy link
Contributor Author

@paulswartz I think the big reason is that the "clients" that want to know about this are all in Javascript on the client-side. So we need to pass data across, we can't rely on an Elixir function.

Copy link
Member

@paulswartz paulswartz left a comment

Choose a reason for hiding this comment

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

In that case, shouldn't shuttle? also be is_shuttle on Vehicle?

@arkadyan
Copy link
Contributor Author

@paulswartz makes sense, added a is_shuttle property to Vehicle.

@ingridpierre
Copy link

@arkadyan This looked good to me 👍, invalid vehicles showed the message everywhere that they were found and all the shuttles did not. For better or worse there were a lot of specials online right now to test with :-/

Copy link
Member

@paulswartz paulswartz left a comment

Choose a reason for hiding this comment

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

🍰

@arkadyan arkadyan merged commit b260612 into master Mar 31, 2020
@arkadyan arkadyan deleted the mss-shuttle-not-invalid branch March 31, 2020 20:59
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