fix(ci): select the nightly build ref along main's first-parent line - #37342
fix(ci): select the nightly build ref along main's first-parent line#37342sfreudenthaler wants to merge 1 commit into
Conversation
`git log --before=midnight -1` walks the whole reachable graph in commit-date order, not main's mainline. With squash merging disabled every feature-branch commit lands on main verbatim, carrying the commit date it had on the branch -- so a commit authored days ago but merged after the nightly ran can win the `-1`, and it was never main's tip. Reproduced against real history (all three most recent nightly windows pick a non-mainline commit today): 2026-08-31 without: e379884 Merge branch 'main' into nicobytes/issue-36850-... with: 3192816 fix(clustering): propagate system table set() ... 2026-09-01 without: f7294b1 test(block-editor): cover codeBlock ... with: be94fd0 fix(evergreen-tracks): make dry-run unmissable ... The scheduled 03:30 runs got the right answer only by timing: e379884 is dated 2026-08-30T14:59Z but did not enter main until 2026-08-31T21:35Z, so the 03:31 run could not see it. That breaks the repeatability guarantee this branch of the script exists to provide -- re-running the 2026-08-31 nightly today to investigate a failure now builds a feature branch instead of main. --first-parent on both the midnight selection and the empty-result fallback. Also refreshes the commits/day figure the fetch-depth: 1000 bound is justified against: ~19/day under squash, ~40/day now (118 commits across v26.08.28-01...v26.08.31-01), so 1000 is ~25 days rather than ~52. Closes: #37202 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @sfreudenthaler's task in 57s —— View job Code ReviewI read the diff against the checked-out workflow and traced the Verdict: correct fix, no blocking issues. The change is sound and the reasoning in the PR body / commit message holds up against the code. Key checks I ran:
Notes (non-blocking)
I can't push changes to this file regardless — the GitHub App can't modify No issues found. · |
|
dotbot code review:
The change adds Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · deepseek/deepseek-v4-pro-0813 · medium |
|
dotbot code review:
The change correctly adds Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · google/gemini-3.8-flash · medium |
|
dotbot code review:
The change adds --first-parent to both git log invocations in the nightly workflow. Since the checkout pins HEAD to main, the walk starts at main's tip and is correctly restricted to main's first-parent mainline, preventing selection of commits that were never main's tip. The fallback branch is consistent and the comment update is accurate. Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · ~z-ai/glm-latest · medium |
Why
.github/workflows/cicd_4-nightly.ymlpicks the nightly build ref with:BUILD_REF=$(git log --before="${MIDNIGHT}" --format="%H" -1)git logwalks the whole reachable graph in commit-date order, not main's mainline. Under squash merging that was harmless — one commit per PR, dated at merge time. Squash merging is now disabled on this repo (allow_squash_merge: false), so every feature-branch commit lands onmainverbatim, carrying the commit date it had on the branch. A commit authored days ago but merged after the nightly ran can win the-1— and it was nevermain's tip.Reproduced on real history
All three most recent nightly windows select a non-mainline commit today:
--first-parent--first-parent2026-08-29dfadb3e180Merge branch 'main' into issue-36855-deterministic-id-...7a7708ee35feat(users): API Tokens tab …2026-08-31e379884d35Merge branch 'main' into nicobytes/issue-36850-node-24-...31928163affix(clustering): propagate system table set() …2026-09-01f7294b1ac0test(block-editor): cover codeBlock …be94fd0a7ffix(evergreen-tracks): make dry-run unmissable …Two of the three are
Merge branch 'main' into <feature-branch>commits — the nightly would build a feature branch, notmain.What actually shipped
The scheduled 03:30 runs got the right answer, but only by timing. Confirmed from the run logs:
33354100873(Aug 31) →31928163afd5345a59898ce4dbd1a4c1c8d698f9✅33466553920(Sep 1) →be94fd0a7fed542c6977aeaff6857653a09268c2✅e379884d35is dated2026-08-30T14:59Zbut did not entermainuntil2026-08-31T21:35Z, so the 03:31 run could not yet see it.The exposure is the repeatability guarantee, which is the documented reason this branch of the script exists:
Re-running the 2026-08-31 nightly today builds
e379884d35, a feature branch. So the investigate-a-failure path is broken right now, and the scheduled path is exposed any time a PR merges between midnight and 03:30 carrying commits dated before midnight — which is routine.What changed
--first-parenton bothgit logcalls: the midnight selection and the empty-result fallback. Ten-line diff, no logic restructuring.Also refreshes the commits/day figure the
fetch-depth: 1000bound is justified against — the comment cited "~19 commits/day" from the squash era; it is ~40/day now (118 commits acrossv26.08.28-01...v26.08.31-01), making 1000 commits ~25 days rather than ~52. Still far past the midnight boundary, so the bound holds.--first-parentonly narrows the walk, so it cannot make the shallow depth less safe.Testing
No unit-test harness exists for this workflow. Verified by running both forms of the command against real
origin/mainhistory for three consecutive nightly windows (table above), and by confirming the actual shippedBUILD_REFfrom the two most recent run logs. The--ancestry-pathcheck confirminge379884d35enteredmainafter the Aug 31 run is in the commit message.Closes: #37202
Part of dotCMS/private-issues#673 — item 4 of 4. Item 1 (#37203) is closed, item 2 (#37200) landed in #37219, item 3 (#37201) is #37213.
🤖 Generated with Claude Code