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: moved utility functions to helpers.rs #8837

Closed
wants to merge 1 commit into from

Conversation

hamz2a
Copy link
Contributor

@hamz2a hamz2a commented Sep 12, 2024

Moved utility functions to helpers.rs for reusability across multiple files. This refactor prepares the functions to be used in other parts of the project (#8636).

@hamz2a hamz2a requested a review from a team as a code owner September 12, 2024 09:03
@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2024

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

Codecov Report

Attention: Patch coverage is 96.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 37.02%. Comparing base (060fc5e) to head (2ce7df6).
Report is 78 commits behind head on dev.

Files with missing lines Patch % Lines
editoast/src/views/path.rs 96.25% 3 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #8837      +/-   ##
============================================
- Coverage     37.05%   37.02%   -0.04%     
- Complexity     2209     2211       +2     
============================================
  Files          1255     1255              
  Lines        114134   114229      +95     
  Branches       3182     3182              
============================================
- Hits          42293    42290       -3     
- Misses        69949    70048      +99     
+ Partials       1892     1891       -1     
Flag Coverage Δ
core 74.84% <ø> (+0.04%) ⬆️
editoast 72.43% <96.25%> (-0.04%) ⬇️
front 14.89% <ø> (-0.03%) ⬇️
gateway 2.20% <ø> (ø)
osrdyne 2.71% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.37% <ø> (ø)

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

@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.

Seems ok. I wonder if we should just put the functions directly in path.rs. I know sometimes we create utils.rs or helpers.rs but they usually contains a bunch of stuff that we can't name correctly (hence utils or helpers in lack of a better name). In this case, it's only 3 functions, path.rs doesn't contain much yet. What do you think?

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.

Same comment as @woshilapin. If we generalize this practice, I'm afraid we'll end up with dozens of helpers.rs files all over the place.

@hamz2a hamz2a force-pushed the hai/editoast-refactor-move-helpers branch 2 times, most recently from 007638e to 057fabe Compare September 16, 2024 08:50
@leovalais
Copy link
Contributor

I share the same concerns about this practice as @woshilapin and @flomonster. Maybe turning these functions into static methods of the related models could avoid creating helpers, utils and such? Wdyt?

@hamz2a
Copy link
Contributor Author

hamz2a commented Sep 16, 2024

I put all the functions in path.rs

@hamz2a hamz2a force-pushed the hai/editoast-refactor-move-helpers branch from 057fabe to a50ecf8 Compare September 16, 2024 09:27
@hamz2a hamz2a force-pushed the hai/editoast-refactor-move-helpers branch from a50ecf8 to 2ce7df6 Compare September 16, 2024 09:44
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.

Thank you.

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!

@hamz2a
Copy link
Contributor Author

hamz2a commented Sep 25, 2024

We no longer need these changes.

@hamz2a hamz2a closed this Sep 25, 2024
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.

5 participants