From a7ca026a5c3cdc64afb227a21ec5a0bc3645ccd4 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 23 Sep 2025 12:10:41 -0400 Subject: [PATCH] After dynamically evaluating a build plan, staging a commit needs to use the latest timestamp. --- internal/runbits/reqop_runbit/update.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/runbits/reqop_runbit/update.go b/internal/runbits/reqop_runbit/update.go index 70b8cce484..5a5a8f0e78 100644 --- a/internal/runbits/reqop_runbit/update.go +++ b/internal/runbits/reqop_runbit/update.go @@ -75,6 +75,12 @@ func UpdateAndReload(prime primeable, script *buildscript.BuildScript, oldCommit if err := script.SetDynamic(false); err != nil { return errs.Wrap(err, "Setting dynamic failed") } + // StageCommitAndPoll needs to be called with atTime=now, not the previous script's atTime. + latest, err := model.FetchLatestRevisionTimeStamp(prime.Auth()) + if err != nil { + return errs.Wrap(err, "Failed to fetch latest timestamp") + } + script.SetAtTime(latest, true) } commitParams := buildplanner.StageCommitParams{