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: refactoring STDCM handler #9509

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

hamz2a
Copy link
Contributor

@hamz2a hamz2a commented Oct 29, 2024

closes #9476

@hamz2a hamz2a requested a review from a team as a code owner October 29, 2024 14:06
@github-actions github-actions bot added the area:editoast Work on Editoast Service label Oct 29, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2024

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

Codecov Report

Attention: Patch coverage is 84.61538% with 66 lines in your changes missing coverage. Please review.

Project coverage is 37.86%. Comparing base (160ef24) to head (b2cf36b).
Report is 31 commits behind head on dev.

Files with missing lines Patch % Lines
editoast/src/views/timetable/stdcm/request.rs 77.71% 37 Missing ⚠️
editoast/src/core/conflict_detection.rs 34.78% 15 Missing ⚠️
editoast/src/views/timetable/stdcm.rs 92.48% 10 Missing ⚠️
editoast/src/models/work_schedules.rs 90.62% 3 Missing ⚠️
editoast/src/core/simulation.rs 90.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9509      +/-   ##
==========================================
+ Coverage   37.84%   37.86%   +0.01%     
==========================================
  Files         990      992       +2     
  Lines       90920    90973      +53     
  Branches     1176     1176              
==========================================
+ Hits        34413    34451      +38     
- Misses      56053    56068      +15     
  Partials      454      454              
Flag Coverage Δ
editoast 73.32% <84.61%> (+0.04%) ⬆️
front 20.10% <ø> (-0.01%) ⬇️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.74% <ø> (ø)

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.


🚨 Try these New Features:

@hamz2a hamz2a marked this pull request as draft October 30, 2024 08:41
@hamz2a hamz2a force-pushed the hai/editoast-refactoring-STDCM-handler branch 2 times, most recently from a171352 to 0e3603c Compare November 4, 2024 08:36
@hamz2a hamz2a marked this pull request as ready for review November 4, 2024 09:00
@eckter
Copy link
Contributor

eckter commented Nov 4, 2024

Before checking the code itself: do we want to merge it during the feature freeze? Are there bug fixes in there, or is it just moving code around?

@hamz2a
Copy link
Contributor Author

hamz2a commented Nov 4, 2024

Before checking the code itself: do we want to merge it during the feature freeze? Are there bug fixes in there, or is it just moving code around?

This is purely a refactoring with no functional changes.
Are there any risks you see that would block merging it during the freeze?

Copy link
Contributor

@woshilapin woshilapin left a comment

Choose a reason for hiding this comment

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

Thanks for the addressed comments from #9434.

editoast/src/core/stdcm.rs Outdated Show resolved Hide resolved
@eckter
Copy link
Contributor

eckter commented Nov 5, 2024

This is purely a refactoring with no functional changes.
Are there any risks you see that would block merging it during the freeze?

The same as any kind of change, bugs. I believe refactorings are even more "unstable" than new features as they affect what's already there and not just new things.

This specific part of the code that translates front inputs into core payloads is especially sensitive. It's poorly tested and it's difficult to track problems there, and we've had issues recently. At a time where we're working on stabilizing stdcm, it would be painful to introduce instability.

Let's talk about this on matrix, it's not about this PR specifically.

Copy link
Contributor

@leovalais leovalais left a comment

Choose a reason for hiding this comment

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

Thanks for all this work, it looks much more organized now! I left a bunch of comments which are mostly about:

  • module organization
  • visibility being more permissive than required (I didn't add a comment in all places)
  • naming

It would be nice to have some module-level documentation in stdcm.rs describing the whole workflow still, even if it's much clearer now thanks to structure.

I'm not as worried about bugs as @eckter is: we already released a tested version and we're shooting demo videos very soon. I'd say that if a bug arises we're better off fixing it in the refactored code directly since this won't impact the PIP. I'm fine with waiting until the end of the week before merging in case a critical bug happens preventing us from shooting the videos, but there's no point in waiting after that point imo. Wdyt?

editoast/openapi.yaml Show resolved Hide resolved
editoast/src/core/simulation.rs Outdated Show resolved Hide resolved
editoast/src/core/simulation.rs Outdated Show resolved Hide resolved
editoast/src/core/stdcm.rs Outdated Show resolved Hide resolved
editoast/src/core/stdcm.rs Show resolved Hide resolved
editoast/src/views/timetable/stdcm.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm_request_payload.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm_request_payload.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm_request_payload.rs Outdated Show resolved Hide resolved
@hamz2a hamz2a force-pushed the hai/editoast-refactoring-STDCM-handler branch from 0e3603c to d2da584 Compare November 6, 2024 09:34
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Lgtm for front part (not tested, we were'nt handling this status anymore)

@hamz2a hamz2a requested a review from leovalais November 7, 2024 12:06
@hamz2a hamz2a force-pushed the hai/editoast-refactoring-STDCM-handler branch 2 times, most recently from 0a2dc9e to 380300e Compare November 7, 2024 14:54
editoast/src/views/timetable/stdcm.rs Outdated Show resolved Hide resolved
editoast/src/core/simulation.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm/failure_handler.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm/failure_handler.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/path_not_found_handler.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@leovalais leovalais left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

editoast/src/views/timetable/stdcm/failure_handler.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm/request.rs Show resolved Hide resolved
editoast/src/views/timetable/stdcm.rs Show resolved Hide resolved
editoast/src/views/timetable/stdcm.rs Outdated Show resolved Hide resolved
editoast/src/views/timetable/stdcm.rs Outdated Show resolved Hide resolved
@hamz2a hamz2a force-pushed the hai/editoast-refactoring-STDCM-handler branch 2 times, most recently from 9882eef to 1d42ba4 Compare November 15, 2024 14:07
Copy link
Contributor

@eckter eckter left a comment

Choose a reason for hiding this comment

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

Much clearer, thanks 👍

I've noticed a couple weird things (that were already there in the previous version), I've commented them and I'll check further

@hamz2a hamz2a requested a review from leovalais November 15, 2024 14:14
@hamz2a hamz2a force-pushed the hai/editoast-refactoring-STDCM-handler branch from 1d42ba4 to c73a137 Compare November 15, 2024 17:15
Copy link
Contributor

@leovalais leovalais left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the changes!

Signed-off-by: hamz2a <atrari.hamza@gmail.com>
@hamz2a hamz2a force-pushed the hai/editoast-refactoring-STDCM-handler branch from 56bef61 to b2cf36b Compare November 18, 2024 15:41
@hamz2a hamz2a enabled auto-merge November 18, 2024 16:00
@hamz2a hamz2a added this pull request to the merge queue Nov 19, 2024
Merged via the queue into dev with commit e0ec0fc Nov 19, 2024
27 checks passed
@hamz2a hamz2a deleted the hai/editoast-refactoring-STDCM-handler branch November 19, 2024 09:13
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.

editoast: refactoring STDCM handler
7 participants