Repository navigation
fix(web): keep a renamed workspace's runs in it across a restart - #262
Merged
Merged
Conversation
…s gone adopt_roots(into=name) fell back to the open workspace when no workspace had that name, so a restart after a rename added the run's job root to a workspace that never held it. A missing name now finds or makes one as when nothing is open, and leaves the open workspace open.
run.json names the workspace a restart puts the run back in; a rename moved the workspace's directory and left that name behind.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #256
What
Two commits.
shared.adopt_roots). At a restart,app.pyputs each resumed run back withadopt_roots([ex.jobs], into=ex.workspace). Whenintodid not load, the run's job root went into the workspace open at the time, which never held it. Now a missingintois treated like the case where nothing is open: the roots go to the workspace that holds exactly them, or to a new one. That workspace is opened only when nothing else is open, so the open workspace stays open, as A restart opens the run's workspace, not the workspace that was open #157 requires. Callers that passintofrom a form check that it exists first, so only the restart reaches this path.workspaces.workspace_rename). Every run record is loaded inexecution.EXECUTIONS, fromrestoreat start or fromstart. After the directory moves, each record filed under the old name is filed under the new one withfile_under, which savesrun.jsonunder the record's lock. A restart then puts the run back in the renamed workspace.Touches
routes (
web/shared.py,web/workspaces.py) · docs (docs/builder.md) · testsVerified
In a rootless Podman container (
python:3.12, withuvfor the Harbor build fixtures):python3 app/tests/parallel.py: 3104 tests in 157 modules, OK.pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 557 tests in 56 modules, OK.ui_tests/test_run_routes.py,ResumeIntoWorkspace. Each starts a real run from/runand restarts throughapp.main:test_a_rename_refiles_the_run_and_a_restart_puts_it_back_in_the_renamed_workspace: the rename route rewritesrun.json. After the restart, the run is in the renamed workspace and not in the open one.test_a_run_filed_under_a_name_no_workspace_has_stays_out_of_the_open_one: the issue's case, a record that still names the old workspace. The open workspace stays open and does not gain the run.test_rename_keeps_runs.py) passes on this branch.Not checked: a real
nullius serverestart with a live run after a rename.Risk
RUNS_DIRthan the one this server reads keeps the old name. At its restart, that run gets a workspace of its own and is never added to the open one.