mikebridge opened a new pull request, #41176:
URL: https://github.com/apache/superset/pull/41176
### SUMMARY
Lands the **entity-versioning base infrastructure** (schema +
SQLAlchemy-Continuum wiring) **gated off by default**, so it deploys inert — a
"base infra, dark" PR. Capture is activated later by flipping the gate default
on, once validated in production.
With `ENABLE_VERSIONING_CAPTURE=False` (the shipped default),
`init_versioning()` detaches Continuum's write listeners, so **a save writes
zero `version_transaction` rows and zero `*_version` shadow rows** — proven by
a behavioral test. The migration is additive and inert; the read-only
`/versions/` list + get endpoints are wired but return empty until capture is
enabled.
> ⚠️ **Stacked PR.** Built on top of the composite-PK reshape in #39859
(Continuum's M2M tracker needs that shape). Until #39859 merges, the diff below
includes its commits — **review only the single `feat(versioning):
entity-version base infrastructure (gated off)` commit**.
**What's included (all inert with the gate off):**
- Alembic migration: `version_transaction` + the `*_version` shadow tables
(additive).
- Continuum wiring: `make_versioned()`, `VersionTransactionFactory`,
`VersioningFlaskPlugin`, the `superset/versioning/` capture machinery
(baseline, change-records, diff engine).
- The `ENABLE_VERSIONING_CAPTURE` gate (default **off**), a permanent
operational kill-switch.
- Read-only endpoints: `GET
/api/v1/{chart,dashboard,dataset}/<uuid>/versions/` and
`/versions/<version_uuid>/`.
- Mapper-level correctness (`reset_ownership`, UUID coercion) so existing
import/clone paths behave correctly with the versioned mappers present.
**Deferred to follow-ups:** version restore, the cross-entity activity view,
version-history retention/prune, and the frontend UI.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend, gated off; no user-visible change on deploy.
### TESTING INSTRUCTIONS
```bash
# Behavioral proof of the dark-launch contract (Postgres):
pytest tests/integration_tests/versioning/capture_disabled_tests.py
# capture-off → zero version_transaction + shadow rows; capture-on control →
one version row.
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [x] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [x] Migration is atomic, supports rollback & is backwards-compatible
- [x] Confirm DB migration upgrade and downgrade tested
- [x] Introduces new feature or API (gated off by default)
- [ ] Removes existing feature or API
Stacked on #39859.
--
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]