feat(deploy): diff a deployment against the previous deploy of its target #83

Merged
gmackie merged 1 commit from feat/deploy-diff into main 2026-07-12 16:25:00 +00:00
Owner

Implements the Deploy Diff roadmap item (TODOS.md P3). The existing View-diff button showed the changeset's own cached diff; it now shows what actually changed in this deploy: previous deploy SHA → current deploy SHA via the git server compare endpoint, with graceful fallbacks (first deploy, redeploy, cross-repo, git-server error) and honest labeling.

🤖 Generated with Claude Code

Implements the Deploy Diff roadmap item (TODOS.md P3). The existing View-diff button showed the changeset's own cached diff; it now shows what actually changed in this deploy: previous deploy SHA → current deploy SHA via the git server compare endpoint, with graceful fallbacks (first deploy, redeploy, cross-repo, git-server error) and honest labeling. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(deploy): diff a deployment against the previous deploy of its target
All checks were successful
CI / ci (pull_request) Successful in 5m15s
f4c81b4200
deployment.diffByDeployment previously returned the changeset's own cached
diff — not what changed in this deploy. It now finds the previous deployment
of the same (app, stage, target, service) that reached a node and compares
prev.headSha...current.headSha through the git server's compare endpoint,
reusing parseUnifiedDiff for rendering.

- Extracted the git API client from repo-content into lib/git-server.ts
  (shared gitApiFetch + typed compareRefs).
- Fallback ladder: first deploy / missing SHA / cross-repo / git-server
  error all degrade to the cached changeset diff with a machine-readable
  fallbackReason; same-SHA redeploys short-circuit without a git call.
- UI: compare header (baseSha…headSha vs previous deploy), honest
  'changeset diff' label on fallback, first-deploy/redeploy empty states,
  truncated-file placeholder; diff button no longer requires a changeset.
- 7 new tests cover compare, redeploy short-circuit, first-deploy, failed
  deploys excluded from base selection, git-error fallback, truncated
  files, and authz.

Typecheck 9/9, api 605 tests, web 435 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gmackie deleted branch feat/deploy-diff 2026-07-12 16:25:00 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/ForgeGraph!83
No description provided.