Skip to content

Commit 7063470

Browse files
authored
Merge pull request #53 from githubnext/copilot/remove-sync-branches-workflow
Remove sync-branches workflow
2 parents 7c89578 + 68aa660 commit 7063470

9 files changed

Lines changed: 8 additions & 1015 deletions

File tree

.github/workflows/autoloop.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ Examples:
283283
4. **Rejected or errored iterations** do not commit — changes are discarded.
284284
5. A **single draft PR** is created for the branch on the first accepted iteration. Future accepted iterations push additional commits to the same PR.
285285
6. The branch may be **merged into the default branch** at any time (by a maintainer or CI). After merging, the branch continues to be used for future iterations — it is never deleted while the program is active. On the next iteration, the branch is automatically reset to the default branch (see step 2) so that already-merged commits do not cause patch conflicts.
286-
7. A **sync workflow** automatically merges the default branch into all active `autoloop/*` branches whenever the default branch changes, keeping them up to date.
287286

288287
### Cross-Linking
289288

.github/workflows/sync-branches.lock.yml

Lines changed: 0 additions & 550 deletions
This file was deleted.

.github/workflows/sync-branches.md

Lines changed: 0 additions & 169 deletions
This file was deleted.

AGENTS.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ autoloop/
1111
├── AGENTS.md ← you are here
1212
├── workflows/ ← Agentic Workflow definitions
1313
│ ├── autoloop.md ← main autoloop workflow (compiled by gh-aw)
14-
│ ├── sync-branches.md ← syncs default branch into autoloop/* branches
1514
│ ├── shared/ ← shared workflow fragments
1615
│ │ └── reporting.md
1716
│ └── scripts/ ← standalone scripts invoked from steps
@@ -72,7 +71,7 @@ The workflow (`workflows/autoloop.md`) is compiled by `gh aw compile` into `.git
7271
6. Updates the program's state file in repo-memory with all state (Machine State table + research sections)
7372
7. If the program has a `target-metric` and the metric is reached, marks it as completed (removes `autoloop-program` label, adds `autoloop-completed` label for issue-based programs)
7473

75-
A companion workflow (`workflows/sync-branches.md`) runs on every push to the default branch and merges it into all active `autoloop/*` program branches, keeping them up to date.
74+
Branch freshness is handled by the iteration loop itself: each iteration's Step 3 (in `workflows/autoloop.md`, "Iteration Loop" → step "Branch Setup") fast-forwards or merges `origin/main` into the program's `autoloop/*` branch as needed. No separate sync workflow is required.
7675

7776
### Evolution Strategy
7877

@@ -134,9 +133,8 @@ Programs run on a schedule, but can also be triggered manually:
134133
To deploy the workflow to a repository:
135134

136135
1. Copy `workflows/autoloop.md` to `.github/workflows/autoloop.md` in the target repo
137-
2. Copy `workflows/sync-branches.md` to `.github/workflows/sync-branches.md` in the target repo
138-
3. Copy `workflows/shared/` to `.github/workflows/shared/` in the target repo
139-
4. Copy `workflows/scripts/` to `.github/workflows/scripts/` in the target repo
140-
5. Run `gh aw compile autoloop` and `gh aw compile sync-branches` to generate the lock files
141-
6. Copy program directories to `.autoloop/programs/` in the target repo
142-
7. Commit and push
136+
2. Copy `workflows/shared/` to `.github/workflows/shared/` in the target repo
137+
3. Copy `workflows/scripts/` to `.github/workflows/scripts/` in the target repo
138+
4. Run `gh aw compile autoloop` to generate the lock file
139+
5. Copy program directories to `.autoloop/programs/` in the target repo
140+
6. Commit and push

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ The command is handled by the `autoloop` Agentic Workflow — it is **not** a Gi
171171
autoloop/
172172
├── workflows/ ← Agentic Workflow definitions
173173
│ ├── autoloop.md ← the workflow (compiled by gh aw)
174-
│ ├── sync-branches.md ← syncs default branch into autoloop/* branches
175174
│ └── shared/
176175
│ └── reporting.md
177176
├── .autoloop/

install.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ rm -rf /tmp/autoloop
8585

8686
```bash
8787
gh aw compile autoloop
88-
gh aw compile sync-branches
8988
```
9089

91-
**What this does**: Generates `.github/workflows/autoloop.lock.yml` and `.github/workflows/sync-branches.lock.yml` from the workflow definitions.
90+
**What this does**: Generates `.github/workflows/autoloop.lock.yml` from the workflow definition.
9291

9392
## Step 5: Create a Branch, Commit, and Open a Pull Request
9493

@@ -141,7 +140,7 @@ Optionally, you may copy existing examples from the [`.autoloop/programs/`](.aut
141140

142141
### Compile fails
143142

144-
- Ensure `.github/workflows/autoloop.md` and `.github/workflows/sync-branches.md` exist
143+
- Ensure `.github/workflows/autoloop.md` exists
145144
- Ensure `.github/workflows/shared/` directory was copied
146145
- Re-run `gh aw compile autoloop` with `--verbose` for details
147146

tests/test_scheduling.py

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -685,92 +685,6 @@ def test_clone_before_scheduling(self):
685685
)
686686

687687

688-
class TestSyncBranchesCredentialOrdering:
689-
"""Verify that Git credentials are configured before the merge/push step.
690-
691-
The sync-branches workflow merges the default branch into autoloop/*
692-
branches. Merge commits require a Git identity (user.name/user.email)
693-
and pushes/fetches need an authenticated remote URL. Both must be
694-
configured before the merge step runs.
695-
"""
696-
697-
CRED_STEP = "Set up Git identity and authentication"
698-
MERGE_STEP = "Merge default branch into all autoloop program branches"
699-
700-
def _load_steps(self):
701-
"""Return the list of pre-step names from workflows/sync-branches.md."""
702-
import os
703-
704-
wf_path = os.path.join(os.path.dirname(__file__), "..", "workflows", "sync-branches.md")
705-
with open(wf_path) as f:
706-
content = f.read()
707-
step_names = []
708-
for m in re.finditer(r'^\s*-\s*name:\s*(.+)$', content, re.MULTILINE):
709-
step_names.append(m.group(1).strip())
710-
return step_names
711-
712-
def _load_lock_steps(self):
713-
"""Return the list of step names from the agent job in
714-
.github/workflows/sync-branches.lock.yml.
715-
716-
Parsed with a regex (rather than PyYAML) so the test has no
717-
external dependencies beyond pytest.
718-
"""
719-
import os
720-
721-
lock_path = os.path.join(
722-
os.path.dirname(__file__), "..", ".github", "workflows", "sync-branches.lock.yml"
723-
)
724-
with open(lock_path) as f:
725-
content = f.read()
726-
# Restrict to the 'agent:' job body so we don't pick up step names
727-
# from other jobs (e.g. 'activation').
728-
agent_match = re.search(r"^ agent:\n((?: .*\n|\n)+)", content, re.MULTILINE)
729-
if not agent_match:
730-
return []
731-
agent_body = agent_match.group(1)
732-
# Step names appear as either ' - name: <Name>' or
733-
# ' name: <Name>' (when the step starts with '- env:').
734-
step_names = []
735-
for m in re.finditer(r'^\s{6,8}(?:- )?name:\s*(.+)$', agent_body, re.MULTILINE):
736-
step_names.append(m.group(1).strip())
737-
return step_names
738-
739-
def test_cred_step_exists(self):
740-
"""A step that configures Git identity/auth must exist in the source."""
741-
steps = self._load_steps()
742-
assert self.CRED_STEP in steps, (
743-
f"Expected step '{self.CRED_STEP}' not found. Steps: {steps}"
744-
)
745-
746-
def test_creds_before_merge(self):
747-
"""The credential step must come before the merge step in the source."""
748-
steps = self._load_steps()
749-
cred_idx = steps.index(self.CRED_STEP)
750-
merge_idx = steps.index(self.MERGE_STEP)
751-
assert cred_idx < merge_idx, (
752-
f"'{self.CRED_STEP}' (index {cred_idx}) must come before "
753-
f"'{self.MERGE_STEP}' (index {merge_idx}). Steps: {steps}"
754-
)
755-
756-
def test_lock_creds_before_merge(self):
757-
"""In the compiled lock file, Configure Git credentials must come before the merge step."""
758-
steps = self._load_lock_steps()
759-
cred_names = [s for s in steps if "Configure Git credentials" in s]
760-
assert cred_names, (
761-
f"No 'Configure Git credentials' step found in lock file. Steps: {steps}"
762-
)
763-
merge_names = [s for s in steps if "Merge default branch" in s]
764-
assert merge_names, (
765-
f"No merge step found in lock file. Steps: {steps}"
766-
)
767-
cred_idx = steps.index(cred_names[0])
768-
merge_idx = steps.index(merge_names[0])
769-
assert cred_idx < merge_idx, (
770-
f"'Configure Git credentials' (index {cred_idx}) must come before "
771-
f"merge step (index {merge_idx}). Steps: {steps}"
772-
)
773-
774688

775689
# ---------------------------------------------------------------------------
776690
# Single-PR-per-program invariant: safe-outputs config + existing_pr lookup

workflows/autoloop.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ Examples:
325325
4. **Rejected or errored iterations** do not commit — changes are discarded.
326326
5. A **single draft PR** is created for the branch on the first accepted iteration. Future accepted iterations push additional commits to the same PR.
327327
6. The branch may be **merged into the default branch** at any time (by a maintainer or CI). After merging, the branch continues to be used for future iterations — it is never deleted while the program is active. On the next iteration, the branch is automatically reset to the default branch (see step 2) so that already-merged commits do not cause patch conflicts.
328-
7. A **sync workflow** automatically merges the default branch into all active `autoloop/*` branches whenever the default branch changes, keeping them up to date.
329328

330329
### Cross-Linking
331330

0 commit comments

Comments
 (0)