Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions .github/workflows/heart-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Heart Health
# the ONE unified health dashboard (heart/dashboard.py) alongside the existing
# alerting.
#
# It runs the four checks that need only the GitHub API (no local working tree) —
# CI status, open PRs, CI wall-clock timing and the NO_RUN census — across every
# polled repo, then:
# It runs the five checks that need only the GitHub API (no local working tree) —
# CI status, open PRs, CI wall-clock timing, the NO_RUN census and the
# per-script smoke timings — across every polled repo, then:
# 1. renders the unified board (one renderer, many formats) and publishes it
# three ways, all from the SAME snapshot so they cannot disagree:
# * GitHub Pages — self-contained fmt="html" + a shields badge.json
Expand Down Expand Up @@ -37,11 +37,15 @@ on:
# contents: write → commit the README badge/block into Heart's OWN README
# issues: write → the [heart-health] tracking issue
# pages/id-token → publish the Pages board
# actions: read → list and download workflow artifacts (smoke_timings). The
# artifact endpoints need this scope even for the repo's own
# artifacts, and the default token grant does not include it.
permissions:
contents: write
issues: write
pages: write
id-token: write
actions: read

# Never let two runs publish Pages at once. cancel-in-progress is false so a
# newer run QUEUES behind an in-progress one rather than cancelling it — we don't
Expand Down Expand Up @@ -81,21 +85,33 @@ jobs:
- name: Install PyYAML
run: pip install --quiet pyyaml

- name: Run cloud-safe checks (ci_status, open_prs, ci_timing, no_run_census)
- name: Run cloud-safe checks (ci_status, open_prs, ci_timing, no_run_census, smoke_timings)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The repo-scoped GITHUB_TOKEN is enough for every check here except
# the artifact /zip downloads smoke_timings makes against OTHER repos:
# actions/download-artifact documents a cross-repo download as needing
# a token with actions:read ON THAT REPO, and the default token has no
# standing there — the endpoint answers 403. The check records that
# per repo as an honest error rather than a quiet-looking empty
# result, and the remedy is a secret, never a code change: a
# fine-grained PAT (Actions: read on the workspace repos) stored as
# HEART_TIMINGS_TOKEN. Absent that secret this falls back to the
# auto-provisioned token and Heart's own artifacts still ingest.
GH_TOKEN: ${{ secrets.HEART_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
run: |
# Four API-only checks: CI conclusions and open PRs (health), then CI
# wall-clock and the NO_RUN census (the ⏱ performance surface).
# ci_timing's aggregate step re-reads the board.json published by the
# previous run to carry its own per-gate history forward; a fetch
# failure there costs a sparkline, never the render. `set +e` keeps a
# single broken check from aborting the board.
# Five API-only checks: CI conclusions and open PRs (health), then CI
# wall-clock, the NO_RUN census and the per-script smoke timings (the
# ⏱ performance surface). ci_timing's and smoke_timings' aggregate
# steps re-read the board.json published by the previous run to carry
# their own history/previous observation forward; a fetch failure
# there costs a sparkline or a comparison, never the render. `set +e`
# keeps a single broken check from aborting the board.
set +e
bash heart/checks/ci_status.sh
bash heart/checks/open_prs.sh
bash heart/checks/ci_timing.sh
bash heart/checks/no_run_census.sh
bash heart/checks/smoke_timings.sh
exit 0

- name: Aggregate snapshot + compute readiness verdict
Expand Down
11 changes: 11 additions & 0 deletions config/repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,17 @@ thresholds:
yellow_factor: 1.5 # median / recent-history median >= this, AND
min_delta_s: 120 # ... at least this many seconds slower
history_cap: 30 # days of self-carried per-gate history
# Per-SCRIPT timing drift (heart/checks/smoke_timings.py). The same both-gates
# rule as ci_timing, with its own numbers because it is measuring a different
# size of thing: ci_timing's 1.5x / 120 s is sized for multi-minute gates,
# while a smoke script runs for 5-60 s and would never clear a 120 s floor no
# matter how badly it regressed. 2.0x is the profiling conductor's ratio, and
# a 5 s floor sits just above the ~5-7 s import-floor jitter every script
# pays. Advisory — a slowed script never reds the readiness verdict.
smoke_timings:
slow_factor: 2.0 # seconds / previous observation >= this, AND
min_delta_s: 5 # ... at least this many seconds slower
top_n: 5 # slowest scripts shown per repo on the board
worktree_drift:
orphan_red: true # orphan WT with uncommitted work → red
orphan_yellow: true # orphan WT (clean) → yellow
Loading
Loading