Skip to content

refactor(db, parser, ci): post-review improvements#6

Merged
cendhu merged 3 commits intoLF-Decentralized-Trust-labs:mainfrom
farooqazamwasimnl:feat/04-post-review-improvements
Mar 5, 2026
Merged

refactor(db, parser, ci): post-review improvements#6
cendhu merged 3 commits intoLF-Decentralized-Trust-labs:mainfrom
farooqazamwasimnl:feat/04-post-review-improvements

Conversation

@farooqazamwasimnl
Copy link
Contributor

  • 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>
go-version: '1.24'

- name: Run tests
run: go test -count=1 ./pkg/...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

committer has moved to 1.26.


"github.com/cockroachdb/errors"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric-x-committer/utils/logging"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cendhu cendhu merged commit d2ccb04 into LF-Decentralized-Trust-labs:main Mar 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants