Make the backfill refusal test use a genuinely unrelated repository

2a9bd5e65de8 · AtlantisPleb · · parent bf115c0595a1

Make the backfill refusal test use a genuinely unrelated repository

Two repositories built from identical content, author, and second produce
byte-identical commit objects, so the unrelated repository shared the
very boundary the refusal test needed it to miss, and the import it should
have refused succeeded. The content now carries the repository's name, and
the test asserts the repositories really are unrelated before drawing any
conclusion from the refusal.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnhfrafYx5ZGaMbzZEJQ2d
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

pushed
by user · WAL seq 384 · 2026-08-25T14:43:34.402022Z

Changed files

  • modified test/openagents/forge/backfill_test.exs

Diff

1 file changed, +11 -2

test/openagents/forge/backfill_test.exs modified +11 -2

@@ -98,6 +98,11 @@ defmodule OpenAgents.Forge.BackfillTest do

98 98
    bundle = Path.join(base, "unrelated.bundle")
99 99
    sh!(unrelated, "git", ["bundle", "create", bundle, "--all"])
100 100
101
    # The refusal below means nothing unless this repository really is
102
    # unrelated, so say so rather than assume it.
103
    [boundary] = Backfill.open_boundaries(storage_key)
104
    refute sh!(unrelated, "git", ["rev-list", "--all"]) =~ boundary
105
101 106
    assert {:error, {:still_grafted, [_boundary]}} =
102 107
             Backfill.import_history(storage_key, bundle, "operator:test")
103 108

@@ -131,10 +136,14 @@ defmodule OpenAgents.Forge.BackfillTest do

131 136
    sh!(source, "git", ["config", "user.email", "test@example.com"])
132 137
    sh!(source, "git", ["config", "user.name", "Forge Test"])
133 138
139
    # The content carries the repository's name because two repositories built
140
    # from identical content, author, and second produce byte-identical commit
141
    # objects — and therefore the same SHAs, which would make an "unrelated"
142
    # repository share the very boundary the refusal test needs it to miss.
134 143
    Enum.each(1..4, fn n ->
135
      File.write!(Path.join(source, "history-#{n}.txt"), "history #{n}\n")
144
      File.write!(Path.join(source, "history-#{n}.txt"), "#{name} history #{n}\n")
136 145
      sh!(source, "git", ["add", "."])
137
      sh!(source, "git", ["commit", "-m", "history #{n}"])
146
      sh!(source, "git", ["commit", "-m", "#{name} history #{n}"])
138 147
    end)
139 148
140 149
    source

This page updates live while a promote is in flight · changelog