feat(versioning): ETag helper module + integration tests (T055)
Helper module that derives the strong-validator ``ETag`` value from an entity's current live ``version_uuid`` and attaches it to a Flask response. Two functions: - ``set_version_etag(response, version_uuid)`` — direct path used by PUT handlers that already compute ``new_version_uuid`` (see the REST API commit two prior). Cheap; no extra query. - ``set_version_etag_by_uuid(response, model_cls, entity_uuid)`` — used by version endpoints that operate on ``entity_uuid``; looks up ``entity_id`` then derives ``version_uuid`` via ``VersionDAO``. Costs one extra ``SELECT id WHERE uuid = ?``; documented in the docstring so callers prefer the cheap variant when they have the id already. Integration tests cover all three entity types and four endpoint shapes (entity GET, save PUT, version-list GET, single-version GET) plus the entity-with-no-versions edge case (header is correctly absent). The ETag is wired into the API endpoints in the REST-API commit (group 3) and the CORS ``expose_headers: ["ETag"]`` ships with the retention commit (group 4) since both touch ``superset/config.py``. Locking enforcement (``If-Match`` → 412) is explicitly NOT in this change — deferred to the follow-up UI SIP per Open Question §7. ``ETag`` is informational in v1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
M
Mike Bridge committed
9bc95ef8196d13649ffead01ff0545841571efb7
Parent: 801d586