Skip to content

Port app block asset path validation to Rust - #1402

Merged
NathanPJF merged 1 commit into
mainfrom
nathan/rust-app-block-asset-paths
Nov 16, 2026
Merged

NathanPJF merged 1 commit into
mainfrom
nathan/rust-app-block-asset-paths

Conversation

@NathanPJF

Copy link
Copy Markdown
Contributor

The Rust app-block asset size checks still accept paths outside the assets directory, while TypeScript rejects them after #1389. This causes 16 shared-spec failures in the Rust CI job on release PR #1401: for example, ../secret.txt produces a size or missing-file offense instead of an invalid asset-name offense.

Port TypeScript’s isAssetFileName guard using the existing Rust URI helpers. Both CSS and JavaScript checks now reject separators, decoded separators, dot paths and names whose resolved parent is not the assets directory, before checking file existence or reading its size. Offense messages and spans match TypeScript. Includes a patch changeset for the Rust crates.

Validation:

  • Before: shared check specs 1808/1824 passing, with the same 16 failures as release CI.
  • After: cargo test --workspace --locked passes, including check specs 1824/1824, parser specs 541/541, graph specs 15/15 and Liquid/Ruby parity 3600/3600. One existing unit test remains ignored.
  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets --locked -- -D warnings pass.
  • cargo publish --dry-run --workspace --locked passes; nothing was published.
  • Crate versions match crates/theme-check/package.json; git diff --check passes.

The existing shared specifications from #1389 cover the regressions; this PR changes only the Rust implementation and its release changeset. TypeScript/browser tests were not run locally. This resolves the diagnosed Rust-spec failure; it does not establish that every release CI job is green.

@NathanPJF
NathanPJF marked this pull request as ready for review November 16, 2026 20:11
@NathanPJF
NathanPJF requested a review from a team as a code owner November 16, 2026 20:11
@NathanPJF
NathanPJF merged commit 4e55b9e into main Nov 16, 2026
9 checks passed
@NathanPJF
NathanPJF deleted the nathan/rust-app-block-asset-paths branch November 16, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants