Skip to content

refactor: drop auto-detection of stacked PRs / local stacks#478

Merged
tomasz-tomczyk merged 1 commit intomainfrom
remove-auto-stack-detection
May 7, 2026
Merged

refactor: drop auto-detection of stacked PRs / local stacks#478
tomasz-tomczyk merged 1 commit intomainfrom
remove-auto-stack-detection

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Plain crit no longer auto-promotes into range mode based on branch graph inspection. Stack review is now opt-in via --pr <num|url> or --range <baseSHA>..<headSHA>.
  • Auto-detection misfired for workflows where the user branches off a long-lived parent branch (looks identical to a stacked PR from the graph). Stacking is a workflow choice, not a property of the branch graph — explicit beats magic.
  • Removes the --working-tree flag, which only existed as a bypass for the auto-promote.
  • Deletes autodetect.go / autodetect_test.go (575 lines). Shared helpers (walkAncestors, topicChainSHAs, branch-tip lookups) remain in picker.go and are untouched — the stack chip / popover UI still works when the user explicitly opts into range mode.

This is a behavior reversal of the v2 pass on #391. Agent skills already document --pr / --range, so no integration prompt changes are needed.

Review

  • Intent audit: CLEAN (575-line pure deletion, all in scope)
  • Code review: backend-only, no parity surface touched

Test plan

  • go build clean
  • gofmt -l . clean
  • go vet ./... clean
  • go test ./... passes
  • golangci-lint run ./... 0 issues

🤖 Generated with Claude Code

Auto-promotion into range mode is workflow-dependent: branching off a
long-lived parent looks identical to a stacked PR from the branch graph,
so detection misfires for non-stacking workflows. Make stack review
explicit via --pr / --range; remove the --working-tree bypass that only
existed to escape the auto-promote.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomasz-tomczyk tomasz-tomczyk merged commit af76394 into main May 7, 2026
6 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the remove-auto-stack-detection branch May 7, 2026 09:20
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.24%. Comparing base (eac616c) to head (5a8aeff).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #478      +/-   ##
==========================================
+ Coverage   69.12%   69.24%   +0.12%     
==========================================
  Files          36       35       -1     
  Lines       10736    10616     -120     
==========================================
- Hits         7421     7351      -70     
+ Misses       2752     2711      -41     
+ Partials      563      554       -9     
Flag Coverage Δ
e2e 32.35% <ø> (+0.07%) ⬆️
unit 66.93% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant