Skip to content

Updater no-op speedup #723

Merged
renatav merged 9 commits intomasterfrom
renatav/sbojanic/updater-pipeline-rework
Apr 20, 2026
Merged

Updater no-op speedup #723
renatav merged 9 commits intomasterfrom
renatav/sbojanic/updater-pipeline-rework

Conversation

@renatav
Copy link
Copy Markdown
Collaborator

@renatav renatav commented Apr 10, 2026

Description (e.g. "Related to ...", etc.)

Adds an early-exit path to the update pipeline so that when there are no remote changes and the local state is already consistent, the full validation is skipped.

Added a local consistency check (check_if_local_repos_match_lvc). Before hitting the remote, the pipeline now verifies that the auth repo and all target repos on disk match the state recorded in last_validated_data. If everything lines up, local_repos_consistent is set and subsequent steps that would otherwise re-validate the full history are skipped.

determine_start_commits short-circuit: when local_repos_consistent=True and the previous update was not partial, the function returns early instead of re-walking all target commits.

taf repo reset --lvc default changed: the flag is now --lvc/--no-lvc defaulting to True, so resetting the last validated commit is the default behaviour unless explicitly opted out.

Improved failure messages: UpdateFailedError messages now suggest taf repo reset as the preferred recovery path alongside the existing --force option.

Closes #676

Code review checklist (for code reviewer to complete)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see this for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Changelog has been updated, as needed (see CHANGELOG.md)

sale3 and others added 6 commits April 8, 2026 00:53
…heck for no-op speedup

Replaces the old reset_to_last_validated_commit pipeline step with
check_if_local_repos_match_lvc, which checks whether the auth repo HEAD
and all on-disk target repos match their last-validated commits.

If consistent, check_if_repo_is_synced_with_remote can run and skip the
full update (clone-to-temp, TUF validation, etc.) when there are no
upstream changes.
Resolve the updater pipeline merge conflict by keeping the local LVC consistency fast path and the moved clean-check ordering.

Also preserve the dirty-state test updates so those cases still expect failures only when there are upstream commits to pull.
- Change --lvc flag to --lvc/--no-lvc with default True in `taf repo reset`
- Update UpdateFailedError messages to suggest `taf repo reset` alongside --force
- Update LVC_NOT_IN_REPO_PATTERN test regex to match new message
- Add info log when checking local consistency with last validated data
@renatav renatav requested review from n-dusan and sale3 April 10, 2026 16:23
renatav added 2 commits April 15, 2026 19:31
…rce is set

When local repos don't match last_validated_data and the updater is called
with --force, attempt a reset to LVC before proceeding. If reset fails
(e.g. LVC commit not in local repo or not on default branch), fall through
to full validation which recovers the state on its own.

Also fixes _perform_checks to always fail when the auth commit is not on
the default branch, rather than attempting a reset_to_commit that would
never succeed.
@renatav renatav merged commit a52efba into master Apr 20, 2026
8 checks passed
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.

Updater pipeline adjustment

3 participants