Skip to content

Default to auto-merge and update-branch on new repos#9

Merged
brycelelbach merged 1 commit into
brycelelbach:mainfrom
robobryce:issue-4-auto-merge
Apr 30, 2026
Merged

Default to auto-merge and update-branch on new repos#9
brycelelbach merged 1 commit into
brycelelbach:mainfrom
robobryce:issue-4-auto-merge

Conversation

@robobryce

Copy link
Copy Markdown

Summary

  • Adds two defaults to both git-create and git-fork repo 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.
  • Both are overridable via [repo] in ~/.agitentic.

Fixes #4.

Test plan

  • bash -n on both scripts
  • shellcheck -x on both scripts
  • Manual: create a scratch repo with git-create, confirm gh repo view --json autoMergeAllowed,allowUpdateBranch shows true.

Note: this PR still duplicates the settings block across both scripts. If #6 lands first, this will rebase cleanly to a single edit in lib/repo-settings.sh.

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.
@robobryce robobryce force-pushed the issue-4-auto-merge branch from 9c22e7a to bde33dd Compare April 30, 2026 05:48
@brycelelbach brycelelbach merged commit 5e694fa into brycelelbach:main Apr 30, 2026
1 check passed
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.
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.

Add "allow auto-merge" and "always suggest updating PR branches" to the default settings on repo/fork creation

2 participants