Repository navigation
fix(dirs): keep install-relative discovery paths out of the persisted defaults - #283
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@greptileai review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 209d882ffb
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
🤖 AI code reviewThis PR removes install-relative discovery paths (from get_install_discovery_paths) from the persisted defaults written by UserConfig::default() into config.toml, so that first-run config no longer pins paths like $APPDIR/usr/lib/aw-tauri/modules. It updates the Linux default module selection in lib.rs to still search install-relative paths at runtime when deciding whether aw-awatcher is available. It adds a Linux test that fakes an APPDIR mount and asserts those install paths are not present in get_discovery_paths(). Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads. 1 advisory finding (summary-only, not scored)These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.
This is a How this was verified: static preflight: fix-commit + touched-files scan (rule 7) Files changed (2) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
|
@greptileai review |
|
Checked My earlier review's “no test files” advisory was incorrect: the regression tests are inline in No code change or review retrigger from me. Greptile is green on this head; format, clippy, and release checks are still queued. I inspected the diff, but did not independently run the tests. |
1b7cf1e to
4bd0744
Compare
|
@greptileai review |
aw-tauri only descends into aw-* dirs when discovering modules, so the zip's `awatcher/` dir was never found; ship it as `aw-awatcher/`. Drop move-to-aw-modules.sh (copying into ~/aw-modules was a workaround for aw-tauri not looking next to the AppImage, fixed in ActivityWatch/aw-tauri#283) and rewrite README.txt for running in place.
|
Checked the revised scope at Your latest Greptile request completed at 5/5 on this head, with no new findings. Format, clippy, and all five release jobs are still queued. No code changes, merge, or additional review trigger from me; I did not independently run the Rust tests. |
|
@TimeToBuildBob review |
|
@greptileai review |
|
@TimeToBuildBob review |
|
@TimeToBuildBob review |
TimeToBuildBob
left a comment
There was a problem hiding this comment.
LGTM. The fix is correct and the scope is right.
Key invariants verified:
get_discovery_paths()no longer persists install-relative paths (deb/rpm lib dir, AppImage$APPDIR), so config.toml stays valid after move/reinstallUserConfig::Defaultexpands the search to include install paths at first-run time (thesearchvec in lib.rs) — bundled awatcher is still discovered, just not locked in- Test uses
AppDirGuardRAII to fake an AppImage mount, confirms APPDIR-rooted paths don't appear inget_discovery_paths()
The lib.rs change is Linux-only which is appropriate since the stale-mount bug is AppImage-specific. cargo clippy --all-targets -D warnings clean + 49 passing tests is sufficient CI for a focused dirs change.
TimeToBuildBob
left a comment
There was a problem hiding this comment.
Correct fix. The core invariant — install-relative paths are runtime-only, never persisted — is well-stated in the docstring and enforced by the test.
The lib.rs change is the right complement: default_linux_modules still searches both user and install paths to detect aw-awatcher (needed to set the right default), but only the user-level paths flow into the persisted config. The AppDirGuard test is thorough — it isolates the fake APPDIR scope and explicitly filters the exe's own dir from the assertion to avoid false positives when run from a user directory.
TimeToBuildBob
left a comment
There was a problem hiding this comment.
Correct fix. The core invariant — install-relative paths are runtime-only, never persisted — is well-stated in the docstring and enforced by the test.
The lib.rs change is the right complement: default_linux_modules still searches both user and install paths to detect aw-awatcher (needed to set the right default), but only the user-level paths flow into the persisted config. The AppDirGuard test is thorough — it isolates the fake APPDIR scope and explicitly filters the exe's own dir from the assertion to avoid false positives when run from a user directory.
… defaults UserConfig::default() wrote get_discovery_paths() into config.toml on first run, and that included the install-relative paths: the deb/rpm lib dir and $APPDIR (a per-run AppImage mount point). Saved config paths outrank runtime ones, so a later install elsewhere kept searching (and preferring) the first install's paths. The module manager already adds get_install_discovery_paths() at runtime, so drop them from the defaults; the first-run awatcher check still searches them.
It looped over get_install_discovery_paths(), which is empty on macOS/Windows and on Linux without an install layout, so it checked nothing. Fake an AppImage mount via APPDIR, assert the install paths are non-empty first, then assert none of them are in the persisted defaults. Linux-only, since that's the platform with install-relative paths.
42992ce to
5abecf3
Compare
On first run,
UserConfig::default()writesget_discovery_paths()intoconfig.toml. That list included the install-relative paths: the deb/rpm lib dir and$APPDIR, which is a different/tmp/.mount_*dir on every AppImage run. Saved config paths outrank the runtime ones, so after moving or reinstalling, aw-tauri kept searching (and preferring) the first install's paths.The module manager already adds
get_install_discovery_paths()at runtime (discover_modules), so this drops them from the persisted defaults. The first-run awatcher check still searches them. New test:test_discovery_defaults_exclude_install_paths.Scope change: this PR originally also discovered modules next to the
.AppImagefile (for the release zip layout). That's dropped. The AppImage should be self-contained and runnable from anywhere, with awatcher + aw-sync bundled inside it (ActivityWatch/activitywatch#1499), not depend on folders next to it. The review comment about persisting those paths led to the fix that remains here.cargo test --lib: 49 passed;cargo clippy --all-targets -D warningsclean (macOS; the Linux paths arecfg(any(target_os = "linux", test))).