dify/api/tests/unit_tests
GareArc abcf14a571
refactor(telemetry): move gateway to core as stateless module-level functions
Move routing table, emit(), and is_enterprise_telemetry_enabled() from
enterprise/telemetry/gateway.py into core/telemetry/gateway.py so both
CE and EE share one code path. The ce_eligible flag in CASE_ROUTING
controls which events flow in CE — flipping it is the only change needed
to enable an event in community edition.

- Delete enterprise/telemetry/gateway.py (class-based singleton)
- Create core/telemetry/gateway.py (stateless functions, no shared state)
- Simplify core/telemetry/__init__.py to thin facade over gateway
- Remove TelemetryGateway class and get_gateway() from ext_enterprise_telemetry
- Single-source is_enterprise_telemetry_enabled in core.telemetry.gateway
- Fix pre-existing test bugs (missing dify.event.id in metric handler tests)
- Update all imports and mock paths across 7 test files
2026-02-28 19:27:24 -08:00
..
configs revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
controllers fix: "refactor: port api/controllers/console/tag/tags.py to ov3" (#31887) 2026-02-03 22:18:53 +08:00
core refactor(telemetry): move gateway to core as stateless module-level functions 2026-02-28 19:27:24 -08:00
enterprise refactor(telemetry): move gateway to core as stateless module-level functions 2026-02-28 19:27:24 -08:00
extensions revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
factories hotfix: fix _extract_filename for rfc 5987 (#26230) 2025-11-27 10:54:00 +08:00
fields refactor: port api/fields/file_fields.py (#30638) 2026-01-06 22:55:58 +08:00
libs revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
models revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
oss feat: support tencent cos custom domain (#30193) 2025-12-29 15:41:02 +08:00
repositories revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
services revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00
tasks feat(telemetry): add enterprise OTEL telemetry with gateway, traces, metrics, and logs 2026-02-05 23:10:30 -08:00
tools feat: MCP tool adds support for embeddedResource (#30261) 2025-12-29 10:15:47 +08:00
utils fix: [xxx](xxx) render as xxx](xxx) (#30392) 2025-12-31 10:30:15 +08:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
.gitignore Enhance Code Consistency Across Repository with .editorconfig (#19023) 2025-04-29 18:04:33 +08:00
conftest.py revert: revert human input relevant code (#31766) 2026-01-30 19:18:49 +08:00