Skip to content

Commit cd9d8cd

Browse files
gtrrz-victorclaude
andcommitted
test(e2e): cover git-refs backend on push + assert no v1 branch
Two changes to lock in the git-refs checkpoint backend (the default for fresh `entire enable` setups) as an exercised, guarded path: 1. Per-test guard: SetupRepo now registers a cleanup (only under the git-refs backend) that fails the test if a local entire/checkpoints/v1 branch exists. Under git-refs, checkpoints live in per-checkpoint refs and nothing should ever seed v1; a v1 branch means a flow regressed. 2. CI coverage: the on-push e2e.yml matrix pins git-branch, so git-refs had no automatic coverage. Make e2e-checkpoint-store.yml callable (workflow_call) and add an e2e-git-refs job to e2e.yml that runs on every push to main, wired into the Slack failure notification. The agent (claude-code) and backend (git-refs) are fixed by the reusable workflow's input defaults, so the caller parameterizes neither and the leg always covers exactly one agent on one backend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 01KY4RVXK1PCVYV31TMC73VS6P
1 parent bbc8a77 commit cd9d8cd

3 files changed

Lines changed: 56 additions & 4 deletions

File tree

.github/workflows/e2e-checkpoint-store.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ on:
2626
options:
2727
- git-branch
2828
- git-refs
29+
# Reusable entry point so e2e.yml can run a fixed agent/backend leg (e.g.
30+
# claude-code against git-refs) as part of the on-push matrix. The `inputs`
31+
# context is shared by workflow_dispatch and workflow_call, so the jobs below
32+
# read `inputs.*` for both triggers.
33+
workflow_call:
34+
inputs:
35+
agent:
36+
# Fixed to claude-code by default: the on-push leg in e2e.yml relies on
37+
# this and passes no agent, so that leg always covers exactly one agent.
38+
# A future caller may still override it explicitly.
39+
description: "Agent to run"
40+
required: false
41+
type: string
42+
default: "claude-code"
43+
checkpoint_store:
44+
description: "Checkpoint storage backend to run the suite against"
45+
required: false
46+
type: string
47+
default: "git-refs"
2948

3049
jobs:
3150
# Build the agent matrix dynamically: a single selected agent, or all of them
@@ -38,9 +57,10 @@ jobs:
3857
- id: set
3958
# Pass the input through env rather than interpolating it into the script:
4059
# `type: choice` only constrains the UI, so a REST-API dispatch could inject
41-
# shell metacharacters here otherwise.
60+
# shell metacharacters here otherwise. `inputs.agent` covers both the
61+
# workflow_dispatch and workflow_call triggers.
4262
env:
43-
AGENT_INPUT: ${{ github.event.inputs.agent }}
63+
AGENT_INPUT: ${{ inputs.agent }}
4464
run: |
4565
input="$AGENT_INPUT"
4666
if [ -n "$input" ]; then

.github/workflows/e2e.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,22 @@ jobs:
143143
uses: ./.github/workflows/e2e-windows.yml
144144
secrets: inherit
145145

146+
# Cover the git-refs checkpoint backend — the default for fresh `entire enable`
147+
# setups — which the matrix above does not exercise (it pins git-branch). Agent
148+
# (claude-code) and backend (git-refs) are fixed by the reusable workflow's
149+
# input defaults, so this leg always covers exactly one agent on one backend.
150+
e2e-git-refs:
151+
uses: ./.github/workflows/e2e-checkpoint-store.yml
152+
permissions:
153+
actions: read
154+
contents: read
155+
copilot-requests: write
156+
secrets: inherit
157+
146158
notify-slack:
147159
runs-on: ubuntu-latest
148-
needs: [e2e-tests, e2e-windows]
149-
if: ${{ always() && (needs.e2e-tests.result == 'failure' || needs.e2e-windows.result == 'failure') && github.event_name == 'push' }}
160+
needs: [e2e-tests, e2e-windows, e2e-git-refs]
161+
if: ${{ always() && (needs.e2e-tests.result == 'failure' || needs.e2e-windows.result == 'failure' || needs.e2e-git-refs.result == 'failure') && github.event_name == 'push' }}
150162
steps:
151163
# Classify the failed jobs into two severities:
152164
# RED — a "reliable" agent (or Windows) failed. These pass on every

e2e/testutil/repo.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,29 @@ func SetupRepo(t *testing.T, agent agents.Agent) *RepoState {
169169
}
170170
})
171171

172+
// Under the git-refs backend, checkpoints live in per-checkpoint refs and
173+
// nothing should ever create the entire/checkpoints/v1 metadata branch. A v1
174+
// branch appearing means some flow seeded it despite git-refs being primary
175+
// (the enable-time regression this guards against). Registered last so it
176+
// runs before the repo dir is removed (cleanups are LIFO).
177+
if UsingGitRefs() {
178+
t.Cleanup(func() { assertNoCheckpointV1Branch(t, dir) })
179+
}
180+
172181
return state
173182
}
174183

184+
// assertNoCheckpointV1Branch fails the test if a local entire/checkpoints/v1
185+
// branch exists in dir. Only meaningful under the git-refs backend; git-branch
186+
// legitimately creates v1.
187+
func assertNoCheckpointV1Branch(t *testing.T, dir string) {
188+
t.Helper()
189+
hash := strings.TrimSpace(gitOutputSafe(dir, "rev-parse", "--verify", "--quiet", "refs/heads/"+checkpointRefV1))
190+
if hash != "" {
191+
t.Errorf("git-refs backend: unexpected %s branch was created (%s); no flow should seed v1 under git-refs", checkpointRefV1, hash)
192+
}
193+
}
194+
175195
func checkpointReadRef() string {
176196
return checkpointRefV1
177197
}

0 commit comments

Comments
 (0)