From a9960d1c7c51aecfdda04b7c85417216939fd4b3 Mon Sep 17 00:00:00 2001 From: Lucas Rayan Date: Sun, 2 Aug 2026 08:07:59 -0300 Subject: [PATCH] #19: locate the repository root by a file that is actually committed The E2E suite has never run in CI. repoRoot() walked up looking for PLAN.md, but .gitignore excludes PLAN.md on purpose ("Internal planning docs - never published with the code"), so it is absent from every fresh checkout and the helper always failed. All twelve E2E tests died on it, in this run and identically in #18 before any of these changes. The marker is now the migrations directory, which is committed and is what every caller of repoRoot is ultimately looking for. Reproduced by exporting the tree with git archive - which yields exactly what actions/checkout puts on the runner - and running the suite there: it fails with the old helper and passes with the new one. Co-Authored-By: Claude Opus 5 --- services/protocols/internal/e2e/smtp_inbound_e2e_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/protocols/internal/e2e/smtp_inbound_e2e_test.go b/services/protocols/internal/e2e/smtp_inbound_e2e_test.go index edf7976..b55afa5 100644 --- a/services/protocols/internal/e2e/smtp_inbound_e2e_test.go +++ b/services/protocols/internal/e2e/smtp_inbound_e2e_test.go @@ -270,12 +270,17 @@ func repoRoot(t *testing.T) string { if err != nil { t.Fatal(err) } + // The marker is the migrations directory, which is what every caller is + // ultimately after. It used to be PLAN.md - a file .gitignore excludes on + // purpose ("never published with the code"), so it does not exist in a + // fresh checkout and this helper could never succeed in CI. That failure + // took the entire E2E suite down on every run. for i := 0; i < 8; i++ { - if _, err := os.Stat(filepath.Join(dir, "PLAN.md")); err == nil { + if info, err := os.Stat(filepath.Join(dir, "migrations")); err == nil && info.IsDir() { return dir } dir = filepath.Dir(dir) } - t.Fatal("could not locate repository root (PLAN.md)") + t.Fatal("could not locate repository root (no migrations directory in any parent)") return "" }