fix(create_project): make the write the branch-readiness gate (#42)
BranchExists returns true before the generated branch is writable, so waitForBranch didn't help and a 2.5s retry budget was too short (branch became writable ~30s post-generate under load in live testing). Drop waitForBranch; let upsertRetry be the gate — retry the write on the transient "branch does not exist" not-found for up to 60s, early-exit on success. Once the first write lands the branch is writable and the rest succeed immediately. Refs #42. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,10 +69,6 @@ func (f *fakeTemplateServer) handler(t *testing.T, tmpl, dest string) http.Handl
|
||||
_, _ = fmt.Fprintf(w, `{"name":%q,"full_name":"mathias/%s","default_branch":%q,"clone_url":"http://gitea.example.com/mathias/%s.git","html_url":"http://gitea.example.com/mathias/%s","template":false}`,
|
||||
dest, dest, f.genBranch, dest, dest)
|
||||
|
||||
case r.Method == http.MethodGet && strings.HasPrefix(p, "/api/v1/repos/mathias/"+dest+"/branches/"):
|
||||
// waitForBranch readiness probe — branch is present.
|
||||
_, _ = fmt.Fprint(w, `{"name":"main","commit":{"id":"c"}}`)
|
||||
|
||||
case r.Method == http.MethodGet && strings.HasPrefix(p, "/api/v1/repos/mathias/"+dest+"/git/trees/"):
|
||||
var entries []string
|
||||
for path := range f.files {
|
||||
|
||||
Reference in New Issue
Block a user