mikebridge opened a new pull request, #44009: URL: https://github.com/apache/superset/pull/44009
### SUMMARY Closes the last open item of SC-115617 (the first two — precise missing-table classification and swallow-site counters — shipped in #42709): the versioning capture write path had **no latency signal**, yet the documented recovery lever for capture trouble is the `ENABLE_VERSIONING_CAPTURE` kill-switch, flipped on save-path slowdown. The #42709 counters cover *loss*; nothing covered *slowdown*, so an operator had no series to alert on before flipping fleet-wide. Two commits: - **refactor**: `finalize_change_records` hoists out of the registration closure to module level — structure-only (it never referenced the registered entity classes), giving the write path a directly unit-testable seam. - **chore**: the finalizer times its real work — started after the reentrancy guard so instant re-entries don't dilute the series, emitted through every early return via `finally` — and reports `superset.versioning.capture.finalize.latency` (milliseconds, the repo's `now_as_float` convention) through a new `emit_capture_timing` sibling of #42709's `incr_capture_error` in `superset/versioning/metrics.py`, sharing its fail-open posture: metrics emission can never break a user's save. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — backend metric. ### TESTING INSTRUCTIONS ```bash python -m pytest tests/unit_tests/versioning -q # 148 passed ``` New tests drive the real module-level finalizer on an isolated session: the series fires exactly once per save-path commit, a re-entrant finalize emits nothing (no zero-sample dilution), and a stats backend that raises cannot break the save. ### ADDITIONAL INFORMATION - [x] Has associated issue: SC-115617 (items 1–2 closed by #42709; refs #41551, sc-111918's flip monitoring) - [x] Required feature flags: `ENABLE_VERSIONING_CAPTURE` (the metric instruments its capture path) - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JRLEJS4mUqKBoPjSjviKUW -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
