Skip to content

Skip Node releases without a compatible archive - #2996

Merged
j178 merged 1 commit into
mainfrom
node-platform
Nov 2, 2026
Merged

j178 merged 1 commit into
mainfrom
node-platform

Conversation

@j178

@j178 j178 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Use Node's files metadata to skip releases without an archive for the current platform, while respecting version requests.

Refs #2994.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 14:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T16:04:03.955702Z d29ba9a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@j178 j178 added the bug Something isn't working label Nov 2, 2026 — with ChatGPT Codex Connector

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the updated Node archive selection logic.

No open issues 🎉

What changed in this PR

Updates Node installation to skip releases without a compatible platform archive, addressing the download failure reported in #2994 while respecting requested versions.

Changes:

  • Uses release files metadata to select an available archive before downloading.
  • Preserves the x64 fallback for Node versions below 16 on Apple Silicon.
  • Adds unit tests for platform availability, version constraints, and fallback behavior.
File Description
crates/​prek/​src/​languages/​node/​installer.rs Adds archive-aware release selection, passes the selected filename to downloads, and tests resolution behavior.

Review effort: Balanced

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.28571% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.27%. Comparing base (10e7648) to head (d29ba9a).

Files with missing lines Patch % Lines
crates/prek/src/languages/node/installer.rs 94.28% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2996      +/-   ##
==========================================
+ Coverage   94.24%   94.27%   +0.02%     
==========================================
  Files         149      149              
  Lines       31675    31770      +95     
==========================================
+ Hits        29853    29950      +97     
+ Misses       1822     1820       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@prek-ci-bot

prek-ci-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

📦 Cargo Bloat Comparison

Build: profiling + self-update (with debug info).

Metric Base (bytes) Head (bytes) Change
.text 13,030,144 13,152,896 +122,752 (+0.94%)
File 268,897,344 276,293,256 +7,395,912 (+2.75%)
Largest symbol changes

Increases

Symbol Base (bytes) Head (bytes) Change (bytes)
<prek::languages::deno::installer::DenoInstaller>::install::{closure#0} 0 25,881 +25,881
<prek::cli::UpdateArgs as clap_builder::derive::Args>::augment_args 0 23,882 +23,882
<prek::cli::Cli as clap_builder::derive::CommandFactory>::command 945 19,727 +18,782
<prek::languages::golang::installer::GoInstaller>::download::{closure#0} 0 17,101 +17,101
<prek::workspace::Project>::build_hooks::{closure#0}::{closure#0}::{closure#0}::<i16> 1,902 18,629 +16,727
<futures_util::stream::try_stream::try_collect::TryCollect<futures_util::stream::futures_unordered::FuturesUnordered<<prek::cli::run::run::HookRunSession>::run_project_level::{closure#0}::{closure#0}>, alloc::vec::Vec<(usize, prek::cli::run… 0 12,564 +12,564
<prek::cli::RunOptions as clap_builder::derive::Args>::augment_args 30,953 42,194 +11,241
<<serde_json::value::Value as serde_core::de::Deserialize>::deserialize::ValueVisitor as serde_core::de::Visitor>::visit_map::<&mut <serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA> 1,641 12,814 +11,173
<fancy_regex::Regex>::find_input_raw::<str> 436 11,290 +10,854
<fancy_regex::Regex>::captures_input_with_option_flags::<[u8]> 1,312 10,802 +9,490

Decreases

Symbol Base (bytes) Head (bytes) Change (bytes)
<prek::languages::deno::installer::DenoInstaller>::download::{closure#0} 19,985 0 -19,985
<prek::languages::golang::installer::GoInstaller>::install::{closure#0} 19,237 0 -19,237
<prek::hook::Hook>::from_spec::{closure#0} 51,211 33,478 -17,733
<prek::cli::GlobalArgs as clap_builder::derive::Args>::augment_args 13,267 0 -13,267
<<serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA as serde_core::de::MapAccess>::next_key_seed::<serde_json::value::de::KeyClassifier> 11,458 0 -11,458
fancy_regex::vm::run_with::<str, (usize, usize), fancy_regex::vm::run_spans<str>::{closure#0}> 11,345 0 -11,345
<prek::languages::deno::deno::Deno as prek::languages::LanguageBackend>::install::{closure#0} 15,281 4,108 -11,173
fancy_regex::vm::run_with::<[u8], alloc::vec::Vec<usize>, fancy_regex::vm::run<[u8]>::{closure#0}> 9,510 0 -9,510
fancy_regex::vm::run_with::<[u8], (usize, usize), fancy_regex::vm::run_spans<[u8]>::{closure#0}> 9,499 0 -9,499
<futures_util::stream::futures_unordered::FuturesUnordered<<prek::cli::run::run::HookRunSession>::run_project_level::{closure#0}::{closure#0}> as futures_core::stream::TryStream>::try_poll_next 8,449 0 -8,449

@prek-ci-bot

prek-ci-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

⚡️ Hyperfine Benchmarks

Summary: 0 regressions, 0 improvements above the 10% threshold.

Environment
  • OS: Linux 7.0.0-1017-azure
  • CPU: 4 cores
  • prek version: prek 0.5.9+17 (6775fdc 2026-11-02)
  • Rust version: rustc 1.99.1 (58cf8f9c3 2026-10-13)
  • Hyperfine version: hyperfine 2.0.0
CLI Commands

Benchmarking basic commands in the main repo:

prek --version

Command Mean Wall Time [ms] Change Factor
prek-base --version 2.0 ± 0.1
prek-head --version 2.0 ± 0.1 +0.9%

prek list

Command Mean Wall Time [ms] Change Factor
prek-base list 9.5 ± 0.5
prek-head list 9.6 ± 0.6 +0.5%

prek validate-config .pre-commit-config.yaml

⏭️ Skipped: .pre-commit-config.yaml not found

prek sample-config

Command Mean Wall Time [ms] Change Factor
prek-base sample-config 2.7 ± 0.1
prek-head sample-config 2.8 ± 0.3 +4.5%
Cold vs Warm Runs

Comparing first run (cold) vs subsequent runs (warm cache):

prek run --all-files (cold - no cache)

Command Mean Wall Time [ms] Change Factor
prek-base run --all-files 16.0 ± 0.4
prek-head run --all-files 16.1 ± 0.2 +0.4%

prek run --all-files (warm - with cache)

Command Mean Wall Time [ms] Change Factor
prek-base run --all-files 16.1 ± 0.5
prek-head run --all-files 16.1 ± 0.7 0.0%
Full Hook Suite

Running the builtin hook suite on the benchmark workspace:

prek run --all-files (full builtin hook suite)

Command Mean Wall Time [ms] Change Factor
prek-base run --all-files 15.9 ± 0.4
prek-head run --all-files 16.1 ± 0.5 +1.2%
Individual Hook Performance

Benchmarking each hook individually on the test repo:

prek run trailing-whitespace --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run trailing-whitespace --all-files 8.6 ± 0.6
prek-head run trailing-whitespace --all-files 8.6 ± 0.3 0.0%

prek run end-of-file-fixer --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run end-of-file-fixer --all-files 7.6 ± 0.2
prek-head run end-of-file-fixer --all-files 7.6 ± 0.1 +0.5%

prek run check-json --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-json --all-files 6.8 ± 0.2
prek-head run check-json --all-files 6.9 ± 0.2 +0.8%

prek run check-yaml --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-yaml --all-files 7.1 ± 0.2
prek-head run check-yaml --all-files 7.3 ± 0.5 +2.5%

prek run check-toml --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-toml --all-files 6.9 ± 0.2
prek-head run check-toml --all-files 6.9 ± 0.1 +0.9%

prek run check-xml --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-xml --all-files 7.0 ± 0.2
prek-head run check-xml --all-files 7.2 ± 0.8 +2.8%

prek run detect-private-key --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run detect-private-key --all-files 7.2 ± 0.2
prek-head run detect-private-key --all-files 7.5 ± 0.5 +3.8%

prek run fix-byte-order-marker --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run fix-byte-order-marker --all-files 7.5 ± 0.2
prek-head run fix-byte-order-marker --all-files 7.5 ± 0.2 0.0%
Installation Performance

Benchmarking hook installation (fast path hooks skip Python setup):

prek install-hooks (cold - no cache)

Command Mean Wall Time [ms] Change Factor
prek-base install-hooks 4.9 ± 0.2
prek-head install-hooks 4.8 ± 0.1 -1.9%

prek install-hooks (warm - with cache)

Command Mean Wall Time [ms] Change Factor
prek-base install-hooks 4.9 ± 0.1
prek-head install-hooks 4.9 ± 0.1 -0.4%
File Filtering/Scoping Performance

Testing different file selection modes:

prek run (staged files only)

Command Mean Wall Time [ms] Change Factor
prek-base run 10.3 ± 0.3
prek-head run 10.5 ± 0.5 +1.5%

prek run --files '*.json' (specific file type)

Command Mean Wall Time [ms] Change Factor
prek-base run --files '*.json' 5.7 ± 0.7
prek-head run --files '*.json' 5.5 ± 0.2 -2.9%
Workspace Discovery & Initialization

Benchmarking hook discovery and initialization overhead:

prek run --dry-run --all-files (measures init overhead)

Command Mean Wall Time [ms] Change Factor
prek-base run --dry-run --all-files 7.2 ± 0.5
prek-head run --dry-run --all-files 7.2 ± 0.6 +0.5%
Meta Hooks Performance

Benchmarking meta hooks separately:

prek run check-hooks-apply --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-hooks-apply --all-files 8.0 ± 0.1
prek-head run check-hooks-apply --all-files 8.3 ± 0.6 +4.0%

prek run check-useless-excludes --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-useless-excludes --all-files 8.0 ± 0.2
prek-head run check-useless-excludes --all-files 8.1 ± 0.3 +1.0%

prek run identity --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run identity --all-files 7.0 ± 0.9
prek-head run identity --all-files 7.2 ± 0.2 +3.0%

Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the update to select compatible Node.js release archives.

No open issues 🎉

Review effort: Balanced

@j178
j178 merged commit c88a1cc into main Nov 2, 2026
38 checks passed
@j178
j178 deleted the node-platform branch November 2, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants