beads/cmd/bd/setup
Jim Wordelman fae194f6e3
test(dolt): add TestNoPushSkipsDoltPush for push guard coverage (#4323)
* feat(no-push): guard dolt push/pull and strip push from rendered templates

- bd dolt push/pull skip silently (exit 0) when no-push: true in config
- RenderOpts gains NoPush bool; !HasRemote || NoPush strips bd dolt push
- NoPush propagated through AgentsFileParams, fs_adapters, init, setup/agents, init_proxied_server

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(no-push): anchor stripDoltPushReferences to prevent 4-space indent false match

Without the newline anchor, ReplaceAll matched any line containing "   bd
dolt push\n" as a substring — including 4-space indented code blocks that
happen to share the prefix. Pad body with newlines so the match is anchored
to the start of the line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(no-push): remove pull guard from bd dolt pull (be-ve2x6)

no-push means "do not publish local state to the remote"; it must not
prevent receiving remote updates. The guard at dolt.go:330 made
bd dolt pull return success without contacting the remote when
no-push: true, leaving contributor clones stale.

Remove the pull guard. Add TestNoPushDoesNotSkipDoltPull to prevent
reintroduction: injects a minimal fake store and asserts Pull() is
called even under no-push: true.

Push guard (dolt.go:257) and template stripping (render.go:217)
are unchanged — both are correct behavior per maphew's review of #4212.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(dolt): add TestNoPushSkipsDoltPush for push guard coverage (be-i9e2)

Direct unit test for the no-push guard at cmd/bd/dolt.go:247-249.
Asserts Push() is not called and output contains "skipping push"
when BD_NO_PUSH=true. Mirrors TestNoPushDoesNotSkipDoltPull pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: release gate PASS for be-i9e2 (no-push dolt push test)

* test(dolt): fix minimalPullStore for current main (ListRemotes drift)

Rebasing #4323 onto current main surfaced a latent defect hidden by cached
green checks: main now routes bd dolt pull failure handling through
isConfirmedNoRemote, which calls st.ListRemotes during error classification
(cmd/bd/dolt.go). minimalPullStore embeds a nil storage.DoltStorage and
overrode only Pull, so TestNoPushDoesNotSkipDoltPull nil-panicked once merged
into current main.

Add a ListRemotes that reports no remotes, keeping the simulated pull failure
on the benign no-remote path (clean exit) so the test still proves the no-push
guard does not short-circuit bd dolt pull. Same fix quad341 applied on #4212.

Verified against current main: TestNoPushSkipsDoltPush, TestNoPushDoesNotSkipDoltPull,
TestIsConfirmedNoRemote, TestDoltPushPullCommitNeedStore all pass.

Agent-Signature: claude-opus-4-8-high on behalf of maphew

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-06-20 13:23:40 -07:00
..
agent_skill.go cleanup: remove unused private helpers (#4205) 2026-05-27 17:53:16 -07:00
agents.go test(dolt): add TestNoPushSkipsDoltPush for push guard coverage (#4323) 2026-06-20 13:23:40 -07:00
agents_marker_test.go fix(setup): clarify symlinked agents skip 2026-05-27 12:51:57 -07:00
aider.go fix: replace stale 'bd sync' references with bd dolt push/commit (GH#2435) 2026-03-07 17:00:19 +01:00
aider_test.go fix: replace stale 'bd sync' references with bd dolt push/commit (GH#2435) 2026-03-07 17:00:19 +01:00
claude.go fix(setup): match beads plugin name exactly, not by substring (#4252) 2026-06-16 08:50:41 -07:00
claude_test.go fix(setup): match beads plugin name exactly, not by substring (#4252) 2026-06-16 08:50:41 -07:00
codex.go fix(setup): match beads plugin name exactly, not by substring (#4252) 2026-06-16 08:50:41 -07:00
codex_test.go fix(setup): match beads plugin name exactly, not by substring (#4252) 2026-06-16 08:50:41 -07:00
constants.go feat: add context optimization features for AI agents (#297) 2025-11-12 10:48:36 -08:00
cursor.go fix(init): use git origin as default Dolt remote (#3909) 2026-05-13 07:02:39 -07:00
cursor_test.go fix(setup): add alwaysApply frontmatter to Cursor rules template (GH#3191) (#3193) 2026-04-20 17:40:28 -07:00
exit.go refactor: standardize error handling with FatalError wrappers (bd-qioh) 2026-02-21 16:27:09 -08:00
factory.go feat: explicit profile:full on all AGENTS.md integrations (#2139, task 4) 2026-03-15 15:02:52 -07:00
factory_test.go feat(setup): omit bd dolt push from template when no remote configured 2026-04-27 17:37:42 -04:00
gemini.go fix(setup): finish hook JSON migration 2026-05-08 09:21:39 -07:00
gemini_test.go fix(setup): finish hook JSON migration 2026-05-08 09:21:39 -07:00
junie.go fix: replace stale 'bd sync' references with bd dolt push/commit (GH#2435) 2026-03-07 17:00:19 +01:00
junie_test.go fix: replace stale 'bd sync' references with bd dolt push/commit (GH#2435) 2026-03-07 17:00:19 +01:00
mux.go fix(setup): harden symlink follow-up handling 2026-05-27 13:32:00 -07:00
mux_test.go fix(setup): harden symlink follow-up handling 2026-05-27 13:32:00 -07:00
opencode.go feat: explicit profile:full on all AGENTS.md integrations (#2139, task 4) 2026-03-15 15:02:52 -07:00
opencode_test.go feat: add OpenCode recipe to bd setup 2026-03-03 13:39:56 -07:00
plugin_layout_test.go fix(codex): correct hook path to resolve from plugin root (#4377) 2026-06-16 07:51:16 -07:00
setup_test_helpers.go feat(setup): omit bd dolt push from template when no remote configured 2026-04-27 17:37:42 -04:00
utils.go fix(setup): harden symlink follow-up handling 2026-05-27 13:32:00 -07:00
utils_test.go fix(setup): harden symlink follow-up handling 2026-05-27 13:32:00 -07:00