Skip to content

Conversation

@prestonvasquez
Copy link
Member

Summary

Background & Motivation

@github-actions github-actions bot added the review-priority-normal Medium Priority PR for Review: within 1 business day label Nov 21, 2025
@prestonvasquez prestonvasquez changed the base branch from master to release/2.4 November 21, 2025 22:23
@mongodb-drivers-pr-bot
Copy link
Contributor

API Change Report

No changes found!

@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Nov 21, 2025

🧪 Performance Results

Commit SHA: 90c0463

There were no significant changes to the performance to report for version 692108d5a4834f0007b2901c.

For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch.

@prestonvasquez prestonvasquez force-pushed the cicd/godriver-3670-update-golangci-lint-v2.6.2 branch from 699b70f to 5e80b53 Compare November 21, 2025 23:47
Update golangci-lint configuration to V2 format and enable gosec G115
(integer overflow) checks. Update linter installation script.
@prestonvasquez prestonvasquez force-pushed the cicd/godriver-3670-update-golangci-lint-v2.6.2 branch 2 times, most recently from ac584ca to 4dd5720 Compare November 22, 2025 00:01
@prestonvasquez prestonvasquez force-pushed the cicd/godriver-3670-update-golangci-lint-v2.6.2 branch 2 times, most recently from 04441fb to b096fe6 Compare November 22, 2025 00:32
Extract binary read/write utility functions from wiremessage.go and bsoncore.go
into a new internal/binaryutil package to centralize bit manipulation operations
and facilitate gosec G115 compliance.
Add SafeConvertNumeric function for overflow-safe integer type conversions.
This utility helps address gosec G115 warnings by providing runtime overflow
detection for integer conversions.
Address gosec G115 integer overflow warnings in the bson package:
- Add SafeConvertNumeric for legitimate overflow risks
- Use nolint for provably safe conversions (e.g., int8/int16/int32 to int32,
  conversions after fitsIn32Bits checks)
- Document why each nolint is safe
Address gosec G115 integer overflow warnings in the mongo package:
- Add SafeConvertNumeric for protocol fields, user data, and len() conversions
- Use nolint where conversions are provably safe
- Handle overflow cases in gridfs, bulk write, and error handling
Address gosec G115 integer overflow warnings in bsoncore:
- Add SafeConvertNumeric for BSON document/array/element length calculations
- Use binaryutil package for safe binary operations
- Document safe conversions with nolint where appropriate
Address gosec G115 integer overflow warnings in driver core:
- Add SafeConvertNumeric for wire message length calculations
- Add SafeConvertNumeric for batch operations and document sequences
- Use binaryutil for safe compression operations
Address gosec G115 integer overflow warnings in authentication:
- Add SafeConvertNumeric for SASL token and buffer size conversions
- Add SafeConvertNumeric for GSSAPI/SSPI buffer operations
Address gosec G115 integer overflow warnings in mongocrypt:
- Add SafeConvertNumeric for binary data length conversions
- Add SafeConvertNumeric for KMS context buffer operations
Address gosec G115 integer overflow warnings in operations:
- Add SafeConvertNumeric for operation timeout and option conversions
- Handle overflow in find, aggregate, distinct, and update operations
Address gosec G115 integer overflow warnings in session handling
Address gosec G115 integer overflow warnings in topology:
- Add SafeConvertNumeric for wire message compression operations
- Add SafeConvertNumeric for server description fields (maxBsonObjectSize, etc.)
- Add SafeConvertNumeric for connection pool size conversions
- Use binaryutil for safe binary operations
Address gosec G115 integer overflow warnings in wiremessage:
- Use binaryutil package for safe binary read/write operations
- Add validation for MsgFlag overflow with nolint for safe conversions
- Document safety of wire protocol flag conversions
Address gosec G115 integer overflow warnings in decimal128:
- Use nolint for bitmask operations (14-bit values always fit in int)
- Use nolint for modulo result conversions (always fit in uint32)
- Document why conversions are safe
Address gosec G115 integer overflow warnings:
- Add SafeConvertNumeric for server version and option conversions
Address gosec G115 integer overflow warnings:
- Add SafeConvertNumeric for log message width and truncation conversions
Address gosec G115 integer overflow warnings in unified test runner:
- Add SafeConvertNumeric for test parameter conversions
- Use nolint for int32 to uint64 conversions (always safe)
- Add SafeConvertNumeric for event count and option conversions
Address gosec G115 integer overflow warnings in:
- internal/credproviders: credential provider conversions
- internal/errutil: error code conversions
- internal/israce: build tag updates
- internal/integration: test helper conversions
- x/mongo/driver test files
@prestonvasquez prestonvasquez force-pushed the cicd/godriver-3670-update-golangci-lint-v2.6.2 branch from b096fe6 to 90c0463 Compare November 22, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd review-priority-normal Medium Priority PR for Review: within 1 business day

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant