Skip to content

Workflow log manage experiments - #14280

Open
erlenlh wants to merge 8 commits into
workflow-log-gui-tabfrom
workflow-log-manage-experiments
Open

Workflow log manage experiments#14280
erlenlh wants to merge 8 commits into
workflow-log-gui-tabfrom
workflow-log-manage-experiments

Conversation

@erlenlh

@erlenlh erlenlh commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Issue
Resolves #14279

Approach
Events are written in json on experiment level in storage.
when an experiment is selected in the "manage experiment" tab, we load the data and populate the same workflows window used when viewing a running experiment.

bilde
  • 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 screenshots are changed: Review screenshot-PR in ert-testdata,
    merge screenshot-PR in ert-testdata before merging this PR.
  • 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')

@ertomatic

Copy link
Copy Markdown
Collaborator

Screenshots differ from baselines. A baseline update PR has been prepared: equinor/ert-testdata#94

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (9f19b27) to head (52012b7).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           workflow-log-gui-tab   #14280      +/-   ##
========================================================
+ Coverage                 91.81%   91.85%   +0.03%     
========================================================
  Files                       487      487              
  Lines                     35089    35152      +63     
========================================================
+ Hits                      32218    32288      +70     
+ Misses                     2871     2864       -7     
Flag Coverage Δ
cli-tests 35.75% <1.53%> (-0.07%) ⬇️
fuzz 43.69% <23.07%> (-0.05%) ⬇️
gui-tests 58.57% <89.23%> (+0.08%) ⬆️
performance-and-unit-tests 81.21% <89.23%> (+0.03%) ⬆️
test 45.31% <23.07%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
src/ert/gui/experiments/view/__init__.py 100.00% <100.00%> (ø)
src/ert/gui/experiments/view/workflow_log.py 99.00% <100.00%> (+0.24%) ⬆️
...ui/tools/manage_experiments/storage_info_widget.py 97.48% <100.00%> (+0.16%) ⬆️
src/ert/run_models/event.py 99.12% <100.00%> (+0.11%) ⬆️

... and 2 files with indirect coverage changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds persisted workflow output viewing to Manage experiments, reusing the existing workflow log widget.

Changes:

  • Loads resilient JSONL workflow events from experiment storage.
  • Adds a lazily loaded Workflows tab with iteration grouping and placeholders.
  • Adds unit/UI coverage and updates workflow documentation.

Reviewed changes

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

Show a summary per file
File Description
src/ert/run_models/event.py Adds workflow-event loading.
src/ert/gui/experiments/view/workflow_log.py Adds bulk loading and stored-log view.
src/ert/gui/experiments/view/__init__.py Exports the new view.
src/ert/gui/tools/manage_experiments/storage_info_widget.py Adds the Workflows tab.
tests/ert/unit_tests/run_models/test_workflow_event_loading.py Tests JSONL loading behavior.
tests/ert/unit_tests/gui/experiments/view/test_workflow_log_widget.py Tests bulk event display.
tests/ert/unit_tests/gui/experiments/view/test_workflow_log_view.py Tests stored-log view behavior.
tests/ert/ui_tests/gui/test_manage_experiments_tool.py Tests the user workflow end-to-end.
docs/ert/reference/workflows/complete_workflows.rst Documents persisted workflow output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ert/run_models/event.py Outdated
Comment thread src/ert/gui/experiments/view/workflow_log.py
Comment thread docs/ert/reference/workflows/complete_workflows.rst Outdated
@ertomatic

Copy link
Copy Markdown
Collaborator

Screenshot tests now pass. The baseline update PR equinor/ert-testdata#94 has been closed.

@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from 00fcfc9 to b43cb48 Compare August 26, 2026 07:23
@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Hooray! CodSpeed harness just leveled up!

The base and head of this comparison were measured with different runner settings, so their benchmark values are not directly comparable.

What changed between base and head:

Re-run the base with the same settings to get a valid performance comparison.


Comparing workflow-log-manage-experiments (52012b7) with workflow-log-gui-tab (d8733ab)1

Open in CodSpeed

Footnotes

  1. No successful run was found on workflow-log-gui-tab (9f19b27) during the generation of this report, so 2dafcc1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from d52092f to 03d5dc9 Compare August 27, 2026 07:13
is a machine-readable file and users are encouraged to read the ERT log instead.
Output from hooks that run before the experiment is created, such as
:code:`PRE_EXPERIMENT`, is held back and written once the storage is created.
:code:`PRE_EXPERIMENT`, is held back and written once the experiment exists.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isn't this equivalent to storage is created?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Storage is created before the experiment is created in it, and run_workflows uses experiment = ensemble.experiment if ensemble is not None else None. So I just thought experiment was more fitting


self.setLayout(layout)

def _current_tab_changed(self, index: int) -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this loads events every time we click. What about cached property? Maybe the data is not big though and it is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

underlying funciton self._workflow_log_view.load_events already has cache, so i dont think its an issue
Image

Comment thread src/ert/gui/tools/manage_experiments/storage_info_widget.py Outdated
).model_dump_json()


def test_that_the_workflows_tab_shows_the_output_stored_for_the_experiment(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can these two tests be merge via parametrize?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

probably, but the asserts are very different, so imo its not cleaner.

@xjules xjules left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good only minor changes potentially to the test.

@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from 03d5dc9 to ee44d7a Compare August 27, 2026 18:40
@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from ee44d7a to 9b27b86 Compare August 28, 2026 12:32
@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch 2 times, most recently from 6c5dfc3 to 132ddc5 Compare August 31, 2026 11:32
@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from 132ddc5 to 3ca47bf Compare August 31, 2026 12:53
@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from 3ca47bf to 44b2583 Compare September 1, 2026 12:13
@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from 44b2583 to 52012b7 Compare September 3, 2026 07:37
erlenlh and others added 2 commits September 3, 2026 10:20
Workflow output is written to workflow_events.jsonl for every hooked
workflow, but nothing could read it back, so output was only ever
visible while the experiment was running.

Add load_workflow_log_events, mirroring load_status_snapshot_event.
An experiment that ran no workflows has no such file, which is not an
error. Lines that fail to parse are skipped with a warning rather than
discarding the file: an interrupted ERT can leave a half-written final
line behind, and the output written before it is still worth showing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
WorkflowLogWidget could only be filled one event at a time, which suits
a running experiment but not a stored one, where every event is known
up front and rebuilding the iteration selector per event is wasteful.

Add load_events to fill it in one go, and WorkflowLogView to wrap it
with a placeholder for experiments that ran no workflows. The view
reads a given path at most once, so the owning tab can load lazily
without re-reading every time it is selected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
erlenlh and others added 6 commits September 3, 2026 10:20
Workflow output could only be seen while an experiment was running.
Add a Workflows tab to the experiment in Manage experiments so it can
be read again afterwards, showing the same table the run dialog does.

The tab sits at experiment level rather than ensemble level because
PRE_EXPERIMENT and POST_EXPERIMENT hooks belong to no single iteration,
and the widget already filters by iteration itself.

Events are read when the tab is first opened rather than when the
experiment is selected, so browsing experiments stays cheap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Same as the WorkflowLogWidget names removed upstream: nothing looks
this one up either.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@erlenlh
erlenlh force-pushed the workflow-log-manage-experiments branch from 52012b7 to 5f2b321 Compare September 3, 2026 08:40
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.

Workflow output should be shown in "manage experiment" view

5 participants