Skip to content

[CUBE-24118] Base setup stuff#2

Merged
acdameli merged 9 commits into
mainfrom
CUBE-24118
Apr 7, 2026
Merged

[CUBE-24118] Base setup stuff#2
acdameli merged 9 commits into
mainfrom
CUBE-24118

Conversation

@acdameli

@acdameli acdameli commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Feel free to rubber stamp this it's all scaffolding around running tests, coverage increase, dev env, blah blah. One functional change.

Summary

Hardening and release-oriented tooling for xa-transactions: merge upstream format_id / typing work, add pre-commit + CI, Commitizen changelog settings, tag-on-main workflow, expanded unit tests (coordinator, recovery, adapter, types), and a bugfix so DefaultRecoveryStrategy.recover() returns the documented count.


Bugfix

  • DefaultRecoveryStrategy.recover() — Returns the number of recovered transactions as documented; previously returned None.

Tests (default pytest; no MySQL)

Area File
Types / XID tests/test_types.py
Coordinator (mocked store + adapter) tests/test_coordinator_unit.py
DefaultRecoveryStrategy (mocks + optional lock manager) tests/test_recovery_unit.py
MySQLXAAdapter SQL + XA RECOVER parsing (mocked cursor) tests/test_adapter_unit.py

Optional extras stay behind markers (@pytest.mark.celery / django); default config excludes them.


Tooling & CI

Pre-commit, Ruff, pytest (unit-only hook)
  • Pre-commit runs Ruff (lint + format) on xa_transactions/ and tests/, and unit tests via scripts/pre_commit_pytest_unit.sh (skips celery/django marked tests).
  • dev extra includes pre-commit, pytest, ruff, commitizen, etc.
GitHub Actions
  • CI — Matrix Python 3.10–3.12: Ruff + unit tests with coverage; separate job installs [dev,celery,django] and runs marked integration tests.
  • Tag on main — Workflow reads [project].version from pyproject.toml and creates v<version> on push to main when the tag is missing (needs contents: write).
Commitizen / changelog
  • CHANGELOG.md maintained; Commitizen config includes changelog_file, incremental updates, and changelog_start_rev aligned with the project history.

Docs

  • CHANGELOG.md[Unreleased] updated for new tests and the recover() fix; existing 0.2.0 section documents earlier release items.
  • .github/pull_request_template.md — PR template for future contributions.
  • .ai/INDEX.md — Agent-oriented repo index (as applicable on branch).

Merge / upstream

  • Branch includes a merge from fork/main bringing in format_id support, adapter/coordinator/recovery/Celery wiring, py.typed, mypy config, and related fixes.

Verify locally

# Unit tests (same shape as pre-commit / CI default)
pytest --cov=xa_transactions --cov-report=term-missing

# Optional integration (requires extras)
pytest -m "celery or django" -v

acdameli added 9 commits April 2, 2026 13:22
Resolve conflicts: keep Python 3.10 + dev tooling (ruff, pytest, pre-commit,
coverage) and merge mypy config; integrate format_id/XID and typing from main.
Restore django integration from main with ruff fixes (imports, B904, line length).

Made-with: Cursor
recover() documented a return value but never returned it.

Add unit tests for DefaultRecoveryStrategy (mocked store/adapter/locks) and MySQLXAAdapter (SQL and XA RECOVER parsing with mocked cursor).

Made-with: Cursor
Mock store/adapter to cover create_global, create_branches, finalize, and reconcile_branch without MySQL. Document in CHANGELOG.

Made-with: Cursor
@acdameli
acdameli marked this pull request as ready for review April 7, 2026 17:14
@acdameli
acdameli requested review from jandalia and jfsy April 7, 2026 17:14
@acdameli

acdameli commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator Author

I really don't expect real code review here. It's 90% setup for the project (AI generated files for build checks etc)

@jfsy jfsy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't really look closely, just rubber stamping based on your message.

@acdameli
acdameli merged commit aefe9e2 into main Apr 7, 2026
6 checks passed
@acdameli
acdameli deleted the CUBE-24118 branch April 9, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants