Skip to content

Do not update project repo when loading results - #127

Open
schmoelder wants to merge 1 commit into
mainfrom
non-mutating-case-load
Open

Do not update project repo when loading results#127
schmoelder wants to merge 1 commit into
mainfrom
non-mutating-case-load

Conversation

@schmoelder

Copy link
Copy Markdown
Contributor

Commit 0967f17 changed Case.load() from updating the output repository to updating the project repository before looking for matching cached results. That fixed the update target only if loading is expected to sync repositories first, but it made a load operation mutate the study repository. In practice, Case.load() can now fetch, rebase, and hard-reset the project checkout before provenance matching happens.

This PR makes Case.load() read from local state by default. Loading results no longer updates the project repository, fetches output refs, or moves either checkout unless explicitly requested.

For callers that want to discover newly pushed output results before matching, Case.load(fetch=True) fetches the output repository refs first. This keeps the useful part of the old behavior, finding newly available output results, without pulling, rebasing, or resetting the project repository.

The tests cover that default Case.load() does not call project_repo.update(), does not fetch output refs by default, and leaves both repositories in the same Git state while still loading cached result files. They also cover that fetch=True performs the explicit output fetch path.

This changes an unintended side effect of Case.load(). Code that relied on loading to update the project repository should call project_repo.update() explicitly before loading.

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.

1 participant