Skip to content

fix(versioning): isolate action metadata writes#41943

Open
mikebridge wants to merge 1 commit into
apache:masterfrom
mikebridge:sc-112938-action-metadata-fail-open
Open

fix(versioning): isolate action metadata writes#41943
mikebridge wants to merge 1 commit into
apache:masterfrom
mikebridge:sc-112938-action-metadata-fail-open

Conversation

@mikebridge

@mikebridge mikebridge commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Makes optional version_transaction.action_kind persistence genuinely fail-open.

Action kinds such as restore, import, and clone are descriptive metadata. A failed PostgreSQL UPDATE must not poison the transaction containing the actual entity save. This change wraps the metadata UPDATE in a SAVEPOINT during commit finalization, after Continuum has produced its canonical transaction and shadow rows.

On failure, only the optional action classification is rolled back. The entity save, canonical history, and semantic change records continue to commit. The action intent is consumed exactly once and cannot leak into a later transaction on a reused session.

Tracked by sc-112938.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable; backend transaction-safety fix.

TESTING INSTRUCTIONS

Run the focused PostgreSQL failure case:

docker compose -f docker-compose-light.yml --profile test run --rm pytest-runner pytest -q tests/integration_tests/versioning/transaction_correctness_tests.py -k action_kind

Run unit coverage:

docker compose -f docker-compose-light.yml --profile test run --rm pytest-runner pytest -q tests/unit_tests/versioning/test_listener.py tests/unit_tests/versioning/test_diff_caps.py

Run the complete versioning regression set:

docker compose -f docker-compose-light.yml --profile test run --rm pytest-runner pytest -q tests/integration_tests/versioning/transaction_correctness_tests.py tests/integration_tests/versioning/capture_disabled_tests.py tests/integration_tests/versioning/snapshot_projection_tests.py tests/integration_tests/versioning/versions_api_tests.py

Observed after rebase: 15 unit tests and 25 PostgreSQL integration/regression tests passed. Changed-files pre-commit and full GitHub CI passed.

ADDITIONAL INFORMATION

  • Has associated issue: Shortcut sc-112938
  • Required feature flags: ENABLE_VERSIONING_CAPTURE
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.01%. Comparing base (8f75f1a) to head (c1d795e).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #41943   +/-   ##
=======================================
  Coverage   65.01%   65.01%           
=======================================
  Files        2744     2744           
  Lines      153571   153574    +3     
  Branches    35212    35212           
=======================================
+ Hits        99842    99847    +5     
+ Misses      51822    51820    -2     
  Partials     1907     1907           
Flag Coverage Δ
hive 39.06% <25.00%> (-0.01%) ⬇️
mysql 57.93% <100.00%> (+<0.01%) ⬆️
postgres 57.98% <100.00%> (+<0.01%) ⬆️
presto 41.05% <25.00%> (-0.01%) ⬇️
python 59.36% <100.00%> (+<0.01%) ⬆️
sqlite 57.59% <100.00%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikebridge mikebridge force-pushed the sc-112938-action-metadata-fail-open branch from e01b86a to dd56ad2 Compare July 10, 2026 20:56
@mikebridge mikebridge force-pushed the sc-112938-action-metadata-fail-open branch from dd56ad2 to c1d795e Compare July 13, 2026 16:39
@mikebridge mikebridge marked this pull request as ready for review July 13, 2026 17:01
@bito-code-review

bito-code-review Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a8f711

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: c1d795e..c1d795e
    • superset/versioning/changes/listener.py
    • tests/integration_tests/versioning/transaction_correctness_tests.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant