🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
👷 ci(test): skip alint on weekly release PRs and pushes to main (#21113)
Rdmclin24bba72cbe01c
diff --git a/.agents/skills/alint-ruleset/references/cost.md b/.agents/skills/alint-ruleset/references/cost.mdindex 970172590ed..2f76d420fed 100644--- a/.agents/skills/alint-ruleset/references/cost.md+++ b/.agents/skills/alint-ruleset/references/cost.md@@ -41,8 +41,9 @@ the ALint check run summary and the PR comment, in the form## Two keys, never one number-- **CI key** — the `DEEPSEEK_API_KEY` repository secret, spent by the `ALint & Test Desktop- App` job on every push. This is the recurring cost.+- **CI key** — the `DEEPSEEK_API_KEY` repository secret, spent by the+ `ALint & Test Desktop App` job on every push and PR, except `release/weekly-*` PRs and+ pushes to `main`. This is the recurring cost.- **Local / calibration key** — whatever the operator uses for scans. A whole-repo coldcalibration pass is a one-off cost that dwarfs a normal CI day; never fold it into the CIfigure, and never quote a total without naming which key it came from.@@ -64,9 +65,9 @@ alint caches by **file content**; unchanged files cost nothing on a repeat run.1. **Stay on a current `@alint-js/cli`** so per-rule cache keys apply. Cheapest, largest win.2. **Calibrate on samples, not whole-repo cold scans.** A full scan is the single biggest- one-off cost (tens of millions of tokens). Calibrate the rule's scope, sample ~20 findings.+ one-off cost (tens of millions of tokens). Calibrate the rule's scope, sample \~20 findings.3. **Prefer file-before-instruction in the prompt** so DeepSeek's context cache is reused- across the rules that read the same file (hit tokens are ~1/10 the price). As of 0.7.3 this+ across the rules that read the same file (hit tokens are \~1/10 the price). As of 0.7.3 thisis upstream work, not yet in alint — verify before relying on it, and re-calibrate fixturesafter any prompt-order change.4. **Narrow a rule's scope, or move it to `alint.audit.toml`**, when its cost is dominated by adiff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex eec71086b87..e9e4bc1e0c3 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -260,6 +260,18 @@ jobs:pull-requests: writeenv:ALINT_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}+ # Weekly release PRs (`release/weekly-*`, cut from canary) carry a whole cycle+ # of canary changes that already ran alint on their own PRs, and so does a+ # push to main. Re-linting them takes over an hour and spends provider tokens+ # for nothing. Other release branches and `hotfix/*` start from main and get+ # new or cherry-picked changes (and conflict resolutions) on the branch+ # itself, so their PRs are the only place those changes get linted.+ ALINT_SKIP_REASON: >-+ ${{+ github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/weekly-') && 'weekly release PR, whose changes were linted on their own PRs' ||+ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'push to main, whose changes were linted on their own PRs' ||+ ''+ }}steps:- name: Checkout@@ -308,10 +320,15 @@ jobs:# Findings are published as a separate "ALint" check (red when a rule at# `error` level fires) plus one summary comment on the PR, rewritten on# every push. This job itself never fails because of alint. Skipped when- # the provider secret is unavailable (forks). Runs here to reuse the root+ # the provider secret is unavailable (forks) and for weekly release PRs and+ # pushes to main (see ALINT_SKIP_REASON). Runs here to reuse the root# install instead of paying for another job.+ - name: alint · report a skipped run+ if: ${{ !cancelled() && env.ALINT_API_KEY != '' && env.ALINT_SKIP_REASON != '' }}+ run: echo "::notice::ALint skipped for this ${ALINT_SKIP_REASON}"+- name: alint · expose the diff against the base as dirty changes- if: ${{ !cancelled() && env.ALINT_API_KEY != '' }}+ if: ${{ !cancelled() && env.ALINT_API_KEY != '' && env.ALINT_SKIP_REASON == '' }}continue-on-error: trueenv:GH_TOKEN: ${{ github.token }}@@ -328,7 +345,7 @@ jobs:git status --short | head -50- name: alint · restore cache- if: ${{ !cancelled() && env.ALINT_API_KEY != '' }}+ if: ${{ !cancelled() && env.ALINT_API_KEY != '' && env.ALINT_SKIP_REASON == '' }}continue-on-error: trueuses: actions/cache@v4with:@@ -341,7 +358,7 @@ jobs:alint-- name: alint · lint changed files- if: ${{ !cancelled() && env.ALINT_API_KEY != '' }}+ if: ${{ !cancelled() && env.ALINT_API_KEY != '' && env.ALINT_SKIP_REASON == '' }}continue-on-error: trueenv:GITHUB_TOKEN: ${{ github.token }}@@ -359,7 +376,7 @@ jobs:bun packages/alint/report.ts alint-output.json- name: alint · calibrate rule fixtures (when rules or fixtures changed)- if: ${{ !cancelled() && env.ALINT_API_KEY != '' }}+ if: ${{ !cancelled() && env.ALINT_API_KEY != '' && env.ALINT_SKIP_REASON == '' }}continue-on-error: truerun: |if git status --porcelain -- alint.config.toml packages/alint ':(glob)packages/*/alint/**' | grep -q .; thendiff --git a/packages/alint/README.md b/packages/alint/README.mdindex 8c4120e2f01..2892391ccaa 100644--- a/packages/alint/README.md+++ b/packages/alint/README.md@@ -145,13 +145,14 @@ Every summary now ends with the run's cost — model calls, cache hits, input an## CI-The `alint ·` steps at the end of the "ALint & Test Desktop App" job in `.github/workflows/test.yml` run on every push and pull request, on the change's diff only (they reuse that job's root install instead of paying for a runner of their own). The desktop job itself never fails because of alint:+The `alint ·` steps at the end of the "ALint & Test Desktop App" job in `.github/workflows/test.yml` run on pushes and pull requests (except the weekly-release cases below), on the change's diff only (they reuse that job's root install instead of paying for a runner of their own). The desktop job itself never fails because of alint:- `alint --dirty` lints the working tree against `HEAD` and keeps only findings on changed lines. The steps fetch the merge base (against the PR base, or `canary` on a push) and run `git reset --mixed <merge-base>`, which turns the whole change into dirty changes, so the scope is exactly its diff and nothing older is reported. On a push to `canary` itself the diff is empty and nothing runs.- `packages/alint/report.ts` publishes the result as a separate **ALint** check run on the head commit: red when any `error` finding exists, neutral with only warnings, green when clean. Findings are attached to it as line annotations. The check is not a required status, so it does not block merging, but a red check reaches whoever watches CI, including agents woken by CI failures.- The same table goes into one summary comment on the open PR for the branch, rewritten in place on every push. It is created only once there is something to report; when a later push is clean the comment flips to a green verdict instead of disappearing.- Findings on the calibration fixtures are dropped from the check and the comment; the fixture suite covers them.- The provider key comes from the `DEEPSEEK_API_KEY` repository secret. Fork PRs cannot read it, so the steps are skipped.+- Weekly release PRs (head branch `release/weekly-*`) and pushes to `main` skip the steps and post a notice instead: their diff is a whole cycle of canary changes that were already linted on their own PRs. Other `release/*` and `hotfix/*` PRs still run, since they start from `main` and their new or cherry-picked changes land on that branch itself.- When `alint.config.toml` or anything under `packages/alint` changed, the fixture suite runs too, so a rule edit is calibrated before it lands.- `.alintcache` is restored from the latest run whatever the rule set. Since alint 0.7.2 each cached result is keyed by its rule's own text, include/exclude lists and severity, so editing, adding or re-levelling one rule re-runs only that rule; everything else stays cached.