Add per-phase perf spans to checkpoint pre-push#1281
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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_settingsspan around settings load + possible one-time metadata-branch fetch during remote resolution. - Threads the parent push span context into
pushBranchIfNeededso subsequent spans nest underpush_checkpoints_branch. - Splits push/recovery work into nested spans:
git_pushper push attempt,fetch_and_rebasefor the sync recovery path, andgit_fetchwithin 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
pfleidi
approved these changes
May 27, 2026
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.
https://entire.io/gh/entireio/cli/trails/439
Break the single
push_checkpoints_branchspan into nested child spans soentire doctor trace --hook pre-pushshows where time goes during a slow checkpoint push instead of one total:git pushsubprocess, where time goes on a slow transport. Records an error flag on non-fast-forward rejection, which signals the recovery path was taken.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
perfspans around checkpoint pre-push so traces (e.g.entire doctor trace --hook pre-push) show where time is spent instead of one opaquepush_checkpoints_branchblock.PrePushnow spansresolve_push_settings(including one-time metadata-branch fetch during remote resolution) and passes span context intopushBranchIfNeededso children nest underpush_checkpoints_branch.push_common.goaddsgit_pusharound each push attempt (retries appear as a second span),fetch_and_rebasearound sync recovery, andgit_fetchinside fetch+rebase. Errors are recorded on spans where relevant. No functional change—instrumentation only.Reviewed by Cursor Bugbot for commit 5d555f9. Configure here.