Update connector dependencies#193
Conversation
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates connector dependencies across multiple HTTP connectors, including major migrations to AWS SDK v2 and GCP Pub/Sub v2, along with updates to various other dependencies and Go version.
Key Changes:
- Migration from AWS SDK v1 to v2 with updated API patterns and types
- Migration from GCP Pub/Sub v1 to v2 with API method name changes
- Removal of
github.com/pkg/errorsin favor of standard libraryerrorsandfmt.Errorf - Updated Go version to 1.25.5
- Modernized loop syntax using
rangeover integers - Updated
logger.Sync()calls to properly handle ignored errors - Updated multiple dependency versions in go.mod and go.sum
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated Go version and migrated AWS SDK and GCP Pub/Sub to v2 APIs, removed pkg/errors dependency |
| go.sum | Updated checksums for all new dependency versions |
| common/util.go | Migrated AWS SDK v1 to v2, replaced pkg/errors with fmt.Errorf, refactored GetAwsConfig function |
| aws-sqs-http-connector/main.go | Updated to AWS SDK v2 API patterns, fixed logger.Sync handling |
| aws-sqs-http-connector/test/validate/main.go | Updated to AWS SDK v2 API patterns for test validation |
| aws-kinesis-http-connector/main.go | Updated to AWS SDK v2 types and API methods, fixed logger.Sync handling |
| gcp-pubsub-http-connector/main.go | Migrated to Pub/Sub v2 API with Subscriber/Publisher pattern, improved error handling |
| kafka-http-connector/main.go | Replaced pkg/errors with standard library, fixed error message capitalization, fixed logger.Sync handling |
| redis-http-connector/main.go | Updated loop syntax and fixed logger.Sync handling |
| redis-http-connector/test/publisher/publish_message.go | Modernized loop syntax to use range over integers |
| redis-http-connector/test/consumer/consume_messages.go | Removed unused variable and modernized loop syntax |
| rabbitmq-http-connector/main.go | Fixed logger.Sync handling |
| nats-streaming-http-connector/main.go | Fixed logger.Sync handling |
| nats-streaming-http-connector/test/producer/main.go | Modernized loop syntax to use range over integers |
| nats-jetstream-http-connector/main.go | Fixed logger.Sync handling to ignore return value |
| redis-http-connector/version | Bumped version from v0.9 to v0.10 |
| rabbitmq-http-connector/version | Bumped version from v0.16 to v0.17 |
| nats-streaming-http-connector/version | Bumped version from v0.19 to v0.20 |
| nats-jetstream-http-connector/version | Bumped version from v0.11 to v0.12 |
| kafka-http-connector/version | Bumped version from v0.19 to v0.20 |
| gcp-pubsub-http-connector/version | Bumped version from v0.12 to v0.13 |
| aws-sqs-http-connector/version | Bumped version from v0.19 to v0.20 |
| aws-kinesis-http-connector/version | Bumped version from v0.18 to v0.19 |
| .golangci.yaml | Removed errcheck exclusion for logger.Sync since it's now handled in code |
| .github/workflows/lint.yml | Updated golangci-lint version from v2.1.6 to v2.7.2 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| config.Endpoint = &endpoint | ||
| options = append(options, config.WithBaseEndpoint(os.Getenv("AWS_ENDPOINT"))) | ||
| } | ||
| return config.LoadDefaultConfig(context.TODO(), options...) |
There was a problem hiding this comment.
The context parameter 'ctx' is being ignored. Line 139 uses 'context.TODO()' instead of the 'ctx' parameter that was passed to the function. This defeats the purpose of passing context and could lead to issues with context cancellation and deadline propagation. Use the 'ctx' parameter instead.
| return config.LoadDefaultConfig(context.TODO(), options...) | |
| return config.LoadDefaultConfig(ctx, options...) |
| _, err = svc.SendMessage(&sqs.SendMessageInput{ | ||
| DelaySeconds: aws.Int64(10), | ||
| _, err = svc.SendMessage(context.TODO(), &sqs.SendMessageInput{ | ||
| DelaySeconds: *aws.Int32(10), |
There was a problem hiding this comment.
Incorrect use of pointer dereference operator. The expression 'aws.Int32(10)' attempts to dereference the result of 'aws.Int32(10)', which returns a pointer. The field 'DelaySeconds' expects an 'int32', not a dereferenced pointer. Remove the '' operator and use 'aws.Int32(10)' directly, or use '10' as an int32 literal.
| DelaySeconds: *aws.Int32(10), | |
| DelaySeconds: aws.Int32(10), |
| continue | ||
| } | ||
| if err == nil && resp.StatusCode >= 200 && resp.StatusCode < 300 { | ||
| if resp.StatusCode >= 200 && resp.StatusCode < 300 { |
There was a problem hiding this comment.
Logic error in condition check. Line 105 removed the 'err == nil' check from the condition. Now the code checks only the status code without verifying that 'err' is nil. This could lead to returning a response even when there was an error making the request. The condition should verify both that there's no error AND the status code is successful.
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
No description provided.