Skip to content

experiments: ignore stale execution refs after HEAD moves - #11137

Open
remote-controlled-man wants to merge 1 commit into
treeverse:mainfrom
remote-controlled-man:codex/prflow-49e78ffababd
Open

remote-controlled-man wants to merge 1 commit into
treeverse:mainfrom
remote-controlled-man:codex/prflow-49e78ffababd

Conversation

@remote-controlled-man

Copy link
Copy Markdown
  • ❗ I have followed the Contributing to DVC checklist.

  • 📖 No documentation update is needed; this restores the existing meaning of HEAD after an interrupted experiment.

Fixes #9260

An abruptly terminated workspace experiment can leave EXEC_BASELINE behind. After checking out a branch or committing a new baseline, dvc exp list still resolves HEAD through that leftover ref and lists experiments from the old commit. Other callers of revision resolution can also read the old baseline.

Only substitute the experiment baseline while detached HEAD still matches the executor's starting commit or its result ref. Once the user moves to another commit or returns to a branch, use the requested HEAD again. Preserve suffixes such as HEAD~1 and HEAD^ during execution.

Regression tests cover packed leftover refs with both branch and detached commits, along with the executor's starting and result commits. A local CLI reproduction starts a real experiment, kills its process group after the stage starts, switches to its branch, packs refs and creates a new commit; dvc exp list is empty after the fix instead of listing the old experiment.

Validation on the final commit:

  • Complete default Python suite: 3057 passed, 11 skipped, 2 xpassed (pytest -n 4 --dist=worksteal --timeout=300, 103.86 s). Temporary test repositories were outside the checkout. Ran with TZ=UTC: the existing test_gc.py::test_date computes UTC dates but parses the cutoff in the local timezone, and fails in timezones already on the next calendar day.
  • pre-commit run --all-files: passed, including Ruff, codespell and mypy.
  • Real CLI interruption/recovery reproduction and five targeted revision-resolution cases: passed.

Copilot AI balanced review requested due to automatic review settings November 8, 2026 17:21
@github-project-automation github-project-automation Bot moved this to Backlog in DVC Nov 8, 2026
@CLAassistant

CLAassistant commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.99%. Comparing base (2431ec6) to head (2881416).
⚠️ Report is 221 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11137      +/-   ##
==========================================
+ Coverage   90.68%   90.99%   +0.31%     
==========================================
  Files         504      505       +1     
  Lines       39795    41200    +1405     
  Branches     3141     3265     +124     
==========================================
+ Hits        36087    37489    +1402     
- Misses       3042     3072      +30     
+ Partials      666      639      -27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

exp list: does not show new experiments

3 participants