feat(telemetry): add client_type field and remove desktop from payloads#8812
feat(telemetry): add client_type field and remove desktop from payloads#8812ogabrielluiz merged 10 commits intomainfrom
Conversation
…yService to handle client type
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes introduce a new optional Changes
Sequence Diagram(s)sequenceDiagram
participant Env as Environment
participant Service as TelemetryService
participant Payload as TelemetryPayload
Env->>Service: Initialize TelemetryService
Service->>Service: _get_client_type() (checks LANGFLOW_DESKTOP)
Service->>Service: Stores client_type ("desktop" or "oss")
Service->>Payload: Create payload (e.g., RunPayload)
Service->>Service: send_telemetry_data(payload)
alt payload.client_type not set
Service->>Payload: Set payload.client_type = Service.client_type
end
Service->>...: Proceed with telemetry logic
sequenceDiagram
participant Test as Test Suite
participant Payload as TelemetryPayload
loop For each payload type
Test->>Payload: Instantiate with/without client_type
Test->>Payload: Serialize to dict (check alias)
Test->>Payload: Test edge cases (invalid/None/long/special)
Test->>Payload: Assert correct behavior
end
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
Here are the copyable unit test edits: Copyable Editssrc/backend/tests/unit/base/langflow/services/telemetry/test_schema.pyThis is a new file. src/backend/tests/unit/base/langflow/services/telemetry/test_service.pyThis is a new file. |
- Introduced unit tests for `RunPayload`, `ShutdownPayload`, `VersionPayload`, `PlaygroundPayload`, and `ComponentPayload` to ensure proper initialization, serialization, and edge case handling. - Implemented tests for various scenarios including default values, negative inputs, and serialization with special characters. - Added performance tests to evaluate payload creation and serialization efficiency. - Included fixtures for sample payloads to streamline testing processes.
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (2.67%) is below the target coverage (10.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8812 +/- ##
==========================================
- Coverage 23.45% 19.24% -4.21%
==========================================
Files 1090 1052 -38
Lines 39849 39070 -779
Branches 5531 5363 -168
==========================================
- Hits 9347 7520 -1827
- Misses 30331 31490 +1159
+ Partials 171 60 -111
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
|



Introduce a new
client_typefield in telemetry payloads and modify the TelemetryService to set and utilize this field appropriately.Summary by CodeRabbit
New Features
Bug Fixes
Tests