• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sds / overcommit / 23701571476
92%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 29 Mar 2026 04:42AM UTC
Jobs 6
Files 220
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Mar 2026 04:41AM UTC coverage: 91.547% (+0.5%) from 91.09%
23701571476

push

github

web-flow
Use Etc.nprocessors and handle sandboxed environments (#876)

## Summary

- Replace OS-specific `processor_count` implementation with Ruby's
`Etc.nprocessors`
- Rescue `Errno::EPERM`/`ENOENT` in `parent_command` when `ps` is
unavailable

## Motivation

The current `processor_count` method shells out to OS-specific commands
(`sysctl`, `/proc/cpuinfo`, `hwprefs`, etc.) to detect CPU count. This
was copied from the [parallel
gem](https://github.com/grosser/parallel/blob/v1.6.1/lib/parallel/processor_count.rb#L17-L51)
in 2015 when supporting older Ruby versions was necessary.

Ruby's `Etc.nprocessors` has been available since Ruby 2.2 (2014), and
overcommit requires Ruby 2.6+. It works cross-platform without shelling
out, which also fixes failures in sandboxed environments (e.g. macOS
Seatbelt) where `sysctl` calls are blocked at the syscall level —
causing `processor_count` to return 0 and breaking all hook validation.

Similarly, `parent_command` shells out to `ps` which can fail with
`Errno::EPERM` in sandboxed environments. The rescue returns `nil`,
which the caller (`amendment?`) already handles — hooks run against all
staged files instead of only amended ones.

3 of 4 new or added lines in 1 file covered. (75.0%)

3249 of 3549 relevant lines covered (91.55%)

2266.52 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
92.86
14.04% lib/overcommit/utils.rb
Jobs
ID Job ID Ran Files Coverage
1 ruby3.3-ubuntu - 23701571476.1 29 Mar 2026 04:42AM UTC 440
91.52
GitHub Action Run
2 ruby3.0-ubuntu - 23701571476.2 29 Mar 2026 04:43AM UTC 440
91.49
GitHub Action Run
3 ruby3.2-ubuntu - 23701571476.3 29 Mar 2026 04:42AM UTC 440
91.46
GitHub Action Run
4 ruby3.1-ubuntu - 23701571476.4 29 Mar 2026 04:42AM UTC 440
91.46
GitHub Action Run
5 ruby2.6-ubuntu - 23701571476.5 29 Mar 2026 04:42AM UTC 440
91.49
GitHub Action Run
6 ruby2.7-ubuntu - 23701571476.6 29 Mar 2026 04:43AM UTC 440
91.49
GitHub Action Run
Source Files on build 23701571476
  • Tree
  • List 220
  • Changed 219
  • Source Changed 1
  • Coverage Changed 219
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23701571476
  • 2c00752e on github
  • Prev Build on main (#15985806402)
  • Next Build on main (#23784857626)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc