Skip to content

Add logging for realization status page - #14089

Open
MagnusSletten wants to merge 1 commit into
equinor:mainfrom
MagnusSletten:log-realization-usage
Open

Add logging for realization status page#14089
MagnusSletten wants to merge 1 commit into
equinor:mainfrom
MagnusSletten:log-realization-usage

Conversation

@MagnusSletten

@MagnusSletten MagnusSletten commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Issue
Resolves #14094

Approach

Log the first time a user opens realization details or a forward model step's stdout/stderr/error, once per dialog, so usage of these views can be measured.

Two mechanisms, depending on whether a suitable signal already exists: RealizationWidget reuses _real_view.clicked via a new log_once helper in utils.py. FMStepOverview logs inline from its click handler, which already branches on column, guarded by a set of logged names.

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

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

This PR adds user-interaction logging to the experiment status UI (realization details selection and forward-model step output/error opening), and introduces unit tests to ensure the logging is emitted only once and only for user-initiated actions.

Changes:

  • Log the first user click that opens realization details in the experiment status view.
  • Log the first opening of forward-model step stdout/stderr files and error-message dialogs in the experiment status view.
  • Add GUI unit tests verifying that these log messages are emitted only once (and not during programmatic selection/refresh).

Reviewed changes

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

File Description
tests/ert/unit_tests/gui/experiments/test_run_dialog.py Adds tests asserting the new “log once” behavior for realization selection and FM step output/error opening.
src/ert/gui/experiments/view/realization.py Adds a one-time logging hook on the realization list “clicked” signal to track opening realization details.
src/ert/gui/experiments/run_dialog.py Adds one-time logging for opening stdout/stderr dialogs and error-message dialogs in FMStepOverview.

@codecov-commenter

codecov-commenter commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.92%. Comparing base (6557b68) to head (958dd49).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14089      +/-   ##
==========================================
+ Coverage   91.89%   91.92%   +0.03%     
==========================================
  Files         479      479              
  Lines       33397    33409      +12     
==========================================
+ Hits        30689    30712      +23     
+ Misses       2708     2697      -11     
Flag Coverage Δ
cli-tests 36.29% <0.00%> (-0.02%) ⬇️
fuzz 44.26% <33.33%> (-0.01%) ⬇️
gui-tests 58.63% <50.00%> (-0.01%) ⬇️
performance-and-unit-tests 80.77% <100.00%> (-0.04%) ⬇️
test 46.05% <33.33%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
src/ert/gui/experiments/run_dialog.py 93.93% <100.00%> (+3.54%) ⬆️
src/ert/gui/experiments/view/realization.py 95.65% <100.00%> (+0.15%) ⬆️

... and 1 file with indirect coverage changes

@codspeed-hq

codspeed-hq Bot commented Aug 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing MagnusSletten:log-realization-usage (958dd49) with main (6557b68)

Open in CodSpeed

Comment thread src/ert/gui/experiments/view/realization.py Outdated
@MagnusSletten
MagnusSletten force-pushed the log-realization-usage branch 2 times, most recently from f001c19 to 6361149 Compare August 5, 2026 12:39
The experiment status page has no usage data, so it is unknown whether
users inspect individual realizations or open forward model step
output. Log the first time each is opened, once per dialog, to keep
the log readable.

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

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

Suppressed comments (2)

tests/ert/unit_tests/gui/experiments/test_run_dialog.py:1290

  • Using close() on a QDialog is less explicit than reject()/accept() and can make it harder to guarantee that finished/cleanup handlers run in tests. Since this dialog is being closed as part of the test flow, prefer reject() here to deterministically emit finished (and trigger any connected cleanup).
    file_dialog.close()

tests/ert/unit_tests/gui/experiments/test_run_dialog.py:1265

  • Monkeypatching FileDialog._init_thread to a no-op bypasses the normal cleanup wiring (self.finished.connect(self._quit_thread)), so the file opened in FileDialog.__init__ is never closed during the test. This can leak file descriptors across the suite.

Consider replacing the no-op with a lightweight test stub that still sets up _thread and connects _quit_thread, without starting the worker thread.

This issue also appears on line 1290 of the same file.

    monkeypatch.setattr(FileDialog, "_init_thread", lambda self: None)

@MagnusSletten
MagnusSletten marked this pull request as ready for review August 5, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add logging for experiment status page

4 participants