fix(config): use [server] in isolated profile roots - #170
TimeToBuildBob wants to merge 2 commits into
Conversation
[server-testing] in the same file as [server] is the pre-profile model. Isolated roots (activitywatch-testing/, activitywatch-research/, ...) already separate instances, so they get a single [server] section with the profile's default port, and settings.json without a suffix. Legacy shared-root testing still reads [server-testing] and settings-testing.json so existing installs are not orphaned. Refs: ActivityWatch/activitywatch#1434
Greptile SummaryThis PR changes isolated profile roots to use conventional, unsuffixed configuration resources while preserving the legacy shared-root testing layout.
Confidence Score: 4/5The PR is not yet safe to merge because isolated testing remains on the legacy configuration paths under the repository’s currently supported aw-core dependency. The new behavior relies on two aw-core directory helpers, but the dependency remains resolved to aw-core 0.5.18; the fallbacks then classify every testing profile as legacy and preserve the old section and filename. Files Needing Attention: aw_server/config.py, aw_server/settings.py, pyproject.toml, poetry.lock Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Resolve and export profile] --> B{Legacy shared testing root?}
B -- Yes --> C[Read server-testing section]
B -- Yes --> D[Read settings-testing.json]
B -- No --> E[Read server section]
B -- No --> F[Read settings.json]
Reviews (1): Last reviewed commit: "fix(config): use [server] in isolated pr..." | Re-trigger Greptile |
XDG_*_HOME only redirects platformdirs on Linux. The legacy-testing marker was planted under the XDG data path, so Windows/macOS never saw it and kept using [server] / settings.json.
🤖 AI code reviewThis PR changes how aw-server resolves config sections and settings filenames for named profiles. Isolated profile roots now use a single [server] section and bare settings.json, while the legacy shared-root testing layout keeps [server-testing] and settings-testing.json. It adds a _using_legacy_testing_root() helper that probes aw_core.dirs for legacy-testing detection, and updates tests to patch platformdirs getters for cross-platform isolation. Not safe to merge — 2 P1 openConfidence 2/5 3 findings · ❌ 2 P1 ·
|
Why
activitywatch#1434: Erik asked to check aw-server, which used
[server-testing]in the same file as prod. That is the pre-profile model. Isolated roots (activitywatch-testing/,activitywatch-research/, …) already separate instances, so a second section in the same file is the same class of bug as aw-qt readingconfig-<profile>.tomlwhile rust writesconfig.toml.What
[server]section with the profile's default port (5666 for testing, 5600 otherwise). The directory isolates;[server-testing]is not written there.config_section()returns[server]except in the legacy shared-root testing layout, where[server-testing]is kept so existing installs are not orphaned.settings.jsonis similarly bare in isolated roots;settings-testing.jsonremains legacy-only.Companion: ActivityWatch/aw-qt (tray/manager port lookup now reads isolated-root
config.toml/[server]).Tests
pytest tests/test_profile_config.py tests/test_profile.py: 41 passed.Refs: ActivityWatch/activitywatch#1434