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(feat): 'CacheOperation' only deals with 'ObjectCache' #5924

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

woshilapin
Copy link
Contributor

@woshilapin woshilapin commented Nov 30, 2023

Preliminary step for #5856

@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch from 808f6c7 to a84101f Compare November 30, 2023 14:04
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (6916627) 26.58% compared to head (ccd6085) 26.60%.

Files Patch % Lines
editoast/src/infra_cache/mod.rs 76.74% 10 Missing ⚠️
editoast/src/views/infra/edition.rs 77.27% 5 Missing ⚠️
editoast/src/schema/operation/mod.rs 70.00% 3 Missing ⚠️
...lications/editor/tools/pointEdition/components.tsx 0.00% 3 Missing ⚠️
...lications/editor/tools/trackEdition/components.tsx 0.00% 3 Missing ⚠️
...ications/editor/tools/switchEdition/components.tsx 0.00% 2 Missing ⚠️
editoast/src/views/infra/auto_fixes.rs 90.00% 1 Missing ⚠️
...cations/editor/tools/rangeEdition/tool-factory.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #5924      +/-   ##
============================================
+ Coverage     26.58%   26.60%   +0.02%     
  Complexity     2123     2123              
============================================
  Files           931      930       -1     
  Lines        123165   123171       +6     
  Branches       2678     2677       -1     
============================================
+ Hits          32741    32769      +28     
+ Misses        88837    88816      -21     
+ Partials       1587     1586       -1     
Flag Coverage Δ
core 78.96% <ø> (ø)
editoast 74.77% <84.16%> (+0.06%) ⬆️
front 9.37% <52.63%> (-0.01%) ⬇️
gateway 2.75% <ø> (ø)

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.

@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch from a84101f to 14104b6 Compare November 30, 2023 16:26
@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch from 14104b6 to b299f41 Compare December 1, 2023 14:41
Copy link
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

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

Just naming, and waiting for the necessary changes in edition.rs as discussed.
(no front reviewed)

@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch 4 times, most recently from 6c95382 to 7fc57c1 Compare December 1, 2023 16:20
@woshilapin woshilapin marked this pull request as ready for review December 1, 2023 16:36
@woshilapin woshilapin requested review from a team as code owners December 1, 2023 16:36
Copy link
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

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

LGTM (no front reviewed)

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.

Reviewed (editoast only) + Tested.

@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch from 7fc57c1 to e4f6220 Compare December 1, 2023 17:00
@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch from e4f6220 to 2d40ec4 Compare December 5, 2023 09:57
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.

Editoast + tested

@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch 4 times, most recently from 16c7a7a to 040c4a6 Compare December 11, 2023 14:57
`OperationResult`'s purpose is to apply operation on the `InfraCache` object.
The naming `OperationResult` come from the fact that `Operation` are applied on DB,
and the result of that operation is kept around as `OperationResult` to be reapplied
on the `InfraCache`.

However, with the implementation of the magic wand, we start to create operations that will
not be applied on the DB, but only on the `InfraCache`. Therefore, the naming `OperationResult`
doesn't make sense anymore.

Since the purpose is to apply these operations on the cache, hence `CacheOperation` name.
`CacheOperation` is only applied on `InfraCache`. There is no point in using `RailjsonObject`
at that point. Therefore, `CacheOperation` should only depend on `ObjectCache`.
@woshilapin woshilapin force-pushed the wsl/refactor/5856-operation-cache branch from 040c4a6 to ccd6085 Compare December 12, 2023 15:07
Copy link
Contributor

@Tguisnet Tguisnet left a comment

Choose a reason for hiding this comment

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

LGTM editoast part !

@Math-R
Copy link
Contributor

Math-R commented Dec 15, 2023

LGTM =)

@Math-R Math-R added this pull request to the merge queue Dec 15, 2023
Merged via the queue into dev with commit 4517369 Dec 15, 2023
@Math-R Math-R deleted the wsl/refactor/5856-operation-cache branch December 15, 2023 12:41
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.

7 participants