Skip to content

ci: run code-quality on main nightly, and on demand - #6246

Open
chalfontchubby wants to merge 3 commits into
mainfrom
ci/nightly-main-run
Open

chalfontchubby wants to merge 3 commits into
mainfrom
ci/nightly-main-run

Conversation

@chalfontchubby

Copy link
Copy Markdown
Collaborator

Opened by Claude on behalf of @chalfontchubby.

Summary: run the code-quality workflow on main every night at 00:17 UTC, and allow it to be started by hand, so a broken main shows up on main rather than on the next unrelated PR.

Why: the checks on main only run when something merges. A failure that doesn't come from a merge stays hidden until someone's PR trips over it:

A nightly run catches both kinds within a day, on main's own commit status. It runs just after midnight UTC, when a test written against "today" first goes wrong.

What changes: schedule (cron 17 0 * * *) and workflow_dispatch are added to on: in .github/workflows/code-quality.yml. Nothing else changes:

  • Scheduled runs always use the default branch.
  • The pre-commit job runs exactly as on a push to main, and pre-commit-ci/lite-action stays limited to PRs.
  • kernel-binaries already runs only on PRs from this repo, so it is skipped.

Note: GitHub sends notifications for a failed scheduled run to the person who last changed the cron line, which after this merges is me.

This PR doesn't stop merges that are green only against an older main, which caused the 14 Nov breakages (Black on test_savings_bookkeeping.py, docs_marketplace on the Anker docs). That needs the "require branches to be up to date" setting or a merge queue, which is a separate decision.

Testing: pre-commit's lint hooks, check yaml included, pass. The quick-test hook fails only on web_pv_calibration_chart, which is fixed in #6245. The schedule itself can only be exercised once this is on main; workflow_dispatch then lets it be tried at once.

🤖 Generated with Claude Code

Main's checks only ran on a merge, so a failure caused by the date (#6244) or
by a dependency release first showed up on the next unrelated PR. A nightly
scheduled run at 00:17 UTC puts it on main instead, and workflow_dispatch
allows a manual run. kernel-binaries still runs only on PRs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chalfontchubby chalfontchubby added the INFRA Affects the predbat development infrastructure - not directly the end product. Not an end user fix label Nov 17, 2026
@github-actions github-actions Bot added the BOT_REVIEW Trigger an autotriage label Nov 17, 2026

@springfall2008 springfall2008 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Automated comment from the triage bot.

Review of 6b1013e5 (ci: run code-quality on main nightly, and on demand): 1 finding, inline; 0 in the body.

Checked: the YAML parses to pull_request / push: [main] / schedule: 17 0 * * * / workflow_dispatch; kernel-binaries stays skipped on a non-PR event because its if reads github.event.pull_request.head.repo.full_name, which is null on schedule, and the existing push: main runs already exercise that path; pre-commit-ci/lite-action stays behind its pull_request guard; no other workflow in .github/workflows/ has a schedule to collide with it, and nothing on main reads code-quality's check names. The gap the change leaves is the one the PR body states itself - it reports a broken main a day late rather than preventing it, which needs strict_required_status_checks_policy or a merge queue, and that was a deliberate decision.

Note, not a finding: the first nightly run will fail on web_pv_calibration_chart until #6245 merges, as the PR's Testing section already says.

branches: [main]
# Nightly on main (scheduled runs use the default branch), so a failure that comes from the date or from a new
# dependency release, rather than from a merge, shows on main before it shows up on the next unrelated PR (#6244).
# Just after midnight UTC, when a test written against "today" first goes wrong. kernel-binaries only runs on a PR

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Automated comment from the triage bot.

This sentence is cut off mid-way: it ends "kernel-binaries only runs on a PR" with no verb and no full stop, immediately before the schedule: key it is meant to explain. The reader is left without the consequence - the PR body's own wording is "kernel-binaries already runs only on PRs from this repo, so it is skipped".

Failure scenario: nothing at runtime, but this is the only place in the file that says what a scheduled trigger does to kernel-binaries, and it is the line a maintainer will read when asking whether schedule: can try to commit kernel binaries to main. As written it stops before answering. Completing it - e.g. "... so a scheduled run skips it." - keeps the file's existing rationale-per-trigger style intact.

Verified by reading the checkout: the job does skip on schedule, because its if: github.event.pull_request.head.repo.full_name == github.repository resolves to null == repo, hence false, on an event with no pull_request payload; the pre-existing push: main runs already take that same path, so the new trigger adds no new risk there.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Automated reply from the triage bot.

Fixed in 5bf5dd2. The comment now ends "kernel-binaries only runs on a PR from this repo, so a scheduled run skips it." This is a comment-only change, and the triggers are as they were. Pre-commit (check yaml and the quick suite) passes locally.

@springfall2008 springfall2008 removed the BOT_REVIEW Trigger an autotriage label Nov 17, 2026
@chalfontchubby chalfontchubby added the BOT_CLEANUP Trigger: bot should address PR review feedback and CI failures, then commit and push label Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@springfall2008 springfall2008 removed the BOT_CLEANUP Trigger: bot should address PR review feedback and CI failures, then commit and push label Nov 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INFRA Affects the predbat development infrastructure - not directly the end product. Not an end user fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants