Skip to content

feat: flag unpushed commits in the workspace commit range#604

Merged
mariusvniekerk merged 3 commits into
mainfrom
t3code/workspace-push-status
Jun 28, 2026
Merged

feat: flag unpushed commits in the workspace commit range#604
mariusvniekerk merged 3 commits into
mainfrom
t3code/workspace-push-status

Conversation

@mariusvniekerk

@mariusvniekerk mariusvniekerk commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

The workspace Compare → Commit range list now indicates which commits have not been pushed yet, so you can tell at a glance what still needs pushing before it lands on the remote or PR.

  • Commits that aren't yet on the branch's upstream tracking ref show an amber "not pushed" dot in the commit-range popover.
  • A branch with no upstream shows all of its commits as unpushed; pull request commit lists are unaffected.

unpushed-commits.png

generated by a clanker

@roborev-ci

roborev-ci Bot commented Jun 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (31c583b)

Medium issue found; no Critical or High findings.

Medium

  • internal/server/huma_routes.go:5503 - hasUpstream == false marks every commit as pushed=false. Fork PR workspaces are created from fetched PR head refs without an upstream, so existing remote PR commits will be incorrectly shown as “Not pushed to remote” before the user makes any local commits.

    Fix: Omit pushed when no upstream is configured unless the workspace can prove the commits are local-only, or compare fork PR workspaces against the fetched MR/PR head ref and add e2e coverage for that case.


Panel: ci_default_security | Synthesis: codex, 6s | Members: codex_default (codex/default, done, 4m10s), codex_security (codex/security, done, 59s) | Total: 5m15s

mariusvniekerk and others added 2 commits June 28, 2026 11:26
The workspace Compare commit-range list gave no sign of which commits were
local-only, so a maintainer could not tell which commits still needed pushing
before they would appear on the remote or PR. Divergence tracking already
compares the worktree against @{upstream}, but only as an aggregate ahead/behind
count; the per-commit list carried no push status.

The workspace commits endpoint now annotates each commit with whether it is
reachable from the branch's upstream, derived from a single rev-list of
@{upstream}..HEAD and gated by the same git subprocess limiter the divergence
probe uses. A branch with no upstream has pushed nothing, so every commit is
treated as unpushed; a probe failure degrades to omitting the flag rather than
failing the whole list. Pull request commit lists are unaffected because push
status is omitted when unknown. The commit picker marks unpushed rows with an
amber dot.

Validation: go test ./internal/workspace -shuffle=on; go test
./internal/server/workspacetest -run TestWorkspaceCommitsFlagsUnpushedCommitsE2E
-shuffle=on; go build ./...; ui-package-typecheck (svelte-check 0 errors/0
warnings); full frontend unit suite (vp test run --project unit) 2673 passed.

Generated with Claude Code (Opus 4.8)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The initial cut treated a missing upstream as "everything unpushed," but
workspaces created from fork pull request heads have no upstream while their
commits already exist on the fork's remote. That marked already-pushed PR
commits as "Not pushed to remote" -- a false signal roborev flagged. Push
status is now omitted (left unknown) when the branch has no upstream tracking
ref, mirroring how the divergence probe withholds ahead/behind counts in the
same state; the dot only appears for branches where pushed-vs-unpushed is
actually determinable.

The new tests predated main's switch from the aliased `Assert` testify import
to the lowercase `assert` package, so they broke the build once rebased onto
current main; they now follow the lowercase convention. The Go API client is
regenerated against current main.

Validation: go test ./internal/workspace -run
'TestWorktreeUnpushedSHAs|TestWorktreeDivergence' -shuffle=on; go test
./internal/server/workspacetest -run TestWorkspaceCommitsFlagsUnpushedCommitsE2E
-shuffle=on; go build ./...; full frontend unit suite (vp test run --project
unit) 2683 passed.

Generated with Claude Code (Opus 4.8)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mariusvniekerk mariusvniekerk force-pushed the t3code/workspace-push-status branch from 31c583b to 15b49f9 Compare June 28, 2026 15:36
The no-upstream branch of getWorkspaceCommits (omit `pushed` rather than mark
every commit unpushed) had only unit coverage of the git helper returning
ok=false, so the API-visible behavior could regress back to a false "Not pushed
to remote" without a full-stack failure -- roborev flagged the gap. This adds an
internal/server/workspacetest e2e case that drops a ready workspace's upstream
and asserts GetWorkspaceCommits returns every commit with `pushed` omitted,
complementing the existing has-upstream case.

Validation: go test ./internal/server/workspacetest -run
'TestWorkspaceCommitsOmitsPushStatusWithoutUpstreamE2E|TestWorkspaceCommitsFlagsUnpushedCommitsE2E'
-shuffle=on.

Generated with Claude Code (Opus 4.8)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Jun 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (15b49f9)

Medium-risk test coverage gap remains.

Medium

  • internal/server/huma_routes.go:5505 - The no-upstream API behavior is not covered by a full-stack/e2e test. The added e2e only covers an upstream-configured workspace; the no-upstream case is only tested at the helper level, so the handler could regress and still serialize pushed when it should be omitted. Add an e2e/API test that creates or mutates a workspace branch with no upstream, calls /api/v1/workspaces/{id}/commits, and asserts pushed is absent.

Panel: ci_default_security | Synthesis: codex, 11s | Members: codex_default (codex/default, done, 5m25s), codex_security (codex/security, done, 1m2s) | Total: 6m38s

@roborev-ci

roborev-ci Bot commented Jun 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (5cd9199)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 4m31s), codex_security (codex/security, done, 16s) | Total: 4m47s

@mariusvniekerk mariusvniekerk merged commit 5443c2c into main Jun 28, 2026
17 checks passed
@mariusvniekerk mariusvniekerk deleted the t3code/workspace-push-status branch June 28, 2026 15:56
Technophobe01 added a commit to Technophobe01/middleman that referenced this pull request Jun 28, 2026
…ker-image

* upstream/main: (24 commits)
  fix(deps): update javascript dependencies (kenn-io#603)
  feat: flag unpushed commits in the workspace commit range (kenn-io#604)
  fix(deps): update go dependencies (kenn-io#602)
  fix: match diff patches by file path (kenn-io#601)
  feat: launch Kata task workspaces (kenn-io#598)
  fix: scope GitHub App tokens by owner (kenn-io#597)
  fix: lazy-load markdown fence highlighting (kenn-io#599)
  fix: reduce active PR refresh budget spend (kenn-io#595)
  Fix reviews repo picker outside-click dismissal (kenn-io#596)
  Fix repo browser directory selection (kenn-io#593)
  Resize repo browser rails (kenn-io#592)
  fix: make repo browser refs searchable (kenn-io#594)
  feat: add repo browser entry points (kenn-io#584)
  feat: add repo browser source view (kenn-io#583)
  feat: add repo browser UI state boundary (kenn-io#582)
  feat: add repo source browser API (kenn-io#581)
  docs: define repo source browser (kenn-io#580)
  feat: keep recently active PRs fresh (kenn-io#590)
  Require provider-qualified repository identity (kenn-io#587)
  fix: start notification loops immediately (kenn-io#576)
  ...
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.

1 participant