Regexes with super-linear backtracking (S8786 x16) are rewritten to stay linear on long runs; each new pattern gives the same results as the old one on 150k-450k fuzzed inputs (except where noted) and finishes adversarial 50k-character inputs in under 3 ms: - tag-generator QUALIFIER_SUFFIX_RE starts just before a `:`/space run (`(^|[^:\s])…` + "$1"), never inside one - timeline-parser matches `line.trimEnd()` with a greedy label, and renders with trimEnd(); cleanCpuName collapses whitespace before the patterns - editor-store endings, Google Play urlPattern (lookahead for `id=`), channel-phrase punctuation, SPDX OR/AND split, legal-docs slug and link stripping (link text/URL may not contain `[`), base64url padding, and a loop for trailing slashes in the worker router Others: - S2871: sorts take the shared code-unit comparator (same order as before; THIRD_PARTY_NOTICES is unchanged) - S4822: ErrorBoundary catches the logger import with .catch(), which a try/catch never could - S3516: migrateProfilesState returns a new object - S7773: Number.parseInt (x10) - S9379: Modal takes an initialFocusRef (Radix onOpenAutoFocus), so the shortcut search box gets focus without an autoFocus attribute - S2245: generateId drops the Math.random fallback; getRandomValues exists everywhere the app runs, and a non-random ID is worse than an error - S4036: NOSONAR on the dev script's `git` call (PATH lookup by design) - S6505/S8543: every workflow installs with `npm ci --ignore-scripts`, and CI runs `npm run cf:check` instead of `npx wrangler …` - S6358: Android sets allowBackup="false" — app data is no longer copied to Google Drive backups; Backup & Restore moves it to a new phone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
2.6 KiB
YAML
79 lines
2.6 KiB
YAML
name: Rust
|
|
|
|
# The Tauri shell changes rarely, so this only runs when it does (or weekly,
|
|
# to catch new RustSec advisories). Not a required check for that reason.
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "src-tauri/**"
|
|
- ".github/workflows/rust.yml"
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "src-tauri/**"
|
|
- ".github/workflows/rust.yml"
|
|
schedule:
|
|
- cron: "41 4 * * 1"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: rust-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install Linux dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev \
|
|
libayatana-appindicator3-dev librsvg2-dev patchelf
|
|
# Pinned to a commit on master, with the toolchain passed explicitly: the
|
|
# action's `stable` branch is regenerated from master, which orphans any
|
|
# SHA pinned there (zizmor: impostor-commit). Master keeps its history.
|
|
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
|
with:
|
|
workspaces: src-tauri
|
|
# tauri::generate_context!() embeds the frontend at compile time, so
|
|
# clippy and the tests need a built dist/.
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: npm
|
|
- run: npm ci --ignore-scripts
|
|
- run: npm run build
|
|
- name: rustfmt
|
|
working-directory: src-tauri
|
|
run: cargo fmt --all -- --check
|
|
- name: clippy
|
|
working-directory: src-tauri
|
|
run: cargo clippy --all-targets --locked -- -D warnings
|
|
- name: test
|
|
working-directory: src-tauri
|
|
run: cargo test --locked
|
|
|
|
# RustSec advisories, license allowlist, duplicate/banned crates and
|
|
# registry sources for the whole crate tree (src-tauri/deny.toml).
|
|
cargo-deny:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
|
|
with:
|
|
manifest-path: src-tauri/Cargo.toml
|
|
command: check advisories licenses sources
|