mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 07:29:19 -04:00
fix/remove-comment-issue-example
202 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0db33b0df5 | fix(ci): ignore HTML comments when detecting linked issues | ||
|
|
ad88eff794 |
chore: Move .github/scripts/*.py to tools/ (#5375)
## Linked issue Closes #5374 ## Summary Move .github/scripts to tools/ so they are included in static checking and testing. ## Steps to reproduce (before) - Make a formatting/typing error in prepare_release.py and confirm `ninja check` does not report that. - Modify test_validate_version.py to fail tests and confirm it's not caught by ninja check. ## How to test (after) The scripts should now be included in the checks as the tools/ directory is already included by the build system. |
||
|
|
29ffaaed47 |
fix: missing issue bot does not allow url in linked issues (#5287)
[Example](https://regex101.com/?regex=%5Cb%28closes%7Cclose%7Cclosed%7Cfixes%7Cfix%7Cfixed%7Cresolves%7Cresolve%7Cresolved%7Crefs%7Cref%7Creferences%29%3A%3F%5Cs%2B%28%3F%3A%28%3F%3A%5Ba-zA-Z0-9_.-%5D%2B%5C%2F%5Ba-zA-Z0-9_.-%5D%2B%29%3F%23%5Cd%2B%7Chttps%3F%3A%5C%2F%5C%2Fgithub%5C.com%5C%2F%5Ba-zA-Z0-9_.-%5D%2B%5C%2F%5Ba-zA-Z0-9_.-%5D%2B%5C%2Fissues%5C%2F%5Cd%2B%29&testString=closes+https%3A%2F%2Fgithub.com%2Fankitects%2Fanki%2Fissues%2F5285%0A&flags=gm&flavor=pcre2&delimiter=%2F) closes #5286 |
||
|
|
3c9b1daf35 |
CI: Apply a consistent Cargo profile (#5133)
## Linked issue Related: https://github.com/ankitects/anki/pull/5102#issuecomment-4923922894 ## Summary / motivation This adds a new Cargo profile (`ci`) for use in all Rust build commands on CI. The goal is to reduce unnecessary recompilation of the same crates in dev/release profiles. ## Steps to reproduce (before) View the logs of the last CI run on main and notice that some crates are getting compiled with the `release` profile, e.g. compilation ends with "Finished `release` profile [optimized]". ## How to test (after) View the logs of the last CI run in this PR and confirm all Rust compilation commands end with "Finished `ci` profile [unoptimized]", indicating that only a single profile is being used. ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. - [ ] I added or updated tests when the change is non-trivial or behavior changed. ## Scope - [x] This PR is focused on one change (no unrelated edits). |
||
|
|
abd339a59f |
fix: minilints exclusion for docs changes is not working (#5315)
## Linked issue Follow-up fixes to #5267 ## Summary #5267 didn't work reliably as can be seen in #5158 due to two issues: 1. The `files` option is not set, which made `any_changed` always evaluate to `true`. 2. The `*.md` and `*.mdx` patterns only matched root files. ## How to test Hard to verify locally, but here's a POC written by Claude. Save as `micromatch-files-ignore-poc.cjs` in the root directory and run using: `npm install micromatch && node micromatch-files-ignore-poc.cjs`. <details> <summary>POC</summary> ```js // POC: tj-actions/changed-files' `files_ignore`-only config never filters // anything, because it hands micromatch an array of ONLY negated patterns. // // Run with: // node micromatch-files-ignore-poc.cjs // // Requires the `micromatch` package to be resolvable (the version actually // used by tj-actions/changed-files@v47.0.6 is 4.0.8). If you don't have it // globally, run this from inside a project that depends on it (e.g. the // anki repo root), or `npm install micromatch` next to this file first. const mm = require("micromatch"); function assert(cond, msg) { if (!cond) { throw new Error("FAILED: " + msg); } console.log("ok - " + msg); } // This mirrors ci.yml's `Check for non-documentation changes` step, which // sets only `files_ignore` (no `files`), and the 14 files actually changed // in https://github.com/ankitects/anki/pull/5158 ("docs: fix typos"). const changedFiles = [ "docs-site/addons/support.mdx", "docs-site/developers/development.mdx", "docs/development.md", "rslib/backend/lib.rs", // stand-in for a real, non-doc source file ]; // Copied verbatim from .github/workflows/ci.yml's files_ignore list. const filesIgnoreOnly = [ "!**.md", "!**.mdx", "!docs/**/*.png", "!docs/**/*.svg", "!docs-site/**/*.png", "!docs-site/**/*.jpg", "!docs-site/**/*.svg", "!docs-site/**/*.mp4", ]; // This is the exact call tj-actions/changed-files makes internally // (getFilteredChangedFiles in dist/index.js) to decide which changed files // "count" for the `any_changed` output. const matchOpts = { dot: true, windows: false, noext: true }; console.log("--- Bug 1: files_ignore with no positive `files` pattern ---"); const filteredIgnoreOnly = mm(changedFiles, filesIgnoreOnly, matchOpts); console.log("input files: ", changedFiles); console.log("filesIgnore: ", filesIgnoreOnly); console.log("matched (kept):", filteredIgnoreOnly); assert( filteredIgnoreOnly.length === changedFiles.length, "an ignore-only pattern array matches EVERY file, including the ones " + "it was supposed to exclude (docs/*.md, docs-site/*.mdx) -- any_changed " + "is always 'true'", ); console.log(); console.log("--- Bug 2: adding a positive base, but keeping bare `**.md` ---"); const filesWithBadGlobstar = [ "**", // positive base pattern, as tj-actions' own README recommends pairing ...filesIgnoreOnly, ]; const filteredBadGlobstar = mm(changedFiles, filesWithBadGlobstar, matchOpts); console.log("patterns: ", filesWithBadGlobstar); console.log("matched (kept):", filteredBadGlobstar); assert( filteredBadGlobstar.includes("docs/development.md"), "bare `**.md` (globstar with no following '/') fails to exclude a " + "nested path once it's negated inside an array match -- " + "'docs/development.md' incorrectly survives", ); console.log(); console.log("--- Fix: positive `**` base + `**/*.md` (slash before the star) ---"); const filesFixed = [ "**", "!**/*.md", "!**/*.mdx", "!docs/**/*.png", "!docs/**/*.svg", "!docs-site/**/*.png", "!docs-site/**/*.jpg", "!docs-site/**/*.svg", "!docs-site/**/*.mp4", ]; const filteredFixed = mm(changedFiles, filesFixed, matchOpts); console.log("patterns: ", filesFixed); console.log("matched (kept):", filteredFixed); assert( filteredFixed.length === 1 && filteredFixed[0] === "rslib/backend/lib.rs", "with a positive `**` base and `**/*.ext` patterns, only the real " + "non-doc file survives -- any_changed correctly becomes 'false' for " + "docs-only PRs like #5158", ); console.log(); console.log("All assertions passed: files_ignore-only config in ci.yml never"); console.log("filters anything, so minilints can never actually be skipped."); ``` </details> |
||
|
|
ade1066690 |
chore: replace prepare-release workflow with local script (closes #5273) (#5288)
Closes #5273 ## Summary - Replaces `.github/workflows/prepare-release.yml` with `.github/scripts/prepare_release.py`, a script run locally by the maintainer - Removes the need for the `RELEASE_TOKEN` personal access token - Script performs the same steps: version validation, CI status check, duplicate tag/release check, translation sync, and version commit + push --------- Co-authored-by: Abdo <abdo@abdnh.net> |
||
|
|
8bf7d91a50 |
chore: exclude docs contributions from BSD license check (#5267)
<!-- Title (for the Pull Request title field at the top): Use a short prefix so the change type is obvious. You do not need to repeat it in the body below. Examples: - fix: — bugfix - feat: — feature - refactor: — internal change without user-facing feature - docs: — documentation only - chore: — tooling, CI, deps, build housekeeping - test: — tests only --> ## Linked issue (required) Fixes #5265 <!-- Fixes #123 / Closes #123 / Refs #123 --> ## Summary / motivation (required) The document only changes are under the CC BY-SA 4 license, therefore no need to enforce BSD 3 license contribution agreement. <!-- What this PR does and why. For larger changes, add enough context for reviewers. --> ## Steps to reproduce (required, use N/A if not applicable) N/A <!-- Steps to reproduce: how to trigger the bug in the broken state (the "before"). - Mainly for bugfixes; - For bugs: numbered steps before the fix. For non-bugs: write N/A. - use N/A for features, refactors, docs, chore, etc. --> ## How to test (required) End-to-end local GH action: 1. Install the [act](https://github.com/nektos/act) tool to run GH action locally 2. Install ubuntu container: `podman pull ghcr.io/catthehacker/ubuntu:act-24.04` 3. Create a clean working tree from this branch: `git checkout -b test-docs` 4. Add a doc only change: `echo x >> README.md && git add README.md` 5. Commit the changes: `git -c user.email=nobody@example.com commit -m "docs only"` 6. Run the minilints step: `act -j minilints --container-daemon-socket unix:///tmp/podman.sock -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:act-24.04` 7. The log should contain the "Run minilints" step. <!--- How to test: how you verified the change (checks, unit tests, manual steps, edge cases — the "after" or general validation). ---> ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. - [x] I added or updated tests when the change is non-trivial or behavior changed. ### Details <!-- Commands, manual steps, edge cases, and what you observed --> ## Before / after behavior (optional) Before: The documentation only changes trigger the contribution agreement check. After: If the changes are documentation only, it workflow skips the contribution check. <!-- For bugfixes: behavior before vs after. For other types: N/A or a short note. --> ## Risk / compatibility / migration (optional) N/A <!-- Breaking changes, rollout notes, or N/A for small / low-risk PRs --> ## UI evidence (required for visual changes; otherwise N/A) N/A <!-- Screenshot or short video --> ## Scope - [x] This PR is focused on one change (no unrelated edits). |
||
|
|
3fb9c41597 |
chore(ci): reduce dependabot noise with quarterly schedule and major grouping (#5280)
## What - Change dependabot `interval` from `monthly` to `quarterly` for all ecosystems (Cargo, npm, Python, GitHub Actions) - Add separate groups for major bumps (`rust-major`, `npm-major`, `python-major`) so they arrive as a single grouped PR instead of individual ones - Add `semver-major-days: 30` cooldown for major bumps on all versioned ecosystems ## Why Version update PRs were accumulating faster than the team could review them. Two issues were causing this: 1. Minor/patch grouped PRs were opened monthly. Try moving it to quarterly may match the actual review cadence better 2. Major bumps fell outside the minor/patch group and opened as individual PRs per package, adding noise Security updates are unaffected: they still open immediately regardless of the schedule, as they bypass the interval setting by design. |
||
|
|
066c91c037 |
chore(ci): bump the actions group across 1 directory with 14 updates (#5272)
Bumps the actions group with 14 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/github-script](https://github.com/actions/github-script) | `7.1.0` | `9.0.0` | | [actions/checkout](https://github.com/actions/checkout) | `4.3.1` | `7.0.1` | | [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) | `1.16.1` | `1.17.0` | | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `94527f2e458b27549849d47d273a16bec83a01e9` | `37802adc94f370d6bfd71619e3f0bf239e1f3b78` | | [actions/setup-node](https://github.com/actions/setup-node) | `4.4.0` | `7.0.0` | | [actions/cache](https://github.com/actions/cache) | `4.3.0` | `6.1.0` | | [actions/cache/restore](https://github.com/actions/cache) | `4.3.0` | `6.1.0` | | [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.83.0` | `2.85.3` | | [actions/cache/save](https://github.com/actions/cache) | `4.3.0` | `6.1.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.1` | | [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `47.0.0` | `47.0.6` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4.3.0` | `8.0.1` | | [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.14.0` | `1.14.1` | | [azure/artifact-signing-action](https://github.com/azure/artifact-signing-action) | `1.2.0` | `2.0.0` | Updates `actions/github-script` from 7.1.0 to 9.0.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/github-script/releases">actions/github-script's releases</a>.</em></p> <blockquote> <h2>v9.0.0</h2> <p><strong>New features:</strong></p> <ul> <li><strong><code>getOctokit</code> factory function</strong> — Available directly in the script context. Create additional authenticated Octokit clients with different tokens for multi-token workflows, GitHub App tokens, and cross-org access. See <a href="https://github.com/actions/github-script#creating-additional-clients-with-getoctokit">Creating additional clients with <code>getOctokit</code></a> for details and examples.</li> <li><strong>Orchestration ID in user-agent</strong> — The <code>ACTIONS_ORCHESTRATION_ID</code> environment variable is automatically appended to the user-agent string for request tracing.</li> </ul> <p><strong>Breaking changes:</strong></p> <ul> <li><strong><code>require('@actions/github')</code> no longer works in scripts.</strong> The upgrade to <code>@actions/github</code> v9 (ESM-only) means <code>require('@actions/github')</code> will fail at runtime. If you previously used patterns like <code>const { getOctokit } = require('@actions/github')</code> to create secondary clients, use the new injected <code>getOctokit</code> function instead — it's available directly in the script context with no imports needed.</li> <li><code>getOctokit</code> is now an injected function parameter. Scripts that declare <code>const getOctokit = ...</code> or <code>let getOctokit = ...</code> will get a <code>SyntaxError</code> because JavaScript does not allow <code>const</code>/<code>let</code> redeclaration of function parameters. Use the injected <code>getOctokit</code> directly, or use <code>var getOctokit = ...</code> if you need to redeclare it.</li> <li>If your script accesses other <code>@actions/github</code> internals beyond the standard <code>github</code>/<code>octokit</code> client, you may need to update those references for v9 compatibility.</li> </ul> <h2>What's Changed</h2> <ul> <li>Add ACTIONS_ORCHESTRATION_ID to user-agent string by <a href="https://github.com/Copilot"><code>@Copilot</code></a> in <a href="https://redirect.github.com/actions/github-script/pull/695">actions/github-script#695</a></li> <li>ci: use deployment: false for integration test environments by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/github-script/pull/712">actions/github-script#712</a></li> <li>feat!: add getOctokit to script context, upgrade <code>@actions/github</code> v9, <code>@octokit/core</code> v7, and related packages by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/github-script/pull/700">actions/github-script#700</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/Copilot"><code>@Copilot</code></a> made their first contribution in <a href="https://redirect.github.com/actions/github-script/pull/695">actions/github-script#695</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/github-script/compare/v8.0.0...v9.0.0">https://github.com/actions/github-script/compare/v8.0.0...v9.0.0</a></p> <h2>v8.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update Node.js version support to 24.x by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/github-script/pull/637">actions/github-script#637</a></li> <li>README for updating actions/github-script from v7 to v8 by <a href="https://github.com/sneha-krip"><code>@sneha-krip</code></a> in <a href="https://redirect.github.com/actions/github-script/pull/653">actions/github-script#653</a></li> </ul> <h2>⚠️ Minimum Compatible Runner Version</h2> <p><strong>v2.327.1</strong><br /> <a href="https://github.com/actions/runner/releases/tag/v2.327.1">Release Notes</a></p> <p>Make sure your runner is updated to this version or newer to use this release.</p> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> made their first contribution in <a href="https://redirect.github.com/actions/github-script/pull/637">actions/github-script#637</a></li> <li><a href="https://github.com/sneha-krip"><code>@sneha-krip</code></a> made their first contribution in <a href="https://redirect.github.com/actions/github-script/pull/653">actions/github-script#653</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/github-script/compare/v7.1.0...v8.0.0">https://github.com/actions/github-script/compare/v7.1.0...v8.0.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|
|
3893c2fb71 |
chore(ci): replace use of EmbarkStudios/cargo-deny-action (#5180)
Refs #5134 This brings down the total time taken for the cargo-deny check from ~45s to ~4s while avoiding the issue brought up in https://github.com/ankitects/anki/pull/4593#discussion_r2947572847 |
||
|
|
39e4f919d1 |
fix(ci): re-verify PR state before auto-closing to prevent race conditions (#5213)
## Linked issue Refs #5189 ## Summary / motivation The `auto-close-missing-issue` cron was closing PRs that had already had their `missing-issue` label removed, including PRs with a valid linked issue. ## Before / after behavior **Before**: PRs could be closed even after contributors linked an issue, due to a stale snapshot from the initial pagination. **After**: the cron re-verifies each PR's current state immediately before closing, eliminating the race condition. |
||
|
|
b7d2b2fb52 |
chore(ci): run checks on arm linux, intel mac, and arm windows (#5102)
## Linked issue Closes #5017 ## Summary / motivation We currently run CI on Linux x64 (`ubuntu-24.04`), Apple Silicon macOS (`macos-latest`), and Windows x64 (`windows-latest`), but not on ARM Linux, Intel Mac, or ARM Windows. This adds those three platforms so regressions specific to them are caught before release. This PR is purely additive: no existing job is modified. Following the existing macOS/Windows pattern, the new jobs are opt-in: they run on push to `main`/`release/**`, on `workflow_dispatch`, or on PRs carrying the matching label (`check:linux`, `check:macos`, `check:windows`). This keeps everyday PRs cheap while still exercising every platform on main and before release. --------- Co-authored-by: Abdo <abdo@abdnh.net> |
||
|
|
f13c15aef0 |
fix: build bundled fcitx5 plugin against the bundled Qt (#5142)
## Linked issue (required) Fixes #5110 ## Summary / motivation (required) CI builds the fcitx5 plugin against one Qt but ships it inside PyQt6's Qt — a version mismatch that crashes Anki on startup for every fcitx5 user. **Root cause:** the plugin subclasses `QPlatformInputContext`, a Qt private API with no ABI guarantee across minor versions. Built against Qt 6.2.4 headers but run inside Qt 6.11.0, it dereferences a misplaced member and SIGSEGVs on first focus. **Solution:** build the plugin against the same Qt as the bundled `pyqt6-qt6` and install it where the packaging step (`qt/tools/build_installer.py`) looks. The per-flag reasoning is in the commit message. ## Steps to reproduce (required, use N/A if not applicable) 1. On a Linux desktop configured to use fcitx5 as the input method, install the official Anki 26.05 release. 2. Launch Anki normally. 3. It dies with SIGSEGV on startup, as soon as the main window takes focus. ## How to test (required) ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. - [ ] I added or updated tests when the change is non-trivial or behavior changed. ### Details `release.yml` is `workflow_dispatch`-only, so it can't run on the PR. I reproduced its build step locally: rebuilt the plugin against Qt 6.11.0 (confirmed the `Qt_6.11` ELF tag and a clean `dlopen(RTLD_NOW)`), dropped it into an Anki 26.05 bundle, and typed Chinese and Japanese without the crash. ## Risk / compatibility / migration (optional) 1. Fixes `build-linux-x86` only. `build-linux-arm-installer` installs a prebuilt `fcitx5-frontend-qt6` from apt, built against Ubuntu's Qt rather than the bundled 6.11.0 — the same class of mismatch. I have no arm hardware to confirm or fix it, so it's left for a follow-up. 2. Adds an `aqtinstall` step (~1.5 GB Qt download) to the Linux release build. 3. **Not validated on CI.** `release.yml` is `workflow_dispatch`-only, so an external contributor can't run it; only its build step is reproduced locally (see How to test). **Please confirm it in a real release build.** ## UI evidence (required for visual changes; otherwise N/A) N/A ## Scope - [x] This PR is focused on one change (no unrelated edits). |
||
|
|
8130c34aa4 |
ci: Fix some issues in the sync_translations.py script (#5161)
Fix some issues in sync_translations.py caught while making the beta release. |
||
|
|
65274b2a4e |
chore(ci): use prebuilt binaries for cargo-llvm-cov and cargo-nextest (#5141)
## Linked issue (required) Refs #5134 ## Summary / motivation (required) When running ci, instead of manually compiling cargo-llvm-cov and cargo-nextest when not cached, this pr pulls them in as prebuilt binaries instead ## Steps to reproduce (required, use N/A if not applicable) N/A ## How to test (required) CI should pass, and running `./check` and `just test --coverage` should work locally too ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. - [ ] I added or updated tests when the change is non-trivial or behavior changed. ### Details Continuing from https://github.com/ankitects/anki/issues/5134#issuecomment-4936603431, we can avoid installing the crates globally when run locally, but in ci it doesn't really matter so we can use install-action as per normal. W.r.t nextest's features, all `default-no-update` does is remove its ability to self-update. Since we're puling in prebuilt binaries during ci there's no difference I've left out n2 for now, as without a release workflow on its repo or on anki's fork, we'd still have to compile it ourselves (caching it can be unsafe, but it sort of is already cached by setup-rust-toolchain?) ## Scope - [x] This PR is focused on one change (no unrelated edits). |
||
|
|
d5db1ac19d |
Fix invalid GHA permission in check-linked-issue.yml (#5118)
See https://github.com/ankitects/anki/pull/5113#issuecomment-4901556237 |
||
|
|
257ea825b8 |
fix(ci): handle cross-repo refs and exempt org members from linked-issue check (#5113)
## Summary / motivation Two independent gaps in the `check-linked-issue` workflow caused false positives on valid PRs: 1. **Cross-repo references not recognised** — the regex only matched bare `#NNN` but GitHub also accepts `owner/repo#NNN`. Any PR referencing an issue from another repository (e.g. `Refs ankitects/ankimobile#10`) was still flagged. Observed in #5111. 2. **Org members should be trusted contributors** — maintainers and core team members already know the process; requiring them to link an issue on every PR adds friction with no benefit. The check now calls the GitHub membership API and skips the requirement for org members entirely. ## Steps to reproduce 1. Open a PR with `Refs ankitects/ankimobile#10` as the linked issue → bot flags it as missing. 2. Open a PR as an org member without a linked issue → bot should not flag it. ## How to test 1. Open a draft PR from an external contributor with `Refs owner/repo#NNN` → verify **no** `missing-issue` label. 2. Open a draft PR as an org member with no linked issue → verify **no** label or comment. 3. Open a draft PR as an external contributor with no linked issue → verify label and comment **are** applied. |
||
|
|
eb854e9ceb |
fix(ci): clean up bot noise when linked issue is added (#5089)
## Summary / motivation Two related bugs in the `check-linked-issue` workflow caused unnecessary noise on PRs: 1. **Wrong keywords**: the regex only accepted `closes`, `fixes`, and `resolves` variants, but the PR template explicitly shows `Refs #123` as a valid option. Any PR using `Refs #NNN`, `Ref #NNN`, or `References #NNN` was incorrectly flagged. Observed in #5087. 2. **Stale bot comment**: once the contributor added an issue link and the `missing-issue` label was removed, the bot's warning comment remained visible on the PR, creating unnecessary noise. ## Steps to reproduce (required, use N/A if not applicable) 1. Open a PR with `Refs #<open issue>` in the linked issue section (following the template hint). 2. Bot applies `missing-issue` label and posts a comment despite the issue being referenced. 3. Edit the PR description to use `Closes #NNN` instead, label is removed but the bot comment stays. ## How to test (required) 1. Open a draft PR with no issue link → verify label and comment are applied. 2. Edit the description to add `Refs #NNN` → verify label and comment are both removed. 3. Repeat with `Closes #NNN`, `Fixes #NNN`, `References #NNN`. ## Risk / compatibility / migration No Risk, CI workflow only. |
||
|
|
88600a6826 |
chore: Do not fail CI if Complexipy fails (#5060)
Avoid failing CI if Complexipy fails, as we're still evaluating if the tool is useful for us and do not want it to unnecessarily hinder work. Results are still visible as inline comments thanks to GitHub's [code scanning](https://docs.github.com/en/code-security/reference/code-scanning/sarif-files/sarif-support) feature. (Example: https://github.com/ankitects/anki/pull/5041#discussion_r3438418621) |
||
|
|
0d7b3fdd96 |
feat: Remove the uv launcher and old packaging code (#5019)
## Linked issue Closes #4556 Closes #4557 Closes #4144 Closes #4151 Closes #4152 Closes #4153 Closes #4229 Closes #4356 Closes #4401 Closes #4403 Closes #4519 Closes #4523 Closes #4390 Closes #4414 Closes #4484 ## Summary / motivation After 4 months of exploring Briefcase for packaging, we're confident it solves most problems with the uv launcher with less complexity and at a lower maintenance cost, especially with the parallel work on the release CI, which we already used to make 5 releases. This also removes platform-specific packaging/signing code used to produce macOS dmg files and Windows NSIS installers, which is now largely handled by Briefcase and the release CI. The custom install scripts for Linux are mostly preserved under qt/installer/linux-template and used in the Briefcase build. ## How to test - [ ] No build problems. - [ ] The `tools/build-installer` scripts still work. - [ ] No CI/release workflow issues. - [ ] No user-visible changes in dev environment and Briefcase build. |
||
|
|
fb0215a2c1 |
Prototype unified Mintlify docs site (#4882)
## Summary - add a generated `docs-site/` Mintlify proof of concept for a unified Anki docs site - migrate the desktop manual, AnkiMobile docs, FAQs, add-on docs, translation docs, release notes, legacy docs, and repo-local Sphinx/MyST developer docs into the POC tree - add a migration helper that preserves mdBook ordering, handles common MDX incompatibilities, and regenerates the landing-page-inspired Mintlify styling - apply minimal styling based on the current Anki landing page: Anki logo, Hanken Grotesk, blue primary color, subtle surfaces, and compact nav treatment ## Validation - `uv run --with ty ty check tools/mintlify_poc_migrate.py` - `source ~/.nvm/nvm.sh && nvm use 22.15.0 && mint validate` - previewed locally with `mint dev --port 3000` and checked the home page/developer docs in browser ## Notes This is intentionally a draft POC. It does not remove the existing Sphinx or mdBook docs flows yet; it demonstrates what bringing the sources into this repo and building from a single Mintlify root could look like. --------- Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com> Co-authored-by: Abdo <abdo@abdnh.net> |
||
|
|
a4308206ad |
chore: Run complexipy-diff as part of ninja check (#4987)
## Linked issue Closes #4986 Closes #4985 ## Summary - Move the complexipy-diff check to Ninja so it can be run locally as part of `./ninja check`. - Fix [SARIF](https://docs.github.com/en/code-security/reference/code-scanning/sarif-files/sarif-support) results not being uploaded if the Complexipy check fails. ## Steps to reproduce (before) complexipy-diff was only run on CI and pre-push automatically. It was not covered by ninja check, which is not consistent with most tests and tools. ## How to test (after) - Run `./ninja check:complexipy-diff` and confirm it passes. - Introduce some complex Python change (e.g. add some nested if statements) so that the check fails now. - Update your pre-commit config: `./out/extracted/uv/uv run pre-commit install`. |
||
|
|
9dca79de1f |
Rerun check-linked-issue.yml on labeled event (#4979)
This triggers the check-linked-issue.yml workflow on the `labeled` event, so that if the `hotfix` label is added later after the PR is opened, the workflow is rerun. |
||
|
|
918004570b |
chore(ci): use pull_request_target to fix write perms on fork PRs (#4977)
## Summary / motivation The `check-linked-issue` workflow was triggering with the `pull_request` event. This caused the step "Apply missing-issue label and comment" to fail with: > HttpError: Resource not accessible by integration Switching to `pull_request_target` makes the workflow run in the context of the base repository instead of the fork, so the declared write permissions are honoured. The change is safe because this workflow never checks out PR code. It only reads PR metadata (body, labels) through the API. There is no risk of running untrusted code with elevated permissions. ## Steps to reproduce 1. Open a PR from an external fork that has no linked issue. 2. Observe the "Check Linked Issue" CI job failing with `HttpError: Resource not accessible by integration`. ## Before / after behavior **Before:** workflow crashes on every fork PR that lacks a linked issue. **After:** workflow applies the label and posts the comment as intended. |
||
|
|
8034ebc160 |
chore: Tweak gh release name (#4964)
Remove "Anki" from the titles of releases. |
||
|
|
f5d9b9ef3c |
chore: Integrate Complexipy for complexity analysis (#4942)
## Linked issue Closes #4815 ## Summary This adds [Complexipy](https://github.com/rohaquinlop/complexipy) for detecting complex Python code: - The `check:complexity` Ninja actions use a high threshold (50) for now to avoid failing on existing complex code. - `just complexipy-diff` is intended for linting new code in PR CI and uses 15 as the threshold. See https://rohaquinlop.github.io/complexipy/usage-guide/#ratchet-mode ## How to test - Run `./ninja check:complexity` locally and confirm it passes. - Test diff mode: `just complexipy-diff main`. |
||
|
|
c71c13b56e |
fix: prevent duplicate "missing linked issue" comments on PR edits (#4937)
Fixes #4936 ## Problem The `check-linked-issue` workflow runs on every `opened` and `edited` PR event. When a PR had no linked issue, each edit triggered a new bot comment, resulting in duplicates (e.g. #4934). ## Solution Before posting the comment, list the existing PR comments and skip posting if the bot has already left one with the same message. The `missing-issue` label re-application is harmless since GitHub deduplicates labels automatically. |
||
|
|
fc5103bc33 |
chore(ci):Use commit SHAs for github actions (#4916)
<!-- Title (for the Pull Request title field at the top): Use a short prefix so the change type is obvious. You do not need to repeat it in the body below. Examples: - fix: — bugfix - feat: — feature - refactor: — internal change without user-facing feature - docs: — documentation only - chore: — tooling, CI, deps, build housekeeping - test: — tests only --> ## Linked issue (required) <!-- Fixes #123 / Closes #123 / Refs #123 --> closes #4722 ## Summary / motivation (required) <!-- What this PR does and why. For larger changes, add enough context for reviewers. --> I used this nice script I found: https://gist.github.com/onnimonni/3462f958c7d235417863651974514525 For the reasons behind this change see: - #4722 ## Steps to reproduce (required, use N/A if not applicable) <!-- Steps to reproduce: how to trigger the bug in the broken state (the "before"). - Mainly for bugfixes; - For bugs: numbered steps before the fix. For non-bugs: write N/A. - use N/A for features, refactors, docs, chore, etc. --> (N/A) ## How to test (required) <!--- How to test: how you verified the change (checks, unit tests, manual steps, edge cases — the "after" or general validation). ---> See it run in my repo here: https://github.com/Luc-Mcgrady/anki/actions/runs/26718877866 ### Checklist (minimum) - [X] I ran `./ninja check` or an equivalent relevant check locally. - [ ] I added or updated tests when the change is non-trivial or behavior changed. ### Details <!-- Commands, manual steps, edge cases, and what you observed --> ## Before / after behavior (optional) <!-- For bugfixes: behavior before vs after. For other types: N/A or a short note. --> ## Risk / compatibility / migration (optional) <!-- Breaking changes, rollout notes, or N/A for small / low-risk PRs --> ## UI evidence (required for visual changes; otherwise N/A) <!-- Screenshot or short video --> ## Scope - [X] This PR is focused on one change (no unrelated edits). |
||
|
|
60dcc5f3c5 |
fix: Update GitHub environments (#4912)
## Linked issue Closes #4911 ## Summary Update release/publish workflows to use the new environments. |
||
|
|
4702443f31 |
ci: enforce linked issue requirement on PRs (#4910)
## Linked issue Closes #4816 ## Summary / motivation Adds two workflows to enforce the rule that every PR must be linked to an existing issue: - **check-linked-issue**: triggers on PR open/edit, applies the `missing-issue` label and notifies the author if no linked issue is found. Removes the label if the author later links one. - **auto-close-missing-issue**: runs daily and closes any PR that has had the `missing-issue` label for more than 4 days. Hotfixes (title contains `hotfix`) and Dependabot PRs are exempt. ## How to test 1. Open a PR without a linked issue, the `missing-issue` label should be applied and a comment posted. 2. Edit the PR description to add `Closes #<number>`, the label should be removed. 3. Trigger the auto-close workflow manually via Actions → `Auto-close PRs without linked issue` → Run workflow, and verify it closes PRs that have had the label for over 4 days. |
||
|
|
3f6378aee7 |
ci(coverage): fail PR if line coverage regresses (#4876)
## Linked issue Closes #4874 ## Summary / motivation Adds `tools/coverage/check-coverage-regression.py` to compare line coverage percentages from the current PR against the baseline saved from main (introduced in #4875). If any stack regresses beyond the configured tolerance (0.10%), the CI fails with a clear message showing the delta. Stacks checked: Rust, python-pylib, python-qt, TypeScript. ## How to test Try to add some new code without any tests. The Ci must fail. ## Before / after behavior Before: no signal when a PR reduces coverage below the current main level. After: CI fails on `Check coverage regression` with output like: ``` [rust] REGRESSION: 62.64% -> 61.00% (delta: -1.64%, tolerance: 0.10%) 1 stack(s) with coverage regression: rust ``` |
||
|
|
a754a9c847 |
feat: Bundle Fcitx plugin (#4886)
## Linked issue Closes #4873 ## Summary Build and package the fcitx5-qt6 plugin. Latest release CI run: https://github.com/ankitects/anki/actions/runs/26294296416 ## How to test 1. Run installer build on Linux: `./ninja installer:build`. 2. Go to the Qt build directory (`out/installer/build/anki/linux/zip/anki/app_packages/PyQt6/Qt6`) and confirm you see the following files: 1. `plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so` 2. `plugins/dbusaddons/libFcitx5Qt6DBusAddons.so*` |
||
|
|
3ca006dd47 |
chore(CI): cache coverage baseline from main for regression checks (#4875)
## Linked issue Refs #4874 ## Summary / motivation Stores the coverage results from every push to `main` in a GitHub Actions cache (`coverage-baseline-linux-{sha}`). This is the foundation for a follow-up PR that will compare PR coverage against this baseline and fail if any stack regresses. No behavior change for PRs yet — the baseline is only saved, not used. ## Before / after behavior Before: no coverage data persisted between CI runs. After: each push to `main` saves `out/coverage/` as a cache entry, keyed by commit SHA, retrievable by prefix `coverage-baseline-linux-`. |
||
|
|
a140d39329 |
chore(e2e): add Playwright end-to-end test infrastructure (#4864)
## Linked issue Closes #4863 ## Summary / motivation Adds Playwright as the e2e test framework so contributors can write browser-based tests against a real headless Anki instance. There was no automated way to exercise mediasrv pages, SvelteKit routes, or the `/_anki/` RPC surface from a browser, this PR establishes that harness. Key pieces: - `qt/tests/launch_anki_for_e2e.py` — spawns a throwaway Anki instance (temp `ANKI_BASE`, `QT_QPA_PLATFORM=offscreen`). Pre-seeds `prefs21.db` so Anki skips the language picker and profile chooser and goes straight to serving mediasrv. - `playwright.config.ts` — points `webServer` at the launcher; polls `/favicon.ico` as the readiness probe. - `ts/tests/e2e/` — `fixtures.ts` base and a sanity spec that verifies mediasrv is reachable and a SvelteKit page hydrates. - `justfile` — `just test-e2e` recipe; Chromium installed to `out/playwright-browsers/`. - CI — e2e step in `check-linux`; failed-run artifacts uploaded for 7 days. - `docs/e2e-testing.md` — contributor guide covering setup, managed vs reuse-server modes, and writing new tests. ## How to test Build the project once, then run the e2e suite in managed mode (no separate `./run` needed — the launcher is started automatically): ```shell just build just test-e2e ``` ## Before / after behavior (optional) Before: no browser-level test harness existed. After: `just test-e2e` drives a real headless Anki instance via Playwright. ## Risk / compatibility / migration No production code changed. New dev-only files and CI step only. Chromium is installed to `out/playwright-browsers/` (gitignored) and does not affect the regular build. --------- Co-authored-by: Abdo <abdo@abdnh.net> |
||
|
|
1394540217 |
test: Add tests for build_installer.py (#4868)
## Linked issue Closes #4859 ## Summary Add tests for the build_installer.py script with 100% coverage. ## How to test Run `just test-py --coverage --html` and browse coverage data. |
||
|
|
f76fcec48f |
feat: add Rust test coverage (#4842)
## Linked issue Closes #4839 ## Summary / motivation Adds `cargo-llvm-cov`-based test coverage for the full Rust workspace. Introduces `just test-rust --coverage` and `just test-rust --coverage --html`, and wires Rust into the `just test --coverage` umbrella. `cargo-llvm-cov` is installed on demand into `out/bin/` to avoid polluting the global cargo install. The `llvm-tools-preview` rustup component is now installed in CI so the tool can instrument binaries. ## How to test (required) ```sh # Existing behavior unchanged just test-rust # Terminal summary just test-rust --coverage # Terminal summary + HTML report under out/coverage/rust/html/ just test-rust --coverage --html # Umbrella (Rust + Python) just test --coverage just test --coverage --html ``` Note: first run of `--coverage` will install `cargo-llvm-cov` into `out/bin/` (~30s). Subsequent runs skip the install step. ### Checklist - [x] I ran `./ninja check` or an equivalent relevant check locally. ### Details - `cargo-llvm-cov` pinned at `0.8.4`, installed into `out/bin/` via `cargo install --root out`. - `--workspace --locked` measures all crates and respects the lockfile. - `llvm-tools-preview` added to `setup-anki` action so CI can instrument Rust binaries. - Coverage runs are slower than plain `just test-rust` because `cargo-llvm-cov` rebuilds with instrumentation — this is expected. ## Before / after behavior Before: no `just test-rust`, no Rust coverage support. After: `just test-rust` runs Rust tests via ninja; `just test-rust --coverage` runs them with `cargo-llvm-cov` --------- Co-authored-by: Abdo <abdo@abdnh.net> |
||
|
|
2ea8e5731a |
feat: add Python test coverage (#4841)
## Linked issue Closes #4838 ## Summary/motivation Adds `coverage.py`-based test coverage for both Python test suites (`pylib` and `qt`). Introduces `just test-py --coverage` and `just test-py --coverage --html`, plus the `just test --coverage`. Coverage reports are written to `out/coverage/`. ## How to test ```sh # Existing behavior unchanged just test-py # Terminal summary + enforces thresholds just test-py --coverage # Terminal summary + HTML reports under out/coverage/ just test-py --coverage --html # Umbrella (Python only for now) just test --coverage just test --coverage --html ``` ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. ### Details - `coverage` dependency pinned to >=7.13.5 in pyproject.toml. - The `coverage` umbrella recipe currently delegates to Python only for now ## Before / after behavior Before: no `just test-py`, no coverage support. After: `just test-py` runs Python tests via ninja; `just test-py --coverage` runs them with `coverage.py` and enforces minimum line coverage. --------- Co-authored-by: Abdo <abdo@abdnh.net> |
||
|
|
c48c36a16c |
fix: Generate release notes from correct tag (#4814)
Pass the `--notes-start-tag` argument to `gh release` with the latest release tag. Without this, the 26.05b1 release was including notes for the 25.09.2 release for some reason. |
||
|
|
3e4f70d017 |
Fix audio package publishing (#4799)
A follow-up to #4664 Last run: https://github.com/ankitects/anki/actions/runs/25575366970 Confirmed macOS signing is set up correctly by extracting the wheels and running `codesign -dvvv` on the mpv/lame binaries. |
||
|
|
428406d8a6 |
Release infrastructure improvements (#4802)
- Run CI automatically on `release/**` branches - Update just recipes: require `--ref`, add `--version` to prepare, add `testpypi`/`pypi` recipes - Document release branch workflow and update releasing docs - Add `sphinxcontrib-mermaid` for Sphinx doc rendering |
||
|
|
a3aaacf5cc |
Add a workflow for publishing audio wheel to PyPI (#4664)
Add a workflow for publishing the anki-audio wheel to PyPI |
||
|
|
cd2f15b4ee |
feat: Enable Windows ARM64 support for Briefcase (#4798)
## Linked issue #4678 ## Summary This enables native Windows ARM64 builds for Briefcase. Depends on #4797 ## How to test - Run `./tools/ninja installer` in a Windows ARM64 machine. - Check the architecture of the installer under `./out/installer/dist` by going to Properties > Compatibility and confirming emulation settings are disabled. - Install the package and confirm Anki.exe is a native binary. - Open Anki, go to the [debug console](https://docs.ankiweb.net/misc.html#debug-console) and run the following code to check the architecture of the Python build: ```python import platform print(platform.machine(), platform.python_compiler()) ``` |
||
|
|
f9570d31c2 |
ci: support releases from non-main branches (#4794)
Closes #4793 - Add `workflow_dispatch` trigger to CI (with macOS/Windows support) - Allow prepare-release and release workflows from any branch - Add `skip-ci-check` input for hotfix releases - Add `just release::prepare` and `just ci` recipes - Make `qt/release/build.sh` find uv in CI and local builds - Change publish-testpypi environment from testpypi to release - Add anki-release wheel build step --------- Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> |
||
|
|
5a9b54e938 |
Briefcase Installer (#4629)
migrates Anki Desktop packaging from the legacy NSIS/uv-based installer to [BeeWare Briefcase](https://briefcase.readthedocs.io/). This branch integrates work from many related issues and PRs to deliver cross-platform native installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with code signing, notarization, and file association support. ## Integrated PRs - #4585 — Set up Briefcase - #4596 — Add Briefcase icons - #4598 — Handle Briefcase file associations - #4601 — Add Briefcase app permissions - #4609 — Customize Briefcase's MSI installer - #4616 — Set up Briefcase code signing and notarization - #4618 — Fix Briefcase packaging for x86 Macs - #4623 — Customize Briefcase's Linux template - #4627 — List required Debian packages for Briefcase installer - #4630 — Update Briefcase's Windows template - #4631 — Rewrite Linux install/uninstall scripts for PyInstaller - #4638 — Use PyInstaller on Linux - #4645 — Update installer docs - #4654 — Disable Briefcase's universal builds for macOS - #4672 — Deal with existing NSIS installations in MSI installer - #4676 — Remove duplicate Briefcase icons - #4677 — Tweak Linux scripts for new installer - #4709 — Add anki-console.bat to Briefcase's Windows package ## Related Issues - #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution - #4678 — Support native Windows ARM64 builds for Briefcase - #4688 — Linux installer: migrate to PyInstaller and rewrite install scripts - #4689 — Investigate startup performance with Briefcase - #4690 — Specify required Linux system packages for Briefcase - #4691 — Investigate Windows ARM64 support with Briefcase - #4692 — Test on Linux ARM with Briefcase - #4693 — Separate ARM and Intel macOS releases - #4694 — Update developer documentation for Briefcase installer - #4695 — Support upgrade/downgrade with the Briefcase installer - #4696 — Update user documentation for new installer - #4702 — Update Briefcase's Windows template with upstream security fix and OS version check - #4703 — Follow-up tweaks to Linux install/uninstall scripts ## Related PRs - #4619 — Enable Windows ARM64 support - #4632 — Release action --------- Co-authored-by: Abdo <abdo@abdnh.net> Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com> Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com> |
||
|
|
7d8dc01722 |
chore: add release-age controls for uv and Yarn dependencies (#4761)
## Linked issue Issue related #4747 ## Summary/motivation Add `[tool.uv]` `exclude-newer` + `required-version`, regenerate `uv.lock`; bump bundled uv binaries in `python.rs`; bump **Yarn** and `npmMinimalAgeGate`; remove --no-config from pyenv uv sync --locked so it matches the lockfile. ## How to test - [ ] ./ninja check - [ ] yarn install |
||
|
|
0974c09b22 |
chore(ci): raise dependabot open-pull-requests-limit to 3 (#4746)
## What - Set `open-pull-requests-limit` to **3** for each `package-ecosystem` in [`.github/dependabot.yml`](.github/dependabot.yml) so we allow a few more concurrent Dependabot version-update PRs per stack while still bounding review load. ## Why - A slightly higher cap lets more ecosystems progress in parallel when the queue is healthy, without going back to the default (5) or an unbounded backlog of open PRs. |
||
|
|
bb64088d62 |
Chore: add Dependabot config with monthly grouped updates (#4726)
## Linked issue (required) Partially related to #4722 ## Summary/motivation (required) Weekly (by default), Dependabot checks for updates and opens a PR for each dependency update. This generates numerous PRs that require human review time and GitHub Actions overhead. By adding the Dependabot configuration file, we changed the frequency to monthly and grouped the PRs by ecosystem. ## Scope This PR does: - [x] Fewer open dependency PRs (minor/patch grouped per ecosystem) - [x] Less CI / GitHub Actions churn (monthly cadence + fewer PRs) - [x] Clearer review queue (updates batched by Rust / JS / Python / Actions) This PR does not: ❌ Group major version bumps (still separate PRs) ❌ Shorten individual CI runs |
||
|
|
c7679305a4 |
Add a standardized pull request template (#4655)
This PR introduces a standardized pull request template setup to improve review quality and consistency. ## Summary - Adds a new default PR template at `.github/pull_request_template.md`. - Standardizes PR submissions with consistent sections for context and validation. - Establishes a single source of truth for PR guidance. ## Why - A unified template improves review quality and consistency. - It reduces ambiguity for contributors when describing changes and test coverage. - Centralizing guidance makes future maintenance simpler. |
||
|
|
b96506633e |
Revert changes to contributor check (#4656)
## Changes Revert changes to the CONTRIBUTORS file check introduced in https://github.com/ankitects/anki/pull/4593#discussion_r2908422240 The main problem with checking the actual emails in the file instead of the git log is that the check will inevitably fail when the PR author occasionally makes a commit using the GitHub UI. The solution for this used to be to also make a change to the file using the GitHub UI. This stopped working after the recent change, except if the author lists multiple emails. |
||
|
|
a2d07a32c0 |
Only run cargo-deny if there are dependency changes (#4644)
Only run cargo-deny on CI if there are dependency changes in a PR **or** it's the main branch. |