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 |
||
|---|---|---|
| .. | ||
| auth | ||
| document_indexing_proxy | ||
| enterprise | ||
| entities | ||
| errors | ||
| plugin | ||
| rag_pipeline | ||
| recommend_app | ||
| retention | ||
| tools | ||
| trigger | ||
| workflow | ||
| __init__.py | ||
| account_service.py | ||
| advanced_prompt_template_service.py | ||
| agent_service.py | ||
| annotation_service.py | ||
| api_based_extension_service.py | ||
| app_dsl_service.py | ||
| app_generate_service.py | ||
| app_model_config_service.py | ||
| app_service.py | ||
| app_task_service.py | ||
| async_workflow_service.py | ||
| attachment_service.py | ||
| audio_service.py | ||
| billing_service.py | ||
| clear_free_plan_tenant_expired_logs.py | ||
| code_based_extension_service.py | ||
| conversation_service.py | ||
| conversation_variable_updater.py | ||
| credit_pool_service.py | ||
| dataset_service.py | ||
| datasource_provider_service.py | ||
| end_user_service.py | ||
| external_knowledge_service.py | ||
| feature_service.py | ||
| feedback_service.py | ||
| file_service.py | ||
| hit_testing_service.py | ||
| knowledge_service.py | ||
| message_service.py | ||
| metadata_service.py | ||
| model_load_balancing_service.py | ||
| model_provider_service.py | ||
| oauth_server.py | ||
| operation_service.py | ||
| ops_service.py | ||
| recommended_app_service.py | ||
| saved_message_service.py | ||
| summary_index_service.py | ||
| tag_service.py | ||
| variable_truncator.py | ||
| vector_service.py | ||
| web_conversation_service.py | ||
| webapp_auth_service.py | ||
| website_service.py | ||
| workflow_app_service.py | ||
| workflow_draft_variable_service.py | ||
| workflow_run_service.py | ||
| workflow_service.py | ||
| workspace_service.py | ||