Repository navigation
feat(api): expose local device discovery - #835
TimeToBuildBob wants to merge 1 commit into
Conversation
Git-Session-Id: 7e70ca36-75d1-44e3-9e81-7d3ad59c8aa1
[Low impact] This PR appears safe to merge. SummaryAdds
Reviews (1) · Last reviewed commit: "feat(api): expose local device discovery" · Reviewed by Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #835 +/- ##
===========================================
+ Coverage 70.81% 85.49% +14.67%
===========================================
Files 51 88 +37
Lines 2916 12679 +9763
===========================================
+ Hits 2065 10840 +8775
- Misses 851 1839 +988 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
All eight checks passed and Greptile reports 5/5 on the current head. No review changes are outstanding. Bob has triage, not write access here; waiting for maintainer review and merge. |
|
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. |
🤖 AI code reviewAdds a serializable Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No findings. The diff looks correct to me on this pass. Files changed (2) — the diff as I read it
Reviewed Maintainer commands
|
GET /api/0/devicescurrently returns 404 in Rust, leaving the local-device discovery slice of ActivityWatch/activitywatch#302 absent. Add a local-only JSON list with the persisted instance ID and current hostname, matching the pending Python implementation in ActivityWatch/aw-server#183. The hostname comes from the same helper as/info, including Android overrides.The route uses the existing host, CORS and API-key guards. Tests cover exact JSON and
/infoagreement, repeated identity stability, legacy bucket hostnames producing no inferred peers, valid/missing/wrong API keys on canonical/trailing/encoded paths, and invalid Host rejection.This is an additive local-discovery slice on master, independent of #786. Full peer catalogue semantics, device-aware bucket/cache addressing and compatibility resolution remain prerequisites of V2 import; this PR does not complete ActivityWatch/activitywatch#302 or enable V2 sync.
Validation: the new behavior tests first reproduced the missing-route 404, then passed after implementation.
cargo test -p aw-server -- --test-threads=2: 155 passed, 1 ignored.cargo clippy --workspace -- -D warnings, formatting, whitespace and commit hooks pass. Tests use isolated in-memory data and local test processes.