Skip to content

test(errors): contract the semantic error taxonomy - #31

Merged
vistart merged 2 commits into
release/v1.0.0.dev17from
feature/error-taxonomy
Nov 11, 2026
Merged

vistart merged 2 commits into
release/v1.0.0.dev17from
feature/error-taxonomy

Conversation

@vistart

@vistart vistart commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR aligns python-activerecord-testsuite with the new semantic error taxonomy and execute-phase contract:

  • Adds feature/backend/errors/test_error_taxonomy.py: hierarchy, retry hints, diagnostics, and bulk dual-inheritance checks.
  • Runs without a database, so every backend can execute it as an installed contract.

Adds # (no issue)

Type of change

  • feat: A new feature
  • test: Adding missing tests or correcting existing tests (for the new feature)
  • docs: Documentation only changes (if related to the new feature)
  • perf: A code change that improves performance (if part of the feature)
  • chore: Changes to the build process or auxiliary tools and libraries suchs as documentation generation (if related to the new feature)
  • ci: Changes to our CI configuration files and scripts (if related to the new feature)
  • build: Changes that affect the build system or external dependencies (if related to the new feature)
  • revert: Reverts a previous commit

Breaking Change

  • Yes, for end-users (backward-incompatible API changes)
  • Yes, for backend developers (internal architectural changes that may affect custom implementations)
  • No breaking changes

Impact on End-Users:
No backward-incompatible changes: concrete error classes keep their names, and every error remains a DatabaseError. Behavioural change: auto-commit failures now raise TransactionError instead of being logged and ignored, and transient connection retries now actually run.

Impact on Backend Developers (Custom Implementations):
No signature changes. Custom _handle_error implementations should raise taxonomy errors; the core pipeline adds a defensive fallback when a handler returns.

Related Repositories/Packages

  • python-activerecord PR #139 (feature/error-taxonomy).
  • Nine backend PRs pin this branch until the release merge.
  • CI pins in this repository currently point at feature/error-taxonomy for both core and testsuite, and will be restored to release branches after the merge.

Testing

  • I have added new tests to cover my changes.
  • I have updated existing tests to reflect my changes.
  • All existing tests pass.
  • This change has been tested against the backend matrix via CI.

Test Plan:

Local: 11 passed. No CI pipeline exists for this repository.

Reproduction:

PYTHONPATH=src:tests pytest tests -k 'test_execute_error_contract or test_driver_error_mapping or test_error_taxonomy_contract'

Checklist

  • My code follows the project's code style guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation (Docstrings, README.md, etc.).
  • My changes generate no new warnings.
  • I have added a Changelog fragment (changelog.d/<issue_number>.<type>.md).
  • I have verified that my changes do not introduce SQL injection vulnerabilities.
  • I have checked for potential performance regressions.

Additional Notes

  • The changelog fragment is added as changelog.d/<PR>.added.md once the PR number exists, because the checker requires the fragment number to equal the PR number.
  • CI intentionally installs core and testsuite from feature/error-taxonomy; restore release pins after this PR and the core PR merge.

@sonarqubecloud

Copy link
Copy Markdown

@vistart vistart self-assigned this Nov 11, 2026
@vistart vistart added the enhancement New feature or request label Nov 11, 2026
@vistart
vistart merged commit 4a6ceac into release/v1.0.0.dev17 Nov 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant