Default to auto-merge and update-branch on new repos#9
Merged
Conversation
Adds two defaults to git-create and git-fork repo settings: - enable-auto-merge=true — lets contributors queue an auto-merge that fires when checks pass and review is satisfied. - allow-update-branch=true — GitHub prompts to update a PR branch that's behind its base, so merges land against current main. Both are overridable via [repo] in ~/.agitentic. Fixes brycelelbach#4.
9c22e7a to
bde33dd
Compare
robobryce
pushed a commit
to robobryce/agitentic
that referenced
this pull request
Apr 30, 2026
…g validation After PR#7 (--prune), brycelelbach#9 (auto-merge / update-branch defaults), and brycelelbach#10 (dependabot + CodeQL security endpoints) landed, the test suite was silently under-covering the new code paths. Fix the gaps and audit for the rest. Stub: - tests/stubs/gh now handles `gh api --silent --method <V> /path [-f k=v ...]` as a logged no-op. A new STUB_GH_API_FAIL env var makes the stub fail for any api path containing a given substring, letting tests exercise the `|| echo warning` branch in security-settings. New test cases: - git-create: asserts all three security endpoints are called with the expected paths; honours [security] overrides in ~/.agitentic; tolerates a failing endpoint without failing the run. - git-fork: asserts all three security endpoints are called against the fork slug; short-circuit path asserts no security calls either. - git-sync: already-synced no-op; refuses divergent commits without --force; --force resets and force-pushes to fork. - arg-validation: git-create rejects no-args and empty <name>; git-fork and git-clone reject no-args. Also extends the "default repo settings" assertions to cover the two PR#9 keys (enable-auto-merge, allow-update-branch), and drops the now-unnecessary --prune soft-skip since PR#7 is on main. Suite is 39/39 green.
brycelelbach
added a commit
that referenced
this pull request
Apr 30, 2026
…g validation After PR#7 (--prune), #9 (auto-merge / update-branch defaults), and #10 (dependabot + CodeQL security endpoints) landed, the test suite was silently under-covering the new code paths. Fix the gaps and audit for the rest. Stub: - tests/stubs/gh now handles `gh api --silent --method <V> /path [-f k=v ...]` as a logged no-op. A new STUB_GH_API_FAIL env var makes the stub fail for any api path containing a given substring, letting tests exercise the `|| echo warning` branch in security-settings. New test cases: - git-create: asserts all three security endpoints are called with the expected paths; honours [security] overrides in ~/.agitentic; tolerates a failing endpoint without failing the run. - git-fork: asserts all three security endpoints are called against the fork slug; short-circuit path asserts no security calls either. - git-sync: already-synced no-op; refuses divergent commits without --force; --force resets and force-pushes to fork. - arg-validation: git-create rejects no-args and empty <name>; git-fork and git-clone reject no-args. Also extends the "default repo settings" assertions to cover the two PR#9 keys (enable-auto-merge, allow-update-branch), and drops the now-unnecessary --prune soft-skip since PR#7 is on main. Suite is 39/39 green.
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.
Summary
git-createandgit-forkrepo settings:enable-auto-merge=true— lets contributors queue an auto-merge that fires once checks pass and review is satisfied.allow-update-branch=true— GitHub prompts to update a PR branch that's behind its base, so merges land against current main.[repo]in~/.agitentic.Fixes #4.
Test plan
bash -non both scriptsshellcheck -xon both scriptsgit-create, confirmgh repo view --json autoMergeAllowed,allowUpdateBranchshowstrue.