Skip to content

Make custom CA certificates replace default roots - #2964

Open
j178 wants to merge 1 commit into
mainfrom
certs
Open

j178 wants to merge 1 commit into
mainfrom
certs

Conversation

@j178

@j178 j178 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Non-empty SSL_CERT_FILE/SSL_CERT_DIR now replace all default roots, even when loading yields no certificates. Add PREK_SYSTEM_CERTS with PREK_NATIVE_TLS as a deprecated alias, and report HTTP client initialization failures as CLI errors.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 14:11

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-10-26T14:13:41.088244Z b36e70c PR opened
ℹ️ 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 breaking Breaking changes label Oct 26, 2026 — with ChatGPT Codex Connector
@j178
j178 deployed to release October 26, 2026 14:12 — with GitHub Actions Active
@j178 j178 added the enhancement New feature or request label Oct 26, 2026 — with ChatGPT Codex Connector
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.20253% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.19%. Comparing base (36f4502) to head (b36e70c).

Files with missing lines Patch % Lines
crates/prek/src/http.rs 97.05% 2 Missing ⚠️
crates/prek/src/languages/python/uv.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2964      +/-   ##
==========================================
- Coverage   94.19%   94.19%   -0.01%     
==========================================
  Files         147      147              
  Lines       31109    31155      +46     
==========================================
+ Hits        29304    29347      +43     
- Misses       1805     1808       +3     

☔ 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.

@j178
j178 deployed to release October 26, 2026 14:20 — with GitHub Actions Active
@prek-ci-bot

prek-ci-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

📦 Cargo Bloat Comparison

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

Metric Base (bytes) Head (bytes) Change
.text 12,881,568 12,973,088 +91,520 (+0.71%)
File 273,021,016 273,396,592 +375,576 (+0.14%)
Largest symbol changes

Increases

Symbol Base (bytes) Head (bytes) Change (bytes)
<prek::cli::UpdateArgs as clap_builder::derive::Args>::augment_args 0 23,882 +23,882
prek::archive::unzip::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0} 105,104 126,371 +21,267
<prek::cli::Cli as clap_builder::derive::CommandFactory>::command 721 18,872 +18,151
<prek::languages::node::installer::NodeInstaller>::download::{closure#0} 0 16,210 +16,210
<prek::workspace::Project>::build_hooks::{closure#0}::{closure#0}::{closure#0}::<i16> 18,295 34,295 +16,000
<prek::languages::node::node::Node as prek::languages::LanguageBackend>::install::{closure#0} 8,340 19,480 +11,140
<prek::cli::RunOptions as clap_builder::derive::Args>::augment_args 29,932 41,043 +11,111
<<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> 0 10,733 +10,733
<core::future::poll_fn::PollFn<prek::http::download_artifact_with<<prek::languages::golang::installer::GoInstaller>::download::{closure#0}::{closure#0}, prek::http::download_artifact<<prek::languages::golang::installer::GoInstaller>::downlo… 685 7,878 +7,193
<prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands 87,769 94,385 +6,616

Decreases

Symbol Base (bytes) Head (bytes) Change (bytes)
<prek::languages::node::installer::NodeInstaller>::install::{closure#0} 26,442 0 -26,442
prek::archive::unpack::<fs_err::tokio::file::File, &std::path::PathBuf>::{closure#0} 76,497 50,976 -25,521
<prek::hook::Hook>::from_spec::{closure#0} 32,386 16,177 -16,209
<prek::cli::GlobalArgs as clap_builder::derive::Args>::augment_args 12,887 0 -12,887
<<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> 12,814 1,641 -11,173
<toml::de::deserializer::value::ValueDeserializer as serde_core::de::Deserializer>::deserialize_option::<serde_core::de::impls::OptionVisitor<prek::config::pattern::FilePattern>> 4,439 635 -3,804
<tokio::future::maybe_done::MaybeDone<prek::http::download_to_temp_file<<prek::languages::ruby::installer::RubyInstaller>::download::{closure#0}::{closure#1}>::{closure#0}> as core::future::future::Future>::poll 3,581 0 -3,581
<tokio::future::maybe_done::MaybeDone<prek::http::download_to_temp_file<prek::http::download_artifact<<prek::languages::rust::rustup::Rustup>::download::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>::{closure#0}> as core::future::fut… 3,539 0 -3,539
<tokio::future::maybe_done::MaybeDone<<prek::languages::golang::installer::GoInstaller>::download::{closure#0}::{closure#0}::{closure#0}<i16>> as core::future::future::Future>::poll 2,697 0 -2,697
<<serde_saphyr::de::deserializer::YamlDeserializer as serde_core::de::Deserializer>::deserialize_map::MA>::deserialize_recorded_key::<serde_json::value::de::KeyClassifier> 3,422 913 -2,509

@prek-ci-bot

prek-ci-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

⚡️ Hyperfine Benchmarks

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

Environment
  • OS: Linux 6.17.0-1022-azure
  • CPU: 4 cores
  • prek version: prek 0.5.7+34 (cc6ab6a 2026-10-26)
  • 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.2 ± 0.1
prek-head --version 2.2 ± 0.1 -3.7%

prek list

Command Mean Wall Time [ms] Change Factor
prek-base list 9.4 ± 0.3
prek-head list 9.5 ± 0.8 +1.4%

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.6 ± 0.3
prek-head sample-config 2.7 ± 0.4 +0.7%
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 17.9 ± 0.6
prek-head run --all-files 17.8 ± 0.5 -0.9%

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

Command Mean Wall Time [ms] Change Factor
prek-base run --all-files 17.7 ± 0.2
prek-head run --all-files 17.7 ± 0.4 +0.5%
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 17.7 ± 0.4
prek-head run --all-files 17.9 ± 0.8 +1.1%
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 9.2 ± 0.8
prek-head run trailing-whitespace --all-files 8.8 ± 0.2 -5.2%

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.9 ± 0.1
prek-head run end-of-file-fixer --all-files 7.9 ± 0.2 +0.4%

prek run check-json --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-json --all-files 6.9 ± 0.1
prek-head run check-json --all-files 7.1 ± 0.5 +1.9%

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.2 ± 0.3 +1.1%

prek run check-toml --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-toml --all-files 7.0 ± 0.3
prek-head run check-toml --all-files 7.1 ± 0.1 +1.3%

prek run check-xml --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run check-xml --all-files 7.0 ± 0.1
prek-head run check-xml --all-files 6.9 ± 0.2 -2.5%

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

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

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.4 -0.7%
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.7 ± 0.1
prek-head install-hooks 4.7 ± 0.1 -1.6%

prek install-hooks (warm - with cache)

Command Mean Wall Time [ms] Change Factor
prek-base install-hooks 5.2 ± 0.9
prek-head install-hooks 4.6 ± 0.1 -10.2%

✅ Performance improvement for prek install-hooks (warm - with cache): 10.2200% faster

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.7 ± 0.2
prek-head run 10.5 ± 0.2 -1.6%

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

Command Mean Wall Time [ms] Change Factor
prek-base run --files '*.json' 5.3 ± 0.1
prek-head run --files '*.json' 5.3 ± 0.2 -1.2%
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.1 ± 0.2
prek-head run --dry-run --all-files 7.1 ± 0.2 -0.4%
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.8 ± 0.4
prek-head run check-hooks-apply --all-files 8.4 ± 0.2 -5.0%

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

Command Mean Wall Time [ms] Change Factor
prek-base run check-useless-excludes --all-files 8.7 ± 0.2
prek-head run check-useless-excludes --all-files 8.5 ± 0.2 -3.1%

prek run identity --all-files

Command Mean Wall Time [ms] Change Factor
prek-base run identity --all-files 7.3 ± 0.2
prek-head run identity --all-files 7.5 ± 0.4 +2.7%

This branch was successfully deployed

1 active deployment
release — b36e70cc Deployed Oct 26, 2026 by j178 via build-docker / Build Alpine Docker image #7031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants