Repository navigation
feat(logging): adapt execution logging and shared contracts - #9
Merged
Merged
Conversation
Emit the canonical execution log records from the BigQuery execute overrides instead of inventing backend-specific ones: one DEBUG SQL line with redacted parameters (log_execution_start), one INFO DML/DQL/DDL/TCL summary (log_execution_summary via log_result_summary), and a DEBUG 'will be re-raised' note (log_execution_error) so a failure is never logged at ERROR before it propagates.
Pass LogContext on high-level operations: bulk_update and the client-side PK/count probes now attach execution_log_context / LogContext so the summary carries model-facing operation and object_name. Overrides that delegate to super() already inherit the context built by core; there are no execute_many/fetch_all/fetch_one overrides to adapt.
Replace the direct logging.getLogger(__name__) rollback warnings with get_logger('rhosocial.activerecord.transaction'); downgrade connect/introspection lifecycle messages to DEBUG, add the same DEBUG lines to the async backend for sync/async parity, and fix the un-awaited _handle_auto_commit_if_needed in async bulk_update.
Add the shared-contract wrappers for ordered-has-many, find-one-or-create, read-only models and keyless models, plus the basic/relation conftests that provide their provider fixtures.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev1 #9 +/- ##
=======================================================
+ Coverage 75.11% 80.31% +5.19%
=======================================================
Files 44 44
Lines 3203 3225 +22
Branches 419 421 +2
=======================================================
+ Hits 2406 2590 +184
+ Misses 708 534 -174
- Partials 89 101 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Aligns this backend with the core execution-logging contract introduced in rhosocial/python-activerecord#137.
execute_manyaccepts keyword-onlyoptions: ExecutionOptions | Noneand forwards it to the shared helpers; backends without overrides inherit the core implementation.log_execution_start,log_batch_start,log_execution_summary,log_batch_summaryandlog_execution_errorfrom core. Raw SQL/parameter logging and duplicate batch summaries are removed.rhosocial.activerecord.backend.<type>logger.log()overrides that droppedextra=are removed where present; CLI modules use the configured library logger.Depends on the core branch
feature/logging-execution(PR rhosocial/python-activerecord#137); the temporary CI core reference points there.No tracking issue.
Type of change
feat: A new featurechanged: A change in existing functionalitydocs: Documentation only changestest: Adding missing tests or correcting existing testsperf: A code change that improves performancechore: Changes to the build process or auxiliary tools and librariesci: Changes to our CI core referencebuild: Changes that affect the build system or external dependenciesrevert: Reverts a previous commitBreaking Change
Impact on End-Users:
INFO output no longer contains raw SQL or parameter values; the backend now emits the core
dml.*/dql.*/ddl.*/transaction.*summaries.Impact on Backend Developers (Custom Implementations):
Custom overrides of
execute_many,fetch_allorfetch_onemust accept the newoptions/log_contextkeywords.Applicable
rhosocial-activerecordVersion Range:rhosocial-activerecord>=1.0.0.dev30,<2.0.0once the core PR is released; CI currently tracks the core branch.Related Repositories/Packages
release/v1.0.0.dev17Testing
Test Plan:
BigQuery emulator runs with a fresh container per module: 132 wrapper tests passed.
Checklist
changelog.d/<issue_number>.<type>.md).Additional Notes
The changelog fragment is added after the PR number is known. The CI core reference will be switched to the next core release after PR rhosocial/python-activerecord#137 merges.