Skip to content

fix(ci): move dev builds from every push to a daily schedule - #2113

Merged
carlos-alm merged 4 commits into
mainfrom
fix/publish-throttle-dev-publishes
Jul 16, 2026
Merged

carlos-alm merged 4 commits into
mainfrom
fix/publish-throttle-dev-publishes

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

Summary

  • publish.yml triggered the full 6-platform native build + dev GitHub-release on every merge to main (~8/day, tracking merge frequency rather than actual need)
  • Moves the dev-build trigger from push: branches: [main] to a daily schedule, with a check-dev-needed gate that skips the run entirely if main hasn't moved since the last dev release
  • Stable releases (release: published) and the manual retry path (workflow_dispatch) are unaffected

Why

Part of a broader CI/CD cost-reduction effort (#2108). Even though this repo's GitHub Actions usage is 100% discounted (public repo), the underlying compute is real — a 6-platform Rust cross-compilation running ~8x/day regardless of whether anyone needs a fresher dev build. Coalescing to once a day cuts this ~8x while keeping the dogfood skill's "dev from GitHub release tarballs" path working.

Closes #2108

Test plan

  • python3 -c "import yaml; yaml.safe_load(...)" — YAML parses
  • actionlint — no new findings (all reported shellcheck issues are pre-existing, unrelated lines)
  • Manually verified the gh release list/gh release view SHA-extraction logic against the actual current dev release (dev-v3.15.1-dev.152) — correctly parses the commit SHA from release notes
  • First scheduled run (5am UTC) will validate end-to-end; workflow_dispatch-based stable retry path unchanged and should be spot-checked on next real release

publish.yml ran the full 6-platform native build + dev release on every
merge to main (~8/day), tracking merge frequency instead of actual need.
Move the dev-build trigger to a daily schedule with a no-new-commits skip,
decoupling cost from merge cadence while leaving stable releases untouched.
@greptile-apps

greptile-apps Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the push: branches: [main] trigger for dev builds with a daily schedule cron, adding a check-dev-needed gate job that skips the 6-platform native build entirely when HEAD hasn't moved since the last dev release. Stable release and manual retry paths are unchanged.

  • The new check-dev-needed job short-circuits immediately with should_run=true for release and workflow_dispatch events (no checkout, no API calls), so the stable publish pipeline gains only a trivial extra job hop.
  • The skip signal propagates naturally through the needs chain — when preflight is skipped, compute-version and build-native are also skipped, which causes publish-dev to be skipped even though its own if: github.event_name == 'schedule' condition would be true.
  • Both previously flagged issues (unconditional full-history checkout on non-schedule events; positional SHA extraction from release notes) have been addressed in this revision.

Confidence Score: 5/5

Safe to merge — the schedule-to-skip gate is logically sound and all three trigger paths (schedule, release, workflow_dispatch) have been traced through the needs chain correctly.

The gate logic is correct: should_run=false on a quiet schedule skips preflight, which propagates the skip down through compute-version, build-native, and publish-dev via the normal GitHub Actions needs-skipping behaviour. The check-dev-needed job does almost nothing for non-schedule events, so stable releases are not meaningfully affected. The SHA extraction is now anchored to the release notes template text rather than picking the first bare hex string. No functional regressions found.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/publish.yml Moves dev-build trigger from push-to-main to a daily schedule with a smart skip gate (check-dev-needed) that compares the last dev release's commit SHA to HEAD; stable release and workflow_dispatch paths are unaffected and route through the same gate with an immediate should_run=true short-circuit.

Reviews (4): Last reviewed commit: "fix(ci): skip full-history checkout on n..." | Re-trigger Greptile

Comment on lines +33 to +35
- uses: actions/checkout@v7
with:
fetch-depth: 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unconditional full-history checkout for non-schedule events

actions/checkout@v7 with fetch-depth: 0 runs for every trigger (release, workflow_dispatch), even though the subsequent step immediately exits with should_run=true for those events without using the repo contents. For a stable-release run this means a full-depth clone for zero benefit. Consider wrapping the checkout in a step-level if: github.event_name == 'schedule' condition, or restructuring so non-schedule events bypass the job entirely.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — added if: github.event_name == 'schedule' to the checkout step so the full-depth clone only runs for the scheduled path that actually needs git history; release/workflow_dispatch now skip the checkout entirely and exit should_run=true without touching repo contents.

Comment thread .github/workflows/publish.yml Outdated
exit 0
fi

COMMIT_SHA=$(gh release view "$LATEST_TAG" --json body -q .body | grep -oE '[0-9a-f]{40}' | head -1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 SHA extraction relies on positional regex match against release notes prose

grep -oE '[0-9a-f]{40}' | head -1 silently picks the first 40-char hex string in the release body. The current publish-dev template reliably puts github.sha first, so this works today. But if the release notes ever include another long hex string before the commit SHA, the gate could compute git rev-list <wrong-sha>..HEAD, potentially skipping a needed build. A more targeted extraction (e.g. matching the surrounding template text) would be more robust.

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — anchored the extraction to the "commit " phrasing used by the publish-dev release notes template (grep -oE 'commit[^0-9a-f]*[0-9a-f]{40}') instead of grabbing the first bare 40-char hex string in the body. This ties the match to the known template context so an unrelated hex string elsewhere in the notes won't be picked up.

carlos-alm and others added 2 commits July 16, 2026 01:18
…SHA parse (#2113)

The check-dev-needed gate only reads git history for the schedule
path; release/workflow_dispatch exit immediately without touching the
checkout, so gate the fetch-depth: 0 clone on github.event_name ==
'schedule'.

Also anchor the dev-release SHA extraction to the "commit <sha>"
phrasing used by the publish-dev release notes template instead of
matching the first bare 40-char hex string in the body, which could
pick up an unrelated hex string in future release notes.
@carlos-alm

Copy link
Copy Markdown
Contributor Author

Addressed Greptile's review feedback:

  • Gated the fetch-depth: 0 checkout in check-dev-needed on github.event_name == 'schedule' — release/workflow_dispatch runs now skip the full-history clone entirely since they exit early with should_run=true without touching repo contents.
  • Anchored the dev-release commit-SHA extraction to the "commit <sha>" phrasing from the publish-dev release notes template instead of matching the first bare 40-char hex string in the body, so an unrelated hex string elsewhere in future release notes can't be mispicked.

Both changes verified with actionlint (no new shellcheck findings vs. the pre-existing baseline) and a manual test of the new extraction regex against the actual release notes template.

@carlos-alm

Copy link
Copy Markdown
Contributor Author

@greptileai

@carlos-alm
carlos-alm merged commit 0e51990 into main Jul 16, 2026
14 checks passed
@carlos-alm
carlos-alm deleted the fix/publish-throttle-dev-publishes branch July 16, 2026 08:51
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cost: full 6-platform native build + dev release runs on every merge to main

1 participant