Anki is a smart spaced repetition flashcard program https://apps.ankiweb.net
Find a file
Fernando Lins 4aa9c08369
fix(ci): prevent silent skip of PR coverage-regression check on evicted baseline (#5480)
## Linked issue

Fixes #5418

## Summary / motivation

Every push to `main` creates a new `coverage-baseline-linux-<sha>` cache
entry. Without a pruning step, these entries accumulate until GitHub's
LRU eviction removes old ones. When the baseline a PR needs has been
evicted, `check-coverage-regression.py` silently skips the check instead
of failing, which could mask genuine coverage regressions.

Two changes together close the gap:

1. **`prune-coverage-cache.yml`**: a new workflow triggered by
`workflow_run` on every successful CI run on `main`. It keeps exactly
one `coverage-baseline-linux-*` cache (the one just created) and deletes
all older entries via the GitHub Actions API. With a single,
always-fresh entry, eviction becomes practically impossible.

2. **`check-coverage-regression.py`**: turns the silent "no baseline —
skipping" path into an explicit failure (`exit 2`). If somehow a
baseline is still absent, the check now surfaces the problem visibly
instead of passing silently.

## Steps to reproduce

1. Allow several pushes to `main` to accumulate
`coverage-baseline-linux-*` cache entries until GitHub evicts the most
recent one.
2. Open a PR: `check-coverage-regression.py` prints `no baseline —
skipping` and exits 0, even if coverage dropped.

## How to test

### Details

- After merging, verify via **Actions → Prune coverage baseline caches**
that the job runs after a `CI` completion on `main` and leaves exactly
one `coverage-baseline-linux-*` entry (`gh cache list -R ankitects/anki
--key coverage-baseline-linux-`).
- Confirm that a PR with a missing baseline now receives exit code 2
(visible failure) instead of exit code 0.

## Before / after behavior

**Before:** evicted baseline → `check-coverage-regression.py` skips
silently, coverage regressions go undetected.

**After:** only one baseline exists at a time (no eviction risk); if it
is somehow absent, the script exits with code 2 and the CI step fails
visibly.
2026-08-30 21:07:18 -03:00
.cargo Use rust-lld on Windows (#4650) 2026-07-06 23:16:36 +08:00
.config Drop workspace-hack in favor of workspace deps 2023-06-23 17:41:31 +10:00
.cursor/rules Make URL schemes dialog more ergonomic (#4002) 2025-05-15 16:17:33 +10:00
.github fix(ci): prevent silent skip of PR coverage-regression check on evicted baseline (#5480) 2026-08-30 21:07:18 -03:00
.idea.dist Update PyCharm docs (#4389) 2025-10-27 19:27:50 +07:00
.vscode.dist chore: Configure mypy extension for VS Code (#5317) 2026-08-14 22:02:00 +03:00
build chore: Move .github/scripts/*.py to tools/ (#5375) 2026-08-21 18:01:42 +03:00
cargo chore(deps): bump quinn-proto from 0.11.14 to 0.11.16 (#5221) 2026-08-25 17:24:36 -03:00
docs PoC: evaluate SonarCloud as a code quality and coverage tool (#4996) 2026-08-26 15:48:45 -03:00
docs-site PoC: evaluate SonarCloud as a code quality and coverage tool (#4996) 2026-08-26 15:48:45 -03:00
ftl fix: don't let ftl string copy/move land new strings in deprecated sections (#5332) 2026-08-14 11:45:50 -05:00
proto fix: play audio immediately when attached in the editor (#5320) 2026-08-13 13:50:58 +03:00
pylib test: Improve test coverage of notes.py and tags.py (#5412) 2026-08-28 17:51:15 +03:00
python Build and publish dev docs (#4579) 2026-03-31 08:26:59 -04:00
qt fix: explicitly specify qmenu arrow width (#5475) 2026-08-27 19:11:54 +03:00
rslib Fix: Ignore cards reviewed before settable to future values (#5294) 2026-08-27 16:25:03 +01:00
tools fix(ci): prevent silent skip of PR coverage-regression check on evicted baseline (#5480) 2026-08-30 21:07:18 -03:00
ts fix: avoid re-loading mathjax (#5416) 2026-08-27 19:17:41 +03:00
.complexipy.toml chore: Integrate Complexipy for complexity analysis (#4942) 2026-06-04 19:29:37 +03:00
.deny.toml chore: Fix advisory RUSTSEC-2026-0204 (#5129) 2026-07-09 13:04:37 +03:00
.dockerignore Add distroless Dockerfile and implement internal health check (#3366) 2024-08-29 17:05:33 +07:00
.dprint.json docs: Replace docs/ with symlinks (#5031) 2026-08-04 22:01:31 +03:00
.eslintrc.cjs Shift editor control to TypeScript (#4029) 2026-07-03 21:56:43 +03:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore chore: Integrate Complexipy for complexity analysis (#4942) 2026-06-04 19:29:37 +03:00
.gitmodules Briefcase Installer (#4629) 2026-05-05 17:29:18 -04:00
.mypy.ini chore: set strict_optional = True for editor_legacy.py (#5367) 2026-08-19 15:55:52 +03:00
.pre-commit-config.yaml chore: Run complexipy-diff as part of ninja check (#4987) 2026-06-10 21:04:15 +03:00
.prettierrc Switch back to Prettier for Svelte formatting 2025-01-13 15:53:55 +11:00
.python-version feat: Distribute compiled sources in Briefcase bundle (#4856) 2026-05-18 17:47:03 +03:00
.readthedocs.yaml Build and publish dev docs (#4579) 2026-03-31 08:26:59 -04:00
.ruff.toml Switch to Ruff (#4119) 2025-06-29 14:38:35 +07:00
.rustfmt-empty.toml Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.rustfmt.toml Move ascii_percent_encoding into a separate repo 2023-04-12 08:45:23 +10:00
.version 26.08.1 (#5281) 2026-08-06 19:16:54 +03:00
.yarnrc.yml chore: add release-age controls for uv and Yarn dependencies (#4761) 2026-04-30 13:38:42 -03:00
AGENTS.md chore: Updates just recipes and add AGENTS.md (#4943) 2026-06-03 12:02:18 -03:00
Cargo.lock chore(deps): bump quinn-proto from 0.11.14 to 0.11.16 (#5221) 2026-08-25 17:24:36 -03:00
Cargo.toml bump(deps): drop vulnerable h2 0.3.x, update h2 to 0.4.17 (RUSTSEC-2026-0258) (#5376) 2026-08-20 14:39:51 -03:00
check build: portability fixes for FreeBSD (#5300) 2026-08-11 13:13:56 +03:00
CLAUDE.md chore: Updates just recipes and add AGENTS.md (#4943) 2026-06-03 12:02:18 -03:00
CONTRIBUTORS fix: play audio immediately when attached in the editor (#5320) 2026-08-13 13:50:58 +03:00
justfile chore: Move complexipy out of Ninja checks (#5082) 2026-07-01 17:48:06 +03:00
LICENSE Clarify docs license (#5292) 2026-08-07 15:57:00 +03:00
ninja CI: Apply a consistent Cargo profile (#5133) 2026-08-12 10:17:29 +03:00
package.json chore(deps): bump the npm-minor-patch group across 1 directory with 13 updates (#5309) 2026-08-26 15:33:41 -03:00
playwright.config.ts fix(ci): fix flaky e2e editor tests caused by premature webServer readiness (#5116) 2026-07-07 10:20:43 +03:00
pyproject.toml test: Improve test coverage of notes.py and tags.py (#5412) 2026-08-28 17:51:15 +03:00
README.md PoC: evaluate SonarCloud as a code quality and coverage tool (#4996) 2026-08-26 15:48:45 -03:00
release.just chore: Move .github/scripts/*.py to tools/ (#5375) 2026-08-21 18:01:42 +03:00
run build: portability fixes for FreeBSD (#5300) 2026-08-11 13:13:56 +03:00
run.bat fix: Update allowed origins for recent Chromium (#5080) 2026-06-30 19:29:03 +03:00
rust-toolchain.toml chore: bump rust toolchain to 1.97.1 (#5316) 2026-08-11 14:06:50 +03:00
SECURITY.md Update security.md. (#4790) 2026-05-11 13:04:24 -04:00
sonar-project.properties PoC: evaluate SonarCloud as a code quality and coverage tool (#4996) 2026-08-26 15:48:45 -03:00
tsconfig.json Shift editor control to TypeScript (#4029) 2026-07-03 21:56:43 +03:00
uv.lock test: Improve test coverage of notes.py and tags.py (#5412) 2026-08-28 17:51:15 +03:00
yarn build: portability fixes for FreeBSD (#5300) 2026-08-11 13:13:56 +03:00
yarn.bat Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
yarn.lock chore(deps): bump brace-expansion from 1.1.16 to 1.1.18 (#5479) 2026-08-27 14:30:55 -03:00

Anki

Build Status Documentation Coverage

This repo contains the source code for the computer version of Anki.

About

Anki is a spaced repetition program. Please see the website to learn more.

Getting Started

Contributing

Want to contribute to Anki? Check out the Contribution Guidelines.

For more information on building and developing, please see Development.

Contributors

The following people have contributed to Anki: CONTRIBUTORS

Anki Betas

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see Anki betas.

License

Anki's license: LICENSE