Skip to content

Conversation

@HakonSohoel
Copy link
Contributor

@HakonSohoel HakonSohoel commented Jan 19, 2026

Some forward models wrongly stated ert as the source package due to ert being the default source_package value in the
ForwardModelStepDocumentation class.
With this commit the source package of the ForwardModelStepPlugin will be used as default value if it is not set explicitly.

Issue
Resolves #12402

Approach

  • Added test to check if the source package returned by forward_model_steps matches their actual source package
  • Installed some packages containing installable_forward_model_steps and verified that the test failed
  • Introduced a get_source_package function that will make the forward module documentation use the correct package by default
  • Verified that the test passed

Checklist

  • 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')

@HakonSohoel HakonSohoel added the release-notes:documentation PR with only changes to documentation label Jan 19, 2026
@eivindjahren eivindjahren requested a review from Copilot January 19, 2026 13:27
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.64%. Comparing base (e0162ab) to head (2255126).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/ert/config/forward_model_step.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12670      +/-   ##
==========================================
- Coverage   90.68%   90.64%   -0.04%     
==========================================
  Files         429      429              
  Lines       29804    29817      +13     
==========================================
  Hits        27028    27028              
- Misses       2776     2789      +13     
Flag Coverage Δ
cli-tests 37.56% <30.00%> (-0.01%) ⬇️
gui-tests 69.32% <30.00%> (-0.08%) ⬇️
performance-and-unit-tests 73.92% <90.00%> (-0.02%) ⬇️
test 38.06% <30.00%> (-0.01%) ⬇️

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

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

This PR fixes a bug where forward model steps were incorrectly reporting "ert" as their source package in the documentation. The issue was caused by using a hardcoded default value in the ForwardModelStepDocumentation class. The fix uses stack inspection to automatically determine the correct source package from the calling plugin module.

Changes:

  • Added a new test to verify that forward model step documentation correctly reports the source package of its parent plugin
  • Introduced get_source_package() function that uses stack inspection to dynamically determine the source package
  • Changed ForwardModelStepDocumentation.source_package field to use default_factory=get_source_package instead of a hardcoded "ert" default

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
tests/ert/unit_tests/docs/test_ert_documentation.py Adds regression test that verifies forward model documentation reports correct source package
src/ert/config/forward_model_step.py Implements stack inspection to automatically determine source package for documentation

@HakonSohoel HakonSohoel force-pushed the fix-wrong-source-package-in-docs branch 2 times, most recently from 379d1ae to 03884ff Compare January 19, 2026 13:57
Some forward models wrongly stated ert as the source package due to
ert being the default source_package value in the
ForwardModelStepDocumentation class.
With this commit the source package of the ForwardModelStepPlugin
will be used as default value if it is not set explicitly.
@HakonSohoel HakonSohoel force-pushed the fix-wrong-source-package-in-docs branch from 03884ff to 2255126 Compare January 19, 2026 14:00
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 19, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing HakonSohoel:fix-wrong-source-package-in-docs (2255126) with main (f0d9de4)

Summary

✅ 22 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes:documentation PR with only changes to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In ert docs there's a list of forward models, but it is not to my knowledge straight forward to know which repo/plugin it's comming from

2 participants