Merged
Conversation
Adds MockTransactionBuilder for core.TransactionBuilder and teaches MockExtendedDB.TransactWrite / MockDB.Transaction to execute callbacks by default (less boilerplate in downstream tests). Tests: make test-unit
Adds additional mocks tests to cover transaction builder branches and satisfy the 90% library coverage gate. Coverage: bash scripts/coverage.sh
Fixes govet fieldalignment on MockExtendedDB and handles callback errors to satisfy errcheck. Rubric: make rubric
Reduces flakiness in COM-8 when GitHub intermittently returns HTTP 5xx during shallow fetches. Rubric: make rubric
…ilder feat(mocks): add transaction builder mock
…emain chore(premain): release 1.2.0-rc
chore: sync premain -> main
chore(main): release 1.2.0
paytheory
approved these changes
Jan 23, 2026
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.
This pull request introduces a new mock implementation for transaction builders, improving support for mocking transactional workflows in tests. It also updates documentation to demonstrate the new mocking pattern, adds type aliases for easier usage, and enhances the behavior of mock transaction-related methods to reduce boilerplate in unit tests. Additionally, version numbers and changelogs are updated to reflect these changes.
Mocking and Testing Improvements:
MockTransactionBuilderinpkg/mocks/transaction_builder.go, providing a comprehensive mock for thecore.TransactionBuilderinterface, including support for fluent transaction DSL and execution of update callbacks.MockExtendedDBinpkg/mocks/extended_db.goto use the new transaction builder mock, enabling automatic execution of transaction callbacks and reducing test boilerplate. [1] [2]mustTransactionBuilderinpkg/mocks/query.gofor safe type assertions when returning mocked transaction builders.TransactionBuilderinpkg/mocks/mocks.goand verified it inpkg/mocks/mocks_test.gofor more concise test code. [1] [2]Documentation Updates:
pkg/mocks/README_SIMPLE_EXAMPLE.mdto include a new pattern for mocking transactions withTransactWriteandMockTransactionBuilder, illustrating the improved approach.Changelog and Versioning:
CHANGELOG.mdwith new features and bug fixes, and incremented versions in.release-please-manifest.jsonand.release-please-manifest.premain.jsonto1.2.0and1.2.0-rcrespectively. [1] [2] [3]hgm-infra/evidence/hgm-rubric-report.json.