Add merge-to-master / cut-release actions to Branches & Releases - #92
Merged
Conversation
Fixes #78. The backend endpoints (POST /api/branches/<id>/merge, POST /api/releases) already existed and were fully tested -- an earlier PR deliberately scoped viewer wiring out ("those stay curl/CI-only for now"). This wires them in: a "Merge to master" button per branch row, and an inline "Cut release" input+button in the Releases section. No confirm dialogs, matching every other write action already in this app (bulk approve, delete category, delete mask all fire immediately with an error banner on failure). All branch rows' merge buttons disable together while any merge is in flight (mergingBranch !== null, not per-row) -- load-bearing, not cosmetic: the app has only ever had one action button per view before this, so a shared result-state slot needs a genuine one-at-a-time invariant to stay race-free with several branches listed side by side. Design went through two rounds of architect SOLID review (first CONCERNS -- caught this exact race plus a missing clear-state-first convention -- then SOUND after revision), and the build went through propose-review (proposer -> plan-reviewer, one REVISE round to force an explicit fresh snapshot name in the e2e merge test rather than an ambiguous one -> implementer + test-author -> code-reviewer), with independent APPROVE verdicts at each gate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4
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.
Fixes #78.
Summary
POST /api/branches/<id>/merge,POST /api/releases) already existed and were already fully tested/documented — an earlier PR deliberately scoped viewer wiring out ("those stay curl/CI-only for now"). This PR wires them in: a "Merge to master" button per branch row, and an inline "Cut release" text-input + button in the Releases section.mergingBranch !== null, not per-row) while any merge is in flight. The Branches section lists several branches side by side — unlike every prior write action in this app, which only ever has one button in its whole view — so a shared result-state slot needs a genuine one-at-a-time invariant to stay race-free.Process
variantstate, and made the test's pass/fail assertion non-vacuous only by accident) → implementer + test-author → code-reviewer, with independent APPROVE verdicts at every gate.Test plan
npm test -w viewer— 61/61 passed, including a concurrency test proving a second, unclicked branch's button also disables while another branch's merge is in flight (would fail against a buggy per-row-only disable)npm run lint -w viewer— cleannpm run lint -w examples/demo-app— cleannpm run test:e2e -w examples/demo-app— 19/19 passed (2 new): the merge test uses a genuinely fresh (name, viewport) key with no prior master baseline, so its final assertion (a brand-new unscoped run's first-time processing status) is only reachable if the merge actually copied bytes to master — confirmed non-vacuous by readingrender.py'sprocess_pending/scoped_baseline_read_pathand by a before/after check (both new tests fail without the fix, pass with it)backend/.venv/bin/pytest backend/tests -q— 145 passed, zero backend files touched (no backend changes in this PR)viewer/CODEMAP.md,examples/demo-app/CODEMAP.mdupdated🤖 Generated with Claude Code
https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4