refactor(db, parser, ci): post-review improvements#6
Merged
cendhu merged 3 commits intoLF-Decentralized-Trust-labs:mainfrom Mar 5, 2026
Merged
Conversation
Contributor
farooqazamwasimnl
commented
Mar 5, 2026
- Replace flogging with logging.New; ban flogging via depguard
- Fix DSN via dbconn.DataSourceName; fix rollback to use context.Background()
- Remove ProcessedBlock.Txns and TxRecord.BlockNum; derive at write time
- Move buildBatchParams before beginTx; add nil guards for BlockInfo and Data
- Pre-allocate all seven batchParams slices
- Change TxRecord.ValidationCode from int32 to protoblocktx.Status (typed)
- Change validation_code column from BIGINT to SMALLINT
- Log warning when endorsement identity parsing fails (was silently swallowed)
- Add util.Ptr[T] generic helper; remove scattered ptr helpers
- Rename test_exports.go to test_exports_test.go
- Add TestMain with DB_DEPLOYMENT=local and DB_TYPE=postgres
- CI: add lint and test jobs; pin all action SHAs; add permissions block; set timeout-minutes; pin golangci-lint to v2.10.1; verify sqlc SHA256
- Makefile: add start-db/stop-db targets
- Replace flogging with logging.New; ban flogging via depguard - Fix DSN via dbconn.DataSourceName; fix rollback to use context.Background() - Remove ProcessedBlock.Txns and TxRecord.BlockNum; derive at write time - Move buildBatchParams before beginTx; add nil guards for BlockInfo and Data - Pre-allocate all seven batchParams slices - Change TxRecord.ValidationCode from int32 to protoblocktx.Status (typed) - Change validation_code column from BIGINT to SMALLINT - Log warning when endorsement identity parsing fails (was silently swallowed) - Add util.Ptr[T] generic helper; remove scattered ptr helpers - Rename test_exports.go to test_exports_test.go - Add TestMain with DB_DEPLOYMENT=local and DB_TYPE=postgres - CI: add lint and test jobs; pin all action SHAs; add permissions block; set timeout-minutes; pin golangci-lint to v2.10.1; verify sqlc SHA256 - Makefile: add start-db/stop-db targets Signed-off-by: Farooq Azam Wasim <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
Signed-off-by: Farooq Azam Wasim <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
Move top-level 'exclusions' under 'linters' and top-level 'sort-order' under 'output', matching the v2 JSON schema. Signed-off-by: Farooq Azam Wasim <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
cendhu
approved these changes
Mar 5, 2026
| go-version: '1.24' | ||
|
|
||
| - name: Run tests | ||
| run: go test -count=1 ./pkg/... |
Contributor
There was a problem hiding this comment.
add a make target and call it here.
| - name: Set up Go | ||
| uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
| with: | ||
| go-version: '1.24' |
Contributor
There was a problem hiding this comment.
committer has moved to 1.26.
|
|
||
| "github.com/cockroachdb/errors" | ||
| "github.com/hyperledger/fabric/common/flogging" | ||
| "github.com/hyperledger/fabric-x-committer/utils/logging" |
Contributor
There was a problem hiding this comment.
we usually group imports using standard third-party, external, and internal. We have a lint for this in committer.
internal -- imports within the block explorer
external -- anything from related projects fabric-x-xxxx
third-party -- any other imports excluding standard library
standard library
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.