feat(desktop): content-hash build stamp, --build-only / --force-build flags - #37597
Conversation
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-import |
1 |
First entries
hermes_cli/main.py:6920: [unresolved-import] unresolved-import: Cannot resolve imported module `pathspec`
✅ Fixed issues: none
Unchanged: 5015 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
teknium1
left a comment
There was a problem hiding this comment.
Approved. Content-hash build stamp is the right call — consistent with how the npm-install marker already compares lockfiles by content (not mtime) precisely because git checkouts touch mtimes.
Verified:
- Current with main, MERGEABLE.
- 16/16 tests pass with pathspec present.
- E2E against a real tree: gitignore pruning excludes node_modules/dist/logs, source edits flip the hash, ignored-file edits don't, stamp round-trips, and _desktop_build_needed is correct on missing-artifact / stale / clean-match.
Minor nits we may tidy on merge (non-blocking): loosen pathspec==1.1.1 to a range to match repo style, and a double-space typo in 'from pathspec import PathSpec'. Thanks for the clean PR and tests.
…-build flags Add a SHA-256 content-hash based build stamp to `hermes desktop` so unchanged source trees skip the npm install + build step. Uses pathspec for .gitignore-aware file matching instead of a hardcoded skip-list. New CLI flags: - --build-only: run the build but don't launch the app - --force-build: rebuild even when the stamp matches `hermes update` now calls `hermes desktop --build-only` so the desktop app is rebuilt (if needed) as part of the update flow. 16/16 tests passing.
f0bad96 to
c205018
Compare
…-linux-install feat(desktop): content-hash build stamp, --build-only / --force-build flags
feat(desktop): content-hash build stamp, --build-only / --force-build flags
…-linux-install feat(desktop): content-hash build stamp, --build-only / --force-build flags
…-linux-install feat(desktop): content-hash build stamp, --build-only / --force-build flags
…-linux-install feat(desktop): content-hash build stamp, --build-only / --force-build flags
…-linux-install feat(desktop): content-hash build stamp, --build-only / --force-build flags
…-linux-install feat(desktop): content-hash build stamp, --build-only / --force-build flags
What does this PR do?
Adds a content-hash based build stamp to
hermes desktopso unchanged source trees skip the expensivenpm install+npm run buildstep. Usespathspecfor.gitignore-aware file matching instead of a hardcoded skip-list, and introduces--build-onlyand--force-buildCLI flags. Wires--build-onlyintohermes updateso the desktop app is rebuilt (only if needed) as part of the update flow.Related Issue
Fixes #
Type of Change
Changes Made
hermes_cli/main.py— Added_compute_desktop_content_hash()using SHA-256 over theapps/desktop/source tree (plus rootpackage.json/package-lock.json), with.gitignorefiltering via pathspec. Added stamp read/write logic (desktop-build-stamp.json) that compares the current hash to the stored one. Added--build-onlyflag (build without launching) and--force-buildflag (rebuild even when stamp matches). Wiredhermes updateto callhermes desktop --build-only.pyproject.toml— Addedpathspecdependency.tests/hermes_cli/test_gui_command.py— 16/16 tests covering hash computation, stamp matching,--build-only,--force-build, and thehermes updateintegration.uv.lock— Lockfile update from addingpathspec.website/docs/user-guide/desktop.md— Minor doc update for new flags.How to Test
hermes desktop— launches normally; second run skips build (stamp matches).hermes desktop --force-build— forces a rebuild even if the stamp matches.hermes desktop --build-only— builds without launching the app.hermes update— rebuilds desktop only if source tree changed.pytest tests/hermes_cli/test_gui_command.py -q— 16/16 passing.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A