fix(worker): a new branch for every run, so reruns can open their PR
The draft branch was named after the job only. Rerunning a job's build pushed to the earlier run's branch, which already had review commits, so the push was rejected and the finished build failed at the very end. Branches now also carry the run's time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f1d074bb11
commit
fc006a6bcb
2 files changed
+16
-1
No files matched your search
@@ -360,7 +360,9 @@ func (c *workerConfig) openPR(dir string, job *builderJob, res *buildResult) (st
|
||||
if len(short) > 8 {
|
||||
short = short[:8]
|
||||
}
|
||||
branch := "draft/" + res.GameID + "-" + short
|
||||
// One branch per run: a rerun of the same job must not push onto the earlier run's branch, which
|
||||
// may have gained review commits since
|
||||
branch := draftBranch(res.GameID, short, time.Now())
|
||||
auth := "http.extraHeader=Authorization: token " + c.botToken
|
||||
steps := []struct {
|
||||
name string
|
||||
@@ -415,3 +417,7 @@ func readJSON(p string, out any) error {
|
||||
}
|
||||
return json.Unmarshal(raw, out)
|
||||
}
|
||||
|
||||
func draftBranch(gameID, job string, at time.Time) string {
|
||||
return "draft/" + gameID + "-" + job + "-" + at.UTC().Format("20060102-150405")
|
||||
}
|
||||
Reference in new issue
Block a user