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 'locked' to the schema definition of rolling stock #9024

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

woshilapin
Copy link
Contributor

In the schema definition in Python, the field locked exists. However, it doesn't exist in the corresponding editoast implementation.

In the schema definition in Python, the field `locked` exists.
However, it doesn't exist in the corresponding `editoast` implementation.

Signed-off-by: Jean SIMARD <[email protected]>
@woshilapin woshilapin requested a review from a team as a code owner September 26, 2024 13:57
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2024

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

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 37.07%. Comparing base (a5e9ca2) to head (c5b693a).
Report is 18 commits behind head on dev.

Files with missing lines Patch % Lines
editoast/src/models/rolling_stock_model.rs 50.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff            @@
##                dev    #9024   +/-   ##
=========================================
  Coverage     37.07%   37.07%           
  Complexity     2241     2241           
=========================================
  Files          1262     1262           
  Lines        115972   115974    +2     
  Branches       3277     3277           
=========================================
+ Hits          42994    42995    +1     
- Misses        71024    71025    +1     
  Partials       1954     1954           
Flag Coverage Δ
core 74.79% <ø> (ø)
editoast 72.38% <50.00%> (-0.01%) ⬇️
front 15.16% <ø> (ø)
gateway 2.22% <ø> (ø)
osrdyne 2.57% <ø> (ø)
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

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

However I'm not sure it makes a lot of sense to have a locked field in the schemas at all. The field (which also exists for infrastructures) exists to prevent modification of the resource. When the permission system will be up these fields are likely to disappear since they're functionally equivalent to a share at the READ privilege level. That's why from a separation of concerns perspective I'm not sure we want to expose our current lack of resource control in the schemas. Maybe @flomonster has a better overview of the subject.

In any case, there shouldn't be any mismatch between osrd_schemas and editoast_schemas one way or the other.

@flomonster
Copy link
Contributor

However I'm not sure it makes a lot of sense to have a locked field in the schemas at all. The field (which also exists for infrastructures) exists to prevent modification of the resource. When the permission system will be up these fields are likely to disappear since they're functionally equivalent to a share at the READ privilege level. That's why from a separation of concerns perspective I'm not sure we want to expose our current lack of resource control in the schemas. Maybe @flomonster has a better overview of the subject.

You are right, the locked field will disappear with the permission system.

The reason we did not expose this field is because the RS editor does not permit to edit it. It is only used during the import.

@woshilapin
Copy link
Contributor Author

Does that mean that in the meantime, we're ok with the difference between osrd_schemas and editoast_schemas, until permission system appears and then, we'll remove it everywhere from osrd_schemas?

@flomonster
Copy link
Contributor

Does that mean that in the meantime, we're ok with the difference between osrd_schemas and editoast_schemas, until permission system appears and then, we'll remove it everywhere from osrd_schemas?

I prefer to merge this PR and try to make osrd_schemas match editoast_schemas.

@woshilapin woshilapin added this pull request to the merge queue Sep 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 28, 2024
@woshilapin woshilapin added this pull request to the merge queue Sep 30, 2024
Merged via the queue into dev with commit 718ed24 Sep 30, 2024
23 checks passed
@woshilapin woshilapin deleted the wsl/editoast/rolling-stock-schema-locked branch September 30, 2024 10:08
bougue-pe added a commit that referenced this pull request Oct 18, 2024
Since #9024, this is
required to be able to use:
```sh
./scripts/load-railjson-rolling-stock.sh tests/data/rolling_stocks/fast_rolling_stock.json
```
bougue-pe added a commit that referenced this pull request Oct 18, 2024
Since #9024, this is
required to be able to use:
```sh
./scripts/load-railjson-rolling-stock.sh tests/data/rolling_stocks/fast_rolling_stock.json
```

Signed-off-by: Pierre-Etienne Bougué <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Oct 21, 2024
Since #9024, this is
required to be able to use:
```sh
./scripts/load-railjson-rolling-stock.sh tests/data/rolling_stocks/fast_rolling_stock.json
```

Signed-off-by: Pierre-Etienne Bougué <[email protected]>
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.

4 participants