feat(profile): add --profile flag and port/settings isolation - #167
feat(profile): add --profile flag and port/settings isolation#167TimeToBuildBob wants to merge 2 commits into
Conversation
--testing stays as an alias for --profile testing. The profile is exported as AW_PROFILE before config load so aw-core dirs isolate data/config; settings keep the existing -testing filename suffix and named profiles get the same shape. /api/0/info reports profile. The default profile unsets AW_PROFILE rather than setting it to "default", because aw-core suffixes any non-empty value (so AW_PROFILE=default would become activitywatch-default). Part of ActivityWatch/activitywatch#1399.
Greptile SummaryThis PR adds named server profiles while preserving the existing default and testing behavior.
Confidence Score: 5/5The PR appears safe to merge because no unacknowledged blocking failure remains. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
CLI[CLI flags] --> Resolve[Resolve and validate profile]
Resolve --> Export[Export or unset AW_PROFILE]
Export --> Config[Load profile configuration]
Config --> Section[Select server profile section]
Section --> Runtime[Create runtime settings]
Runtime --> Server[Start server and datastore]
Server --> API[Expose profile through info API]
Reviews (2): Last reviewed commit: "chore: lock aw-core 0.5.17 (latest PyPI)" | Re-trigger Greptile |
Profile-aware dirs from ActivityWatch/aw-core#149 are on git master but not on PyPI — 0.5.17 was cut in 2024. AW_PROFILE export is a no-op until the next aw-core release; this lock bump is just current PyPI.
|
@greptileai review |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
|
Automated merge handoff for
This head is ready for maintainer review and manual merge. Project monitoring |
Part of ActivityWatch/activitywatch#1399 (isolated profiles per edition/mode).
Python aw-server half of the profile work.
--profile NAMEpicks the instance;--testingis an alias for--profile testing. Existing behaviour is unchanged for no-flag and--testing(port 5600 / 5666,settings.json/settings-testing.json,[server]/[server-testing]).aw_server/profile.py) — same rule as aw-qt and aw-server-rust: lowercase alphanumeric plus-/_, max 32 chars.AW_PROFILEbefore loading config so aw-core#149 isolates data/config/cache/log underactivitywatch-<profile>.AW_PROFILEinstead of setting it to"default". aw-core suffixes any non-empty value, soAW_PROFILE=defaultwould resolve toactivitywatch-defaultand orphan an existing install.-testingsuffix; named profiles getsettings-<profile>.json(redundant under dir isolation, same shape as today).[server-<profile>], falling back to[server]with a warning that the port may collide with 5600. No hash-to-port table — the research build bakesport = 5667into its own config (phase 5)./api/0/inforeportsprofileso the webui can badge the instance.Testing-root note
Python aw-core#149 maps
AW_PROFILE=testingtoactivitywatch-testing. The rust isolation branch keeps testing on the bareactivitywatchroot so existingsqlite-testing.dbfiles are not orphaned. This PR follows the already-merged python dirs contract; unifying the rust testing root is a follow-up on that isolation PR, not a special case here.Not in this PR
profile=/--profile) — sibling PRVerification
pytest tests/test_server.py tests/test_profile.py tests/test_profile_config.py --benchmark-disable— 46 passed, 1 skipped (dir-isolation skipif on aw-core < 0.5.17; lock still pins 0.5.16)mypy aw_server tests --ignore-missing-imports— clean