Skip to content

Morning status Slack message, cron re-enable, release rehearsal #39

Closed

Description

@Jammy2211

Overview

All routine crons were paused org-wide on 2026-07-06 because per-workflow GitHub failure emails were bloating the inbox. Heart is now green and CI is passing, so this task restores the routine builds behind one aggregated morning Slack message ("all is OK" / "problem: …") and brings the daily release back in rehearsal mode (TestPyPI-only) until the human flips it live.

Plan

  • PyAutoMind: new morning_health.yml — daily 06:00 UTC; reads Heart's Pages verdict (badge.json) + latest run conclusions of every routine workflow via gh api (all repos public, zero new secrets); posts one Slack message via the existing PYAUTO_UPDATE_WEBHOOK_URL. Deterministic bash+jq — no LLM in the health path.
  • PyAutoHeart: re-enable heart-health daily cron, moved 06:00→05:00 UTC so the verdict is fresh before the morning message; re-enable weekly url-check + workspace-validation crons.
  • PyAutoBuild: release.yml — re-enable the weekday 02:00 cron with a new resolve_mode job: scheduled runs are rehearsal (TestPyPI-only) unless repo variable RELEASE_MODE=live; dispatch behaviour unchanged; minor_version falls back to 1 on schedule. Re-enable python_matrix Monday cron.
  • PyAutoMind: re-enable the user-facing update-digest cron (one-line uncomment, separate audience/channel-message).
  • Verify by dispatch: morning_health posts to Slack; heart-health refreshes the stale YELLOW badge; one release.yml rehearsal dispatch from the feature branch proves TestPyPI end-to-end before any cron fires.

Human actions (post-merge, deliberately manual): flip vars.RELEASE_MODE=live on PyAutoBuild when satisfied with rehearsals; optionally silence GitHub Actions failure emails now that Slack covers it.

Deferred follow-ups: PyAutoFit nss_install_smoke cron uncomment (repo claimed by ep-diagnostics / ep-graphical-docs); optional dedicated Slack channel/webhook for health messages.

Detailed implementation plan

Affected Repositories

  • PyAutoHeart (primary)
  • PyAutoBuild
  • PyAutoMind

Branch Survey

Repository Current Branch Dirty?
./PyAutoHeart main clean
./PyAutoBuild main clean
./PyAutoMind main clean

Suggested branch: feature/morning-status-release-rehearsal

Implementation Steps

  1. PyAutoMind/.github/workflows/morning_health.yml (new): schedule: 0 6 * * * + workflow_dispatch. Steps: (a) fetch https://pyautolabs.github.io/PyAutoHeart/badge.json → verdict; query the latest completed heart-health.yml run for freshness (>26 h old → the message says the verdict is stale, with its timestamp); (b) gh api repos/<owner>/<repo>/actions/workflows/<file>/runs?per_page=1 for PyAutoBuild/release.yml, PyAutoBuild/python_matrix.yml, PyAutoHeart/workspace-validation.yml, PyAutoHeart/url-check.yml, PyAutoFit/nss_install_smoke.yml; (c) compose "☀️ All is OK" or "⚠️ Problem: <list with run/issue links>" + link to the Pages board; (d) POST via secrets.PYAUTO_UPDATE_WEBHOOK_URL.
  2. PyAutoHeart/.github/workflows/heart-health.yml: uncomment schedule, cron 0 5 * * *.
  3. PyAutoHeart/.github/workflows/url-check.yml + workspace-validation.yml: uncomment paused crons (Mon 04:00 / Mon 03:00).
  4. PyAutoBuild/.github/workflows/release.yml: add first job resolve_mode emitting outputs.rehearsal = 'true' when github.event_name == 'schedule' && vars.RELEASE_MODE != 'live', else github.event.inputs.rehearsal; switch the eight github.event.inputs.rehearsal references to needs.resolve_mode.outputs.rehearsal; MINOR_VERSION fallback 1 on schedule; uncomment the weekday cron.
  5. PyAutoBuild/.github/workflows/python_matrix.yml: uncomment Monday cron.
  6. PyAutoMind/.github/workflows/morning_status.yml: uncomment the 05:00 cron.
  7. Push feature branches; dispatch verification runs (morning_health, heart-health, release.yml with rehearsal from branch); confirm the Slack message arrives and TestPyPI receives dev-versioned wheels.

Key Files

  • PyAutoMind/.github/workflows/morning_health.yml — new morning verdict message
  • PyAutoHeart/.github/workflows/heart-health.yml — daily verdict source (cron + time shift)
  • PyAutoBuild/.github/workflows/release.yml — resolve_mode job + cron
  • PyAutoBuild/.github/workflows/python_matrix.yml, PyAutoHeart/.github/workflows/{url-check,workspace-validation}.yml, PyAutoMind/.github/workflows/morning_status.yml — cron uncomments

Original Prompt

Click to expand starting prompt

I recently disabled a number of nightly (or less than daily) auto runs because it was bloating my email. However, PyAutoHeart is now green, CI is passing and I think it would be good to have a nightly task which gives me an email (or ideally a Slack message, but make this follow up if it requires faff with manual inputs) that every morning says 'all is ok' or 'this is a problem'. Also: review all nightly / routine builds and work out if there is a better or more optimal setup. I want to get automated daily release back very soon too, perhaps set up but temporarily publishing to test PyPI (via rehearsal) mode for a bit, then switch over.

Autonomy: launched --auto; effective level human-required (release-type cap) — plan approved in-session; ship sign-off and merge stay human.

Activity

  1. Jammy2211 commented on Jul 8, 2026

    @Jammy2211
    ContributorAuthor

    Implementation complete — verification runs in flight.

    Branches pushed (all feature/morning-status-release-rehearsal):

    • PyAutoBuild — release.yml resolve_mode job (scheduled runs rehearse to TestPyPI until vars.RELEASE_MODE=live; dispatch unchanged) + weekday 02:00 cron back on; python_matrix Monday cron back on. One deviation from the written plan: MINOR_VERSION keeps its existing run_number fallback on schedule rather than a new '1' fallback — that's the semantic the old daily cron always had.
    • PyAutoHeart — heart-health daily cron back on, moved 06:00→05:00 UTC so the verdict is fresh for the morning message; workspace-validation + url-check Monday crons back on.
    • PyAutoMind — new morning_health.yml (06:00 UTC): deterministic bash+jq aggregation of the Heart Pages verdict (with staleness stamp), the daily rehearsal outcome, and the weekly runs, posted as one Slack message via the existing webhook. morning_status digest cron uncommented (separate user-facing message).

    Verification now running:

    1. heart-health dispatch — refreshing the stale (2026-07-06) YELLOW badge: https://github.com/PyAutoLabs/PyAutoHeart/actions/runs/28969343037
    2. release.yml rehearsal dispatch from the feature branch (exercises resolve_mode end-to-end incl. TestPyPI publish): https://github.com/PyAutoLabs/PyAutoBuild/actions/runs/28969344875
    3. morning_health dispatch follows once the badge is fresh — success = one Slack message arrives.

    Next: PRs open after verification; ship sign-off and merge stay human (release-type cap).

  2. Jammy2211 commented on Jul 8, 2026

    @Jammy2211
    ContributorAuthor

    Shipped at PR-open — awaiting human sign-off + merge.

    PRs (one per repo, all feature/morning-status-release-rehearsal):

    Verification results:

    • ✅ TestPyPI rehearsal dispatched from the Build branch: run 28969344875 — resolve_mode ✓, 5/5 packages on TestPyPI ✓, all live-release jobs skipped ✓.
    • ✅ heart-health dispatch refreshed the stale badge: now YELLOW · 60 (driver: aging open PRs — the parked ep-* pending-release PRs and a 9-day-old Mind PR; no reds).
    • ✅ morning_health collect+compose executed locally against live APIs — correctly flagged Heart YELLOW plus the two genuinely failing weekly runs (python_matrix, workspace-validation, both 2 days old); valid Block Kit payload.
    • ⏳ The Slack POST leg needs the workflow on Mind main: dispatch morning_health.yml right after merging feat: noise-filter the health sync dashboard + repo_cleanup hygiene nudge #41 and confirm one message arrives.

    Ship-gate legs (release-type → human-required): tests n/a (workflow YAML only, stated in PR bodies) · smoke n/a · review CLEAN · Heart YELLOW · 60 requires human acknowledgement.

    After merge (human, deliberately manual):

    1. Dispatch morning_health.yml on Mind main → check Slack.
    2. Tomorrow ~06:00 UTC: first fully automatic cycle (02:00 rehearsal → 05:00 heart-health → 06:00 Slack verdict).
    3. Flip vars.RELEASE_MODE=live on PyAutoBuild when satisfied with rehearsals.
    4. Optionally silence GitHub Actions failure emails — Slack is now the morning signal.
  3. Jammy2211 commented on Jul 8, 2026

    @Jammy2211
    ContributorAuthor

    All three PRs merged (PyAutoBuild#119, PyAutoHeart#40, PyAutoMind#41). Post-merge dispatch of morning_health.yml ran — and failed at the Slack POST with curl: (3) URL rejected: Malformed input to a URL function.

    Root cause found — and it predates this task: the PYAUTO_UPDATE_WEBHOOK_URL secret (set 2026-05-17) is itself malformed — the morning_status digest has failed at its identical "POST to Slack" step every day since, with zero successes in its entire run history. Those daily failure emails are very plausibly the original "email bloat" that triggered the 2026-07-06 cron pause.

    Fix (human-only — secrets are write-only and the webhook URL is yours): re-set the secret with the bare webhook URL, no quotes/newline/VAR= prefix:

    gh secret set PYAUTO_UPDATE_WEBHOOK_URL -R PyAutoLabs/PyAutoMind --body 'https://hooks.slack.com/services/…'

    (Retrieve the URL from api.slack.com/apps → your app → Incoming Webhooks.) Then morning_health.yml gets re-dispatched to confirm one Slack message arrives. Everything upstream of the POST is proven: collection, verdict logic, payload compose, and the TestPyPI rehearsal pipeline are all green.

  4. Jammy2211 commented on Jul 9, 2026

    @Jammy2211
    ContributorAuthor

    Final blocker resolved — both morning Slack messages are live (verified 2026-07-09).

    • Maintainer re-set BOTH PyAutoMind secrets (each dated 2026-05-17 and dead): PYAUTO_UPDATE_WEBHOOK_URL (fresh Slack app "PyAuto Updates") and CLAUDE_CODE_OAUTH_TOKEN (fresh claude setup-token).
    • morning_health.yml dispatched → POST to Slack: success (first delivery since the secret rotted).
    • morning_status.yml (digest) needed three further stacked CI fixes, now on Mind main (51e869e, d042289, 0b78d5f): actions/checkout (claude-code-action agent mode dies "fatal: not in a git directory" without a checkout), show_full_output: true (default hiding masked every real error as "slack_payload.json missing"), and claude_args: '--allowedTools \"Write\"' (default permission mode silently denied the payload write). Dispatched → run fully green, digest delivered.

    The daily 05:00 UTC crons will now deliver both messages unattended. Remaining nice-to-haves from this task's own deferred list (dedicated health channel webhook, nss_install_smoke cron uncomment) are unchanged.

  5. github-actions commented on Jul 23, 2026

    @github-actions
    Contributor

    Cloud health checks are green — closing automatically.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions