Skip to content

Add per-phase perf spans to checkpoint pre-push#1281

Merged
computermode merged 3 commits into
mainfrom
hooks-slow-push-db-mirror
May 27, 2026
Merged

Add per-phase perf spans to checkpoint pre-push#1281
computermode merged 3 commits into
mainfrom
hooks-slow-push-db-mirror

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented May 27, 2026

https://entire.io/gh/entireio/cli/trails/439

Break the single push_checkpoints_branch span into nested child spans so entire doctor trace --hook pre-push shows where time goes during a slow checkpoint push instead of one total:

  • resolve_push_settings: settings load + the one-time metadata-branch fetch (fetchMetadataBranchIfMissing), otherwise invisible.
  • push_checkpoints_branch > git_push (+ git_push~1 for the retry): the actual git push subprocess, where time goes on a slow transport. Records an error flag on non-fast-forward rejection, which signals the recovery path was taken.
  • push_checkpoints_branch > fetch_and_rebase > git_fetch: the sync recovery path, splitting the network fetch from the local rebase.

Threads the push span's context through pushBranchIfNeeded so the child steps nest correctly. Instrumentation only; no behavior change.


Note

Low Risk
Observability-only changes to pre-push; no push, fetch, or rebase logic altered.

Overview
Adds nested perf spans around checkpoint pre-push so traces (e.g. entire doctor trace --hook pre-push) show where time is spent instead of one opaque push_checkpoints_branch block.

PrePush now spans resolve_push_settings (including one-time metadata-branch fetch during remote resolution) and passes span context into pushBranchIfNeeded so children nest under push_checkpoints_branch.

push_common.go adds git_push around each push attempt (retries appear as a second span), fetch_and_rebase around sync recovery, and git_fetch inside fetch+rebase. Errors are recorded on spans where relevant. No functional change—instrumentation only.

Reviewed by Cursor Bugbot for commit 5d555f9. Configure here.

Break the single coarse push_checkpoints_branch span into nested child
spans so `entire doctor trace --hook pre-push` shows where time goes
during a slow checkpoint push instead of one opaque total:

- resolve_push_settings: settings load + the one-time metadata-branch
  fetch (fetchMetadataBranchIfMissing), otherwise invisible.
- push_checkpoints_branch > git_push (+ git_push~1 for the retry): the
  actual `git push` subprocess, where time goes on a slow transport.
  Records an error flag on non-fast-forward rejection, which signals the
  recovery path was taken.
- push_checkpoints_branch > fetch_and_rebase > git_fetch: the sync
  recovery path, splitting the network fetch from the local rebase.

Threads the push span's context through pushBranchIfNeeded so the child
steps nest correctly. Instrumentation only; no behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 38edc87c06af
Copilot AI review requested due to automatic review settings May 27, 2026 20:28
@computermode computermode requested a review from a team as a code owner May 27, 2026 20:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds finer-grained perf instrumentation to the checkpoint pre-push flow so entire doctor trace --hook pre-push can attribute time to specific phases (settings/remote resolution, the actual git push attempts, and fetch+rebase recovery) rather than a single opaque span.

Changes:

  • Introduces a resolve_push_settings span around settings load + possible one-time metadata-branch fetch during remote resolution.
  • Threads the parent push span context into pushBranchIfNeeded so subsequent spans nest under push_checkpoints_branch.
  • Splits push/recovery work into nested spans: git_push per push attempt, fetch_and_rebase for the sync recovery path, and git_fetch within that path.

Reviewed changes

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

File Description
cmd/entire/cli/strategy/push_common.go Adds child perf spans for git_push, fetch_and_rebase, and git_fetch to improve trace granularity during checkpoint push and recovery.
cmd/entire/cli/strategy/manual_commit_push.go Adds a resolve_push_settings span and ensures push span context is propagated so nested push/recovery spans attach correctly.

Entire-Checkpoint: ee9c6692dece
…rror

# Conflicts:
#	cmd/entire/cli/gitrepo/alternates_fs.go
@computermode computermode merged commit f0e8816 into main May 27, 2026
9 checks passed
@computermode computermode deleted the hooks-slow-push-db-mirror branch May 27, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants