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

nvidia-holoscan / holoscan-cli / 28948349701
79%

Build:
DEFAULT BRANCH: main
Ran 08 Jul 2026 01:58PM UTC
Jobs 1
Files 35
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

08 Jul 2026 01:57PM UTC coverage: 77.878% (+0.2%) from 77.72%
28948349701

push

github

web-flow
fix: destructive-boundary guard for clear-cache (#198)

* fix: add destructive-boundary guard to clear-cache

`clear-cache` fed shutil.rmtree() with directories derived from
env-overridable roots (HOLOSCAN_CLI_BUILD_PARENT_DIR / _DATA_DIR) and
repo-root globs, with no safety boundary. A hostile or fat-fingered
value such as `HOLOSCAN_CLI_BUILD_PARENT_DIR=/` made the command report
`Would remove: /` and, without --dryrun under root, would wipe the
filesystem.

Add `_is_safe_to_remove()`: canonicalize each candidate and refuse it
unless it is (1) not a critical anchor (`/`, $HOME, the repo root) or an
ancestor of one, and (2) at or under an approved cache root (the repo
tree, the build parent dir, or the data dir). Refused paths print a
`Refusing to remove:` notice and are skipped.

Also fix the policy regression where `test --clear-cache` forwarded the
test namespace directly: with build/data/install unset, clear-cache
treated it as "clear everything" including downloaded data. Select
build/install explicitly, matching historical HoloHub behavior.

Add destructive-boundary tests covering /, $HOME, the repo root, an
ancestor of the repo root, the happy path, and data preservation on
`test --clear-cache`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: tolerate an unresolvable home directory in the clear-cache guard

Path.home() raises RuntimeError when the home directory cannot be
determined; treat it as a best-effort anchor lookup so clear-cache
still runs its removal checks with the remaining anchors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: promote _resolve to utils.io.resolve and simplify the guard tests

Move the path canonicalizer into holoscan_cli.utils.io as a public
helper, condense the guard docstrings/comments, collapse the four-way
dangerous-root parametrize into one loop, and make the test_cmd
forwarding test stop deterministically via a SystemExit sentinel
instead of a catch-all pytest.raises(Ex... (continued)

29 of 30 new or added lines in 3 files covered. (96.67%)

3010 of 3865 relevant lines covered (77.88%)

0.78 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.08
-1.92% src/holoscan_cli/commands/clear_cache.py
Jobs
ID Job ID Ran Files Coverage
1 28948349701.1 08 Jul 2026 01:58PM UTC 35
77.88
GitHub Action Run
Source Files on build 28948349701
  • Tree
  • List 35
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28948349701
  • c99ba99b on github
  • Prev Build on main (#28870100459)
  • Next Build on main (#29017885525)
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