Skip to content

Add extra=forbid to pydantic basemodels in ert storage and cleanup#13521

Open
erlenlh wants to merge 1 commit into
mainfrom
ert-storage-update-basemodel
Open

Add extra=forbid to pydantic basemodels in ert storage and cleanup#13521
erlenlh wants to merge 1 commit into
mainfrom
ert-storage-update-basemodel

Conversation

@erlenlh
Copy link
Copy Markdown
Contributor

@erlenlh erlenlh commented May 8, 2026

Issue
Resolves #13520

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Add backport label to latest release (format: 'backport release-branch-name')

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.95%. Comparing base (7aa972d) to head (d79859c).
⚠️ Report is 30 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13521      +/-   ##
==========================================
- Coverage   89.95%   89.95%   -0.01%     
==========================================
  Files         459      460       +1     
  Lines       32173    32409     +236     
==========================================
+ Hits        28942    29154     +212     
- Misses       3231     3255      +24     
Flag Coverage Δ
cli-tests 37.05% <100.00%> (-0.29%) ⬇️
fuzz 44.02% <100.00%> (-0.13%) ⬇️
gui-tests 66.59% <100.00%> (-0.21%) ⬇️
performance-and-unit-tests 77.97% <100.00%> (+<0.01%) ⬆️
test 45.69% <100.00%> (-0.09%) ⬇️

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

Files with missing lines Coverage Δ
src/ert/storage/local_ensemble.py 96.12% <ø> (+0.20%) ⬆️
src/ert/storage/local_experiment.py 96.38% <100.00%> (ø)
src/ert/storage/local_storage.py 92.70% <100.00%> (-1.05%) ⬇️

... and 29 files with indirect coverage changes

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 8, 2026

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing ert-storage-update-basemodel (d79859c) with main (0175a5d)

Open in CodSpeed

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds extra="forbid" to all Pydantic BaseModel classes under src/ert/storage, ensuring that loading storage index/failure JSON rejects unknown fields rather than silently ignoring them. This aligns these internal storage models with the convention already used in Everest config models and other ERT event models.

Changes:

  • _Migrations and top-level _Index in local_storage.py now forbid extra fields.
  • ExperimentStatus and experiment _Index in local_experiment.py now forbid extra fields.
  • Ensemble _Index and _Failure in local_ensemble.py now forbid extra fields.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/ert/storage/local_storage.py Add extra="forbid" to _Migrations and _Index.
src/ert/storage/local_experiment.py Add extra="forbid" to ExperimentStatus and _Index.
src/ert/storage/local_ensemble.py Add extra="forbid" to _Index and _Failure.

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.

Storage BaseModel extra=forbid

3 participants