Skip to content

Enable automatic push for manual commits, simplify automatic push for assisted commits - #23135

Merged
sergiou87 merged 7 commits into
developmentfrom
sergiou87-manual-commit-auto-push
Nov 10, 2026
Merged

sergiou87 merged 7 commits into
developmentfrom
sergiou87-manual-commit-auto-push

Conversation

@sergiou87

@sergiou87 sergiou87 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Relates to the historical request in #2256; no automatic issue closure.

Description

Make Push after committing available for ordinary manual commits, using one repository preference shared with Copilot-assisted commits. The automatic push for assisted commits has been simplified to just push (using Desktop's logic). A lot of extra steps around the automatic push have been removed after considered unnecessary.

Renamed assisted-commit-push-<repository ID> boolean to automatic-commit-push-<repository ID> and share it for both manual and assisted commits.

Validation

Evidence covers HEAD aaf76d7026e641ce88bc66aa0b2c5da1cc0331e1, tree 903f0d29c229661ab2def957b64063edaabe942c. Independent branch based on development commit f3ad3413a6d533fb179744c98805e6b0879021b4; no animation/performance-stack dependency.

Command Observed result
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all npm test Passed: 3,381 passed, 2 skipped, 0 failed. Includes core capture/executor, selected-only planning, authorization, clone/worktree, recovery and UI suites.
npm test -- app/test/unit/git/push-test.ts app/test/unit/git/rev-parse-test.ts Four known host-baseline failures with safe.bareRepository=explicit, also reproduced on untouched pinned base sources. The full-suite workaround above is process-only; no persistent Git setting or test assertion was weakened.
npm test -- app/test/unit/stores/assisted-commit-push-hooks-test.ts Passed: 8 cases exercising actual native pre-commit/pre-push abort/ignore behavior across Manual and Copilot.
npm run lint:fix Passed.
npm run lint Passed.
npx tsc --noEmit Passed with the repository's plain strict configuration.
npm run test:e2e:build:unpackaged Passed for final production output after removing temporary fixtures.
DESKTOP_E2E_APP_MODE=unpackaged npx playwright test --config app/test/e2e/playwright.config.ts app/test/e2e/ordinary-auto-push.e2e.ts Passed, 12.8 s: real Electron Manual and assisted success, receiver rejection/ordinary retry without another commit, and assisted pre-accept cancellation. Fresh isolated home/profile and real local bare remote. Assisted portion used empty commits with temporary synthetic account eligibility/runtime and a renderer test bridge: no model request, live credentials or billing.
DESKTOP_E2E_APP_MODE=unpackaged npx playwright test --config app/test/e2e/playwright.config.ts app/test/e2e/ordinary-manual-final.e2e.ts Passed, 7.4 s: final fixture-free production app, Manual success/rejection/ordinary retry with no extra commit.
  • Manual validation

Screenshots

Screen.Recording.2026-11-10.at.11.27.44.mov
Screen.Recording.2026-11-10.at.11.29.10.mov

Team-authored review

Evidence: Validation and local screenshot/recording coverage and attachment gap.

Review path: Light review. Mostly unnecessary steps were removed from the auto-push process. Automatic testing, manual testing and adversarial reviews with multiple models performed.

Release notes

Notes: [Added] Automatically push after a commit

Copilot AI balanced review requested due to automatic review settings November 6, 2026 12:46
@sergiou87 sergiou87 added the needs-deep-review Requires in-depth human code review of affected paths; agent review is not sufficient. label Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A checkout race can cause automatic publication to push the wrong branch because the branch selected for pushing is not validated against the originating branch.

3 open issues
What changed in this PR

This PR extends Push after committing to manual commits, addressing the workflow requested in #2256. Manual and Copilot-assisted commits share one repository preference and use Desktop’s ordinary Push backend after local completion.

Changes:

  • Share the existing saved opt-in across both commit modes.
  • Replace assisted-specific publication and retry machinery with ordinary Push, while retaining fenced local acceptance and rollback before acceptance.
  • Update tests, UI states and technical documentation for the new publication boundary.
File Description
docs/​technical/​assisted-commit-transactions.md Documents local acceptance before ordinary Push.
docs/​technical/​assisted-commit-runs.md Explains shared preferences, handoff and retired guarantees.
app/​test/​unit/​ui/​copilot-commit-panel-test.tsx Removes assisted-specific push-state tests.
app/​test/​unit/​ui/​commit-push-error-test.tsx Tests ordinary Retry push UI.
app/​test/​unit/​ui/​commit-message-test.tsx Tests the shared checkbox across modes.
app/​test/​unit/​ui/​assisted-commit-history-test.tsx Removes obsolete publication-lock states.
app/​test/​unit/​ui/​assisted-commit-details-test.tsx Limits assisted details coverage to local errors.
app/​test/​unit/​stores/​commit-auto-push-test.ts Adds shared auto-push integration coverage.
app/​test/​unit/​stores/​assisted-commit-push-lifecycle-test.ts Deletes retired publication-lifecycle tests.
app/​test/​unit/​stores/​assisted-commit-push-hooks-test.ts Tests native hook behavior in both modes.
app/​test/​unit/​stores/​assisted-commit-preview-test.ts Removes obsolete push-state admission cases.
app/​test/​unit/​git/​file-version-fence-test.ts Deletes publication-certificate tests.
app/​test/​unit/​git/​fetch-test.ts Retains ordinary submodule-fetch coverage.
app/​test/​unit/​git/​assisted-commit-push-destination-test.ts Deletes frozen-destination tests.
app/​test/​unit/​git/​assisted-commit-completion-test.ts Refocuses safety checks on local acceptance.
app/​test/​unit/​assisted-commit-push-storage-test.ts Tests shared persistence and placeholder isolation.
app/​test/​unit/​assisted-commit-coordinator-test.ts Removes publication methods from the test host.
app/​test/​helpers/​changes-state-helper.ts Uses the shared preference field.
app/​src/​ui/​dispatcher/​dispatcher.ts Renames the preference setter and removes assisted push retry.
app/​src/​ui/​changes/​sidebar.tsx Passes the shared preference through the sidebar.
app/​src/​ui/​changes/​filter-changes-list.tsx Connects shared options and removes assisted retry wiring.
app/​src/​ui/​changes/​copilot-commit-panel.tsx Removes publication progress and retry presentation.
app/​src/​ui/​changes/​commit-message.tsx Offers auto-push in both commit modes.
app/​src/​ui/​app-error.tsx Adds an ordinary Retry push footer.
app/​src/​models/​assisted-commit-run.ts Removes publication states and outcomes.
app/​src/​lib/​stores/​repository-state-cache.ts Caches the shared repository preference.
app/​src/​lib/​stores/​helpers/​commit-push-storage.ts Preserves the historical key with placeholder guards.
app/​src/​lib/​stores/​helpers/​assisted-commit-push-storage.ts Removes the assisted-only storage helper.
app/​src/​lib/​stores/​git-store.ts Removes assisted-specific fetch recursion options.
app/​src/​lib/​stores/​app-store.ts Adds shared handoff and simplifies ordinary publication.
app/​src/​lib/​git/​push.ts Removes frozen assisted-push options.
app/​src/​lib/​git/​file-version-fence.ts Deletes publication file-certification machinery.
app/​src/​lib/​git/​fetch.ts Restores ordinary fetch recursion behavior.
app/​src/​lib/​git/​core.ts Removes the publication spawn-preparation callback.
app/​src/​lib/​git/​assisted-commit/​execute.ts Removes push-entry acceptance machinery.
app/​src/​lib/​assisted-commit/​types.ts Removes publication contracts and retained state.
app/​src/​lib/​assisted-commit/​state.ts Simplifies local error and resource ownership state.
app/​src/​lib/​assisted-commit/​recovery.ts Removes publication recovery responsibilities.
app/​src/​lib/​assisted-commit/​readers.ts Removes retained publication-owner fences.
app/​src/​lib/​assisted-commit/​push.ts Deletes the assisted publication coordinator.
app/​src/​lib/​assisted-commit/​push-ownership.ts Deletes retained publication-owner helpers.
app/​src/​lib/​assisted-commit/​execution.ts Removes destination discovery from local execution.
app/​src/​lib/​assisted-commit/​coordinator.ts Always completes through verified local acceptance.
app/​src/​lib/​assisted-commit/​context.ts Removes push-only authorization checks.
app/​src/​lib/​app-state.ts Defines the shared pushAfterCommit preference.

Review effort: Balanced

Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/stores/app-store.ts Resolved
@sergiou87 sergiou87 changed the title Share automatic push across manual and assisted commits using ordinary Push Enable automatic push for manual commits, simplify automatic push for assisted commits Nov 6, 2026
sergiou87 added a commit that referenced this pull request Nov 6, 2026
Address review finding F1 for PR #23135. Automatic publication checked the returned status snapshot but selected its branch from a mutable cache. An overlapping status refresh could replace that cache and hand an unrelated branch to Push.

Require the exact cached branch ref to match the originating ref before handing it to ordinary Push. Preserve accepted local commits and existing refresh guidance on mismatch. Add Manual and Copilot regression cases that replace the cached branch after the checked status was captured.

Validation: both focused cached-branch regression cases passed; npm run lint:fix and git diff --check passed. The regression cases failed before the branch guard was added. No publication destination or ordinary Push semantics changed.
sergiou87 added a commit that referenced this pull request Nov 6, 2026
Address review finding F2 for PR #23135. The new automatic Push wait extended the manual commit promise beyond local success, after the editing lock had been released. Its delayed success callback could erase a newer draft or let the old message be saved again during navigation.

Start automatic publication without awaiting it in the local commit result, and route unexpected publication failures to the ordinary repository error UI. Preserve the existing branch handoff and Push retry behavior. Update publication tests to await their network work explicitly, and document the completion boundary.

Add a real CommitMessage/AppStore regression test proving that the consumed summary and description clear while Push remains pending and that newer edits survive its completion. This test failed before the fix. Validation: 118 focused store, hook, and UI tests passed; npm run lint:fix, npx tsc --noEmit, and git diff --check passed.
sergiou87 added a commit that referenced this pull request Nov 6, 2026
Address review finding F3 for PR #23135. A manual commit could finish during an active fetch, but automatic publication silently returned from ordinary Push admission. The opted-in commit stayed local without an error or retry guidance.

Observe whether the ordinary Push callback was admitted and emit a repository-busy error with the existing Retry push action when it was not. Keep fetch and pull admission unchanged; do not queue publication or retry automatically. Add coverage holding a background fetch across a successful local commit, then retrying publication without another commit or model request.

Validation: the focused busy-publication test failed before the fix and passed afterward. npm run lint:fix, npm run lint, npx tsc --noEmit, and git diff --check passed. Plain npm test reported the four existing bare-repository fixture failures under the host's safe.bareRepository=explicit policy; the affected Git helpers and tests are unchanged.

Full combined validation: GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all npm test passed with 3,386 passed, 2 skipped, and 0 failed. This policy override was process-local; no persistent Git configuration was changed.
Share the existing repository opt-in between Manual and Copilot modes, retaining the original storage key and default-off semantics. Freeze branch, destination, exact commit and issuing account session before using Desktop's native push pipeline.

Keep local commit success independent of publication failures, with push-only and refresh-only retry in the existing error dialog. Exclude amend, tutorial and conflict/multi-commit continuations; never include pending tags or acquire history rollback authority.

Cover native local remotes, failures, retries, hooks, partial/empty commits, account continuity, repository switching and shared preference UI/persistence. Document compatibility and safety boundaries.
Use the existing fenced local acceptance for every assisted run, settle required readers and cleanup, then release transaction ownership before handing the originating repository and branch to the ordinary Push backend. Cancellation and rollback end at local acceptance.

Remove frozen push destinations, configuration/object-graph certificates, pinned-SHA publication, custom upstream locks, push-only run states and retained retry capabilities. Reuse normal authentication, hooks, tags, publication, progress and retry behavior. Preserve the shared opt-in and explicit history-rewrite/tutorial exclusions.

Replace retired contract-specific suites with native user journeys covering local retention, ordinary retry, branch/repository handoff, cancellation, cleanup, pending tags and statistics; retain independent local transaction guards and document intentionally changed semantics.
Load ordinary remote state before the last native branch check, so a branch switch during that await prevents automatic publication. Cover this post-accept gap in both modes and retain explicit local selected-path symlink rejection under the normal fenced acceptance API.

Align native acceptance comments with the new cancellation boundary. Real Electron validation covers manual and assisted publication, receiver failure and ordinary retry, and pre-accept cancellation; temporary fixtures remain outside the committed tree.
Store and read only automatic-commit-push-<repository ID>. The assisted-only preference was unreleased, so do not read or migrate it. Preserve default-off behavior, repository-ID sharing, path-separated run state and placeholder isolation.

Update storage tests and documentation to remove legacy opt-in compatibility claims.
Address review finding F1 for PR #23135. Automatic publication checked the returned status snapshot but selected its branch from a mutable cache. An overlapping status refresh could replace that cache and hand an unrelated branch to Push.

Require the exact cached branch ref to match the originating ref before handing it to ordinary Push. Preserve accepted local commits and existing refresh guidance on mismatch. Add Manual and Copilot regression cases that replace the cached branch after the checked status was captured.

Validation: both focused cached-branch regression cases passed; npm run lint:fix and git diff --check passed. The regression cases failed before the branch guard was added. No publication destination or ordinary Push semantics changed.
Address review finding F2 for PR #23135. The new automatic Push wait extended the manual commit promise beyond local success, after the editing lock had been released. Its delayed success callback could erase a newer draft or let the old message be saved again during navigation.

Start automatic publication without awaiting it in the local commit result, and route unexpected publication failures to the ordinary repository error UI. Preserve the existing branch handoff and Push retry behavior. Update publication tests to await their network work explicitly, and document the completion boundary.

Add a real CommitMessage/AppStore regression test proving that the consumed summary and description clear while Push remains pending and that newer edits survive its completion. This test failed before the fix. Validation: 118 focused store, hook, and UI tests passed; npm run lint:fix, npx tsc --noEmit, and git diff --check passed.
Address review finding F3 for PR #23135. A manual commit could finish during an active fetch, but automatic publication silently returned from ordinary Push admission. The opted-in commit stayed local without an error or retry guidance.

Observe whether the ordinary Push callback was admitted and emit a repository-busy error with the existing Retry push action when it was not. Keep fetch and pull admission unchanged; do not queue publication or retry automatically. Add coverage holding a background fetch across a successful local commit, then retrying publication without another commit or model request.

Validation: the focused busy-publication test failed before the fix and passed afterward. npm run lint:fix, npm run lint, npx tsc --noEmit, and git diff --check passed. Plain npm test reported the four existing bare-repository fixture failures under the host's safe.bareRepository=explicit policy; the affected Git helpers and tests are unchanged.

Full combined validation: GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all npm test passed with 3,386 passed, 2 skipped, and 0 failed. This policy override was process-local; no persistent Git configuration was changed.
@sergiou87
sergiou87 force-pushed the sergiou87-manual-commit-auto-push branch from 9d40429 to 3ee7a68 Compare November 6, 2026 15:26
@sergiou87
sergiou87 marked this pull request as ready for review November 10, 2026 10:32
@sergiou87
sergiou87 requested a review from a team as a code owner November 10, 2026 10:32
@sergiou87
sergiou87 requested a review from niik November 10, 2026 10:32
@sergiou87 sergiou87 removed the needs-deep-review Requires in-depth human code review of affected paths; agent review is not sufficient. label Nov 10, 2026

@niik niik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it. I think if it's not a huge lift it would be nice if we were clever about displaying the undo commit box when this option is on. In the optimal case it'll just slide in and out and never be enabled

@sergiou87
sergiou87 merged commit 0acbf14 into development Nov 10, 2026
23 checks passed
@sergiou87
sergiou87 deleted the sergiou87-manual-commit-auto-push branch November 10, 2026 10:56
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.

3 participants