mirror of https://github.com/langgenius/dify.git
Changes: - Change TelemetryEvent.name from str to TraceTaskName enum for type safety - Remove hardcoded trace_task_name_map from facade (no mapping needed) - Add centralized enterprise-only filter in TelemetryFacade.emit() - Rename is_telemetry_enabled() to is_enterprise_telemetry_enabled() - Update all 11 call sites to pass TraceTaskName enum values - Remove redundant enterprise guard from draft_trace.py - Add unit tests for TelemetryFacade.emit() routing (6 tests) - Add unit tests for TraceQueueManager telemetry guard (5 tests) - Fix test fixture scoping issue for full test suite compatibility - Fix tenant_id handling in agent tool callback handler Benefits: - 100% type-safe: basedpyright catches errors at compile time - No string literals: eliminates entire class of typo bugs - Single point of control: centralized filtering in facade - All guards removed except facade - Zero regressions: 4887 tests passing Verification: - make lint: PASS - make type-check: PASS (0 errors, 0 warnings) - pytest: 4887 passed, 8 skipped |
||
|---|---|---|
| .. | ||
| configs | ||
| controllers | ||
| core | ||
| extensions | ||
| factories | ||
| fields | ||
| libs | ||
| models | ||
| oss | ||
| repositories | ||
| services | ||
| tasks | ||
| tools | ||
| utils | ||
| .gitignore | ||
| __init__.py | ||
| conftest.py | ||