mirror of
https://github.com/readest/readest.git
synced 2026-10-18 11:57:13 +00:00
1 commit
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
61ef15e005
|
ci: guard the e-ink identity whitelist against Rust/Kotlin drift (#6834)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* ci: guard the e-ink identity whitelist against Rust/Kotlin drift The e-ink device whitelist lives twice: as the Rust source of truth in eink_identity.rs (host app's e-ink device paths) and as the Kotlin port in the tauri-plugin-webview-upgrade submodule (the plugin's night-mode pin, readest/tauri-plugin-webview-upgrade#4). Both must classify devices identically, but until now nothing stopped one side from changing without the other - especially now that they sit in different repos. Adds a zero-dependency Node check that extracts the three lists (EINK_MANUFACTURERS / EINK_MODELS / EINK_AMBIGUOUS_MODELS) from both files and fails with the offending entries whenever they drift. Wired into the rust_lint job (whose checkout already includes submodules and whose src-tauri paths-filter fires for both the Rust file and the plugin submodule), plus a `check:eink-identity` package script for local runs. * ci: anchor the Rust whitelist extraction to line starts Same class of fix as the Kotlin extractor: a bracket inside an entry comment (e.g. // e-ink [A5] readers) truncated the non-greedy capture at the comment instead of the list end, producing false drift. Multi-line lists anchor the closing bracket to a line start; single-line lists use a bracket-free capture. * ci: address review findings on the identity sync guard - Run the sync check unconditionally: a PR touching only scripts/check-eink-identity-sync.mjs did not match the tauri paths-filter, so a checker regression could merge without the check running. The check is ~0.1s. - Strip // line comments before extracting quoted entries: a commented-out entry must not count as active on one side while still active on the other, or real drift is missed. - Anchor multi-line list openings to a newline (Rust `&[\n`, Kotlin `listOf(\n`): a multi-line match could previously start at a completed single-line declaration and capture through an unrelated later list. - Make all regexes CR/LF tolerant (`\r?\n`): a checkout with CRLF line endings made every list extraction fail outright. * docs(ci): add JSDoc to the identity sync guard functions |