Skip to content

Release v1.0.0.dev14 - #38

Merged
vistart merged 20 commits into
mainfrom
release/v1.0.0.dev14
May 29, 2026
Merged

vistart merged 20 commits into
mainfrom
release/v1.0.0.dev14

Conversation

@vistart

@vistart vistart commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Release v1.0.0.dev14 of rhosocial-activerecord-postgres.

This release includes PostgreSQL dialect/version-guard improvements, security hardening for identifier and partition formatting, adapter fixes for optional types, JSONB test adapter registration, CI maintenance, and expanded validation/test coverage.

Included changes

  • feat(dialect): require version adaptation before using Postgres dialect (feat(dialect): require version adaptation before using Postgres dialect #37)
  • feat: split returning support into DML-specific flags for PostgreSQL dialect
  • fix(postgres): apply security fixes and dialect improvements
  • fix(postgres): remove dead _quote_identifier, fix _format_partition_value injection
  • fix(backend): preserve exception chain and add credential warning
  • fix(adapters): inherit BaseSQLTypeAdapter to properly handle Optional types
  • fix(test): register PostgresJSONBAdapter for JsonUser JSON fields
  • refactor(cli): rename named-query to named-expression, add procedure-graph
  • test(query): add bridge for unicode/emoji/injection round-trip tests
  • test: add Pydantic native validation coverage
  • test: update PostgreSQL benchmarks and testsuite dependency
  • ci: upgrade actions/checkout from v4 to v6
  • ci: upgrade testsuite source to git+https at release/v1.0.0.dev14
  • ci: fix PostgreSQL benchmark coverage
  • ci: install core package from PyPI
  • chore: add .gitattributes to enforce LF line endings
  • chore: bump version to 1.0.0.dev14

Changelog

Validation

  • Version check: pyproject.toml version is 1.0.0.dev14, matching branch release/v1.0.0.dev14.
  • Working tree: clean before PR preparation.
  • Remote sync: origin/main has 0 commits missing from release branch; release branch is 18 commits ahead of origin/main.
  • Local tests: skipped by operator request; CI should provide release validation.

Merge instructions

  • Do not merge locally.
  • Merge this PR into main via GitHub web interface after CI passes.
  • After merge, run the release finalization steps manually: sync main, create/push tag or publish the GitHub release, and decide whether to delete the release branch.

vistart and others added 18 commits May 16, 2026 19:53
…ct (#37)

* feat(dialect): require version adaptation before using Postgres dialect

PostgresDialect now defaults to version=None, requiring
introspect_and_adapt() or explicit version before version-dependent
features can be used. This prevents silent SQL errors from incorrect
version assumptions.

- Change PostgresDialect.__init__ default version to None
- Remove hardcoded (9, 6, 0) from backend dialect construction
- Update tests to use explicit version (13, 0, 0)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore: add changelog fragment for PR #37

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
…graph

Rename the CLI subcommand and underlying module from "named-query" to "named-expression" to reflect broader expression evaluation capability beyond just query execution.

Add new "named-procedure-graph" subcommand for visualizing procedure relationship graphs.

Update named_connection to pass output provider.
…curity tests

- Fixed broken indentation: test_drop_statistics_name_quoted was nested
  inside test_partition_value_integer instead of the class
- Added format_identifier naive-vs-proper equivalence tests for safe input
- Added format_identifier naive-vs-proper injection immunity tests showing
  proper escaping prevents breakout that naive quoting allows
- Added tests for normal, embedded-quote, injection-payload, and empty cases
…alue injection

- Remove _quote_identifier dead code (delegate to format_identifier)
- Fix _format_partition_value to escape single quotes in string values,
  preventing SQL injection via partition value breakout
- Remove _quote_identifier dead code, delegate to format_identifier
- Fix format_drop_virtual_table, format_create_trigger_statement
- Apply named_expression feature enhancements
Add bridge file importing the new multilingual Unicode, emoji burst, SQL
injection payload, and injection immunity tests from testsuite.
PyPI-hosted testsuite dev13 does not include the
test_logging_data_summarization module, causing collection
errors. Switch to git source at dev14 which has it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Replace `raise ... from None` with `raise ... from e` in both sync
  and async backends to preserve the original traceback for debugging
- Add password-in-plaintext warning to PostgresConnectionConfig.to_connection_string()

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
psycopg3 automatically deserializes JSONB columns to Python dict/list,
but JsonUser's JSON fields are defined as Optional[str] in the testsuite.
Without a type adapter, Pydantic validation fails when receiving dict
instead of str from the database.

Register PostgresJSONBAdapter for all JSON fields in setup_json_user_fixtures
and setup_async_json_user_fixtures. The adapter's from_database() method
converts dict/list back to JSON string when target_type is str.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… types

All Postgres adapters (PostgresJSONBAdapter, PostgresListAdapter,
PostgresNetworkAddressAdapter, PostgresEnumAdapter, PostgresHstoreAdapter)
previously implemented SQLTypeAdapter Protocol directly and overrode
from_database() / to_database() directly, bypassing BaseSQLTypeAdapter's
Optional type unwrapping logic.

This caused Pydantic ValidationError when psycopg3 auto-deserializes
JSONB columns to dict/list, because the adapter received Optional[str]
as target_type but checked `target_type is str` which never matched.

By inheriting BaseSQLTypeAdapter and implementing _do_from_database() /
_do_to_database() instead, Optional unwrapping is handled by the base
class before reaching the adapter's type-specific logic.

Also removes mock-based tests for ipaddress unavailability, as ipaddress
is a standard library module guaranteed to exist in all supported Python
versions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Bridge the shared testsuite Pydantic native validation contract into the PostgreSQL provider, align dev test dependencies, and add a Python 3.14 / PostgreSQL 18 benchmark job for CI parity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Register benchmark providers so the testsuite benchmark job runs PostgreSQL scenarios instead of skipping, and restore Python 3.8-specific dependency constraints for the CI matrix.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Consolidate PostgreSQL backend benchmark relocation, FastAPI benchmark coverage, benchmark insert id fixes, and the CI testsuite dependency switch to the published PyPI package.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pin the CI core dependency to the published 1.0.0.dev27 package so workflows no longer depend on the release branch source checkout.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vistart vistart self-assigned this May 29, 2026
@codecov

codecov Bot commented May 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.13245% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.29%. Comparing base (4520d4a) to head (a824b41).

Files with missing lines Patch % Lines
...ord/backend/impl/postgres/backend/async_backend.py 42.85% 8 Missing ⚠️
...activerecord/backend/impl/postgres/backend/sync.py 42.85% 8 Missing ⚠️
...cord/backend/impl/postgres/cli/named_connection.py 0.00% 5 Missing ⚠️
...ctiverecord/backend/impl/postgres/adapters/json.py 66.66% 3 Missing ⚠️
...cord/backend/impl/postgres/cli/named_expression.py 85.00% 1 Missing and 2 partials ⚠️
...backend/impl/postgres/cli/named_procedure_graph.py 94.11% 0 Missing and 2 partials ⚠️
...ecord/backend/impl/postgres/cli/named_procedure.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   68.72%   69.29%   +0.56%     
==========================================
  Files         230      231       +1     
  Lines       10054    10088      +34     
  Branches     1599     1593       -6     
==========================================
+ Hits         6910     6990      +80     
+ Misses       2621     2569      -52     
- Partials      523      529       +6     
Flag Coverage Δ
postgres-18 69.29% <80.13%> (+0.56%) ⬆️
python-3.14 69.29% <80.13%> (+0.56%) ⬆️
unittests 69.29% <80.13%> (+0.56%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

vistart and others added 2 commits May 30, 2026 00:35
Add focused tests for PostgreSQL CLI adapter wiring and backend initialization paths to improve release PR coverage without requiring live database connections.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@vistart
vistart merged commit bbe15f4 into main May 29, 2026
26 checks passed
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