Files
supabase/.github
0003958f70 chore(ci): notify #team-frontend when ratchet baseline hits zero (#50978)
<!-- ccr-slack-attribution -->
_Requested by **Charis Lam** · [Slack
thread](https://supabase.slack.com/archives/C0161K73J1J/p1790599888647059?thread_ts=1790599888.647059&cid=C0161K73J1J)_

## Problem

The weekly "Decrease studio lint ratchet baselines" workflow
(`.github/workflows/studio-lint-ratchet-decrease.yml`) mechanically
decreases each tracked ESLint rule's baseline count in
`apps/studio/.github/eslint-rule-baselines.json` and opens/updates a PR.
When a rule's count reaches exactly 0, there's nothing left to ratchet —
a human (or agent) needs to remove it from ratchet tracking
(`apps/studio/scripts/ratchet-rules.json` and the baseline file) and
bump its ESLint severity to `error`, as was just done manually in
#50977. Nobody is currently notified when this threshold is crossed, so
it can sit unnoticed.

## Solution

**Before:** the job silently commits the decreased baselines and
opens/updates its PR with no signal that any rule just hit 0.

**After:** a new step runs after the baseline commit/PR step, only when
that step found changes (via a new `id: decrease-baselines` and a
`changed` step output, added without touching the existing decrease
logic itself — just capturing its existing control flow into an output).
It parses the final `apps/studio/.github/eslint-rule-baselines.json` on
disk for any rule whose count is exactly `0`. If any are found, it posts
a Slack message via `curl` to a webhook, tagging `@Claude` in
`#team-frontend` with the rule names and a link to the PR the job just
created/updated, asking it to do the same triage as #50977 (remove from
ratchet tracking, bump severity to `error`). If no rule is at 0, it
skips silently.

The webhook URL comes from a new repo secret,
`secrets.SLACK_TEAM_FRONTEND_WEBHOOK_URL`, which **does not exist yet**.
**A human needs to create a Slack incoming webhook for #team-frontend
and add its URL as the `SLACK_TEAM_FRONTEND_WEBHOOK_URL` repository
secret before this step will actually post anything.** Until then, the
step detects the missing/empty secret and only logs a `::warning::`,
exiting 0 — it will never fail the job.

## Review instructions

1. Read `.github/workflows/studio-lint-ratchet-decrease.yml`: confirm
the existing decrease/commit/PR step is unchanged except for the added
`id: decrease-baselines` and the two `echo ... >> "$GITHUB_OUTPUT"`
lines that record whether anything changed and the PR URL.
2. Confirm the new final step only runs `if:
steps.decrease-baselines.outputs.changed == 'true'`.
3. Confirm the new step parses
`apps/studio/.github/eslint-rule-baselines.json`'s `rules` map for
entries equal to `0`, and skips (exit 0, no curl) when none are found.
4. Confirm the `curl` call is gated on `SLACK_WEBHOOK_URL` being
non-empty, and that a failed `curl` only emits `::warning::` rather than
failing the step (`set -euo pipefail` is still safe because the failure
is inside an `if !`).
5. Note that this PR alone does not make the notification fire:
`SLACK_TEAM_FRONTEND_WEBHOOK_URL` must be provisioned as a repo secret
(Settings → Secrets and variables → Actions) from a Slack incoming
webhook for #team-frontend first.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01LZThbcWV5U1r5cvUDKPVQP

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2026-09-28 15:08:03 +00:00
..
2020-04-29 21:09:54 +08:00