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: migrate endpoint GET rolling_stock/{id}/livery/{id} #3519

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

clarani
Copy link
Contributor

@clarani clarani commented Mar 13, 2023

close #3300

  • migrate endpoint GET rolling_stock/{id}/livery/{id} to rust
  • remove delete on cascade on rolling_stock_compound_image (otherwise, when we delete the compound image, it automatically deletes the livery too, which is not the expected behaviour)
  • add tests & documentation

Later, we should change the database structure to use the delete on cascade (which implies removing the compound_image_id of the livery and add the livery_id in the compound_image = reverse the relationship)

@clarani clarani force-pushed the cni/editoast/migrate-endpoint-livery-rolling-stock branch from 8549437 to 6a059bb Compare March 15, 2023 10:28
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #3519 (15560a3) into dev (6ad9b2c) will increase coverage by 0.07%.
The diff coverage is 84.46%.

@@             Coverage Diff              @@
##                dev    #3519      +/-   ##
============================================
+ Coverage     68.31%   68.38%   +0.07%     
  Complexity     1896     1896              
============================================
  Files           413      415       +2     
  Lines         20606    20702      +96     
  Branches       1519     1519              
============================================
+ Hits          14076    14158      +82     
- Misses         5829     5843      +14     
  Partials        701      701              
Flag Coverage Δ
editoast 75.03% <83.14%> (+0.21%) ⬆️
front 56.52% <92.85%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
editoast/src/documents.rs 80.55% <ø> (ø)
editoast/src/schema/mod.rs 94.44% <ø> (ø)
editoast/src/schema/rolling_stock.rs 88.46% <ø> (ø)
editoast/src/views/light_rolling_stocks.rs 100.00% <ø> (ø)
editoast/src/schema/rolling_stock_image.rs 72.50% <72.50%> (ø)
editoast/src/schema/rolling_stock_livery.rs 87.50% <87.50%> (ø)
front/src/common/api/osrdEditoastApi.ts 92.58% <92.85%> (+0.09%) ⬆️
editoast/src/views/rolling_stocks.rs 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@clarani clarani force-pushed the cni/editoast/migrate-endpoint-livery-rolling-stock branch from 6a059bb to 15560a3 Compare March 15, 2023 10:48
@clarani clarani marked this pull request as ready for review March 15, 2023 12:10
@clarani clarani requested review from a team as code owners March 15, 2023 12:10
@clarani clarani added the area:editoast Work on Editoast Service label Mar 15, 2023
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.

Good for me but this code will be highly refactored.
We should store liveries images in the document table.
We will use the new model system to interact with the DB.

Copy link
Contributor

@Castavo Castavo left a comment

Choose a reason for hiding this comment

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

Nice PR !
I've learnt about Selectable today 😁

editoast/src/schema/rolling_stock_image.rs Show resolved Hide resolved
@clarani clarani merged commit 320dcc3 into dev Mar 15, 2023
@clarani clarani deleted the cni/editoast/migrate-endpoint-livery-rolling-stock branch March 15, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editoast Work on Editoast Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate GET /rolling-stock/{id}/livery endpoint to editoast
5 participants