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

editoast: add endpoint to check if locations exist #8953

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

hamz2a
Copy link
Contributor

@hamz2a hamz2a commented Sep 20, 2024

closes #8636

@hamz2a hamz2a requested a review from a team as a code owner September 20, 2024 15:16
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 95.40636% with 13 lines in your changes missing coverage. Please review.

Project coverage is 37.23%. Comparing base (03b957e) to head (6b67cbc).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
editoast/src/views/infra/objects.rs 95.04% 6 Missing ⚠️
front/src/common/api/generatedEditoastApi.ts 94.73% 4 Missing ⚠️
...st/editoast_schemas/src/infra/operational_point.rs 70.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #8953      +/-   ##
============================================
+ Coverage     37.12%   37.23%   +0.10%     
  Complexity     2211     2211              
============================================
  Files          1260     1260              
  Lines        115109   115335     +226     
  Branches       3230     3230              
============================================
+ Hits          42738    42948     +210     
- Misses        70438    70454      +16     
  Partials       1933     1933              
Flag Coverage Δ
core 74.67% <ø> (ø)
editoast 72.73% <95.65%> (+0.16%) ⬆️
front 15.21% <94.73%> (+0.01%) ⬆️
gateway 2.20% <ø> (ø)
osrdyne 2.60% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

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

First round of review. This new endpoint should share code with the PF one. Check my comments bellow.

crate::routes! {
"/objects/{object_type}" => get_objects,
"/check-locations" => check_locations,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename the endpoint since what it really does is returning path steps coordinates.

Comment on lines +115 to +117
pub fn from_railjson(railjson: serde_json::Value) -> Result<Self, ParseError> {
serde_json::from_value(railjson).map_err(ParseError::from)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not letting diesel deserialize to OP?

Copy link
Contributor

Choose a reason for hiding this comment

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

We already have something that transform a list of PathStep into a Vec<Vec<TrackOffset>>. This also checked that all path steps are valids.

It's important that this logic is shared between both endpoints.

Important

Small changes are required. This function raise an error when it encounter the first invalid path step.
It should instead continue and list all valids/invalid.

The function I'm talking about

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.

Editoast: being able to identify unrecognized PR in the infrastructure
3 participants