dify/api/tests/unit_tests/core
GareArc adadf1ec5f
refactor(telemetry): migrate to type-safe enum-based event routing with centralized enterprise filtering
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
2026-02-05 20:15:12 -08:00
..
agent/output_parser fix: code block syntax cannot be displayed correctly in react mode (#16904) 2025-03-31 16:27:29 +08:00
app revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
datasource fix: handle missing `credential_id` (#30051) 2025-12-24 11:21:51 +08:00
file fix: `File` model add known extra fields, fix issue about the tool of… (#27607) 2025-11-04 09:57:25 +08:00
helper feat(refactoring): Support Structured Logging (JSON) (#30170) 2026-01-04 11:46:46 +08:00
logging feat(refactoring): Support Structured Logging (JSON) (#30170) 2026-01-04 11:46:46 +08:00
mcp feat: implement RFC-compliant OAuth discovery with dynamic scope selection for MCP providers (#28294) 2025-11-20 11:18:16 +08:00
model_runtime fix: Drain non-stream plugin chunk iterator (#31564) 2026-01-30 16:54:56 +08:00
moderation Feat/ implement test script of content moderation (#28923) 2025-11-30 12:43:58 +08:00
ops refactor(telemetry): migrate to type-safe enum-based event routing with centralized enterprise filtering 2026-02-05 20:15:12 -08:00
plugin revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
prompt Feat/chat message image first for agent and advanced_chat APP (#23796) 2025-08-22 16:42:15 +08:00
rag fix: SSRF in WordExtractor URL download (credit to @EaEa0001 ) (#31678) 2026-01-29 14:01:21 +08:00
repositories revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
schemas feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
telemetry refactor(telemetry): migrate to type-safe enum-based event routing with centralized enterprise filtering 2026-02-05 20:15:12 -08:00
tools revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
variables refactor(variables): clarify base vs union type naming (#30634) 2026-01-13 23:39:34 +09:00
workflow revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
test_file.py feat(llm_node): support order in text and files (#11837) 2024-12-20 14:12:50 +08:00
test_model_manager.py fix RetrievalMethod StrEnum (#26768) 2025-10-13 10:29:37 +08:00
test_provider_configuration.py chore: remove icon_large of models (#30466) 2026-01-03 02:35:17 +09:00
test_provider_manager.py more typed orm (#28519) 2025-11-24 10:50:20 +08:00
test_trigger_debug_event_selectors.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00