feat: dynamic SDK version retrieval#45
Merged
mfiedorowicz merged 1 commit intodevelopfrom Sep 3, 2025
Merged
Conversation
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
|
Go test coverage
Total coverage: 78.7% |
jajeffries
approved these changes
Sep 3, 2025
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 refactors how the SDK version is determined and propagated throughout the codebase, replacing the previous hardcoded
SDKVersionconstant with a dynamic value retrieved at runtime. The SDK name and version are now cached in both gRPC and DryRun clients, ensuring consistency and easier maintainability. Additional tests were added to verify correct SDK version detection and caching behavior.SDK Version Detection and Propagation:
getSDKVersion()to dynamically determine the SDK version using Go build info, with a fallback to"dev"if unavailable. The function checks module dependencies for the SDK version. (diode/client.go, diode/client.goR182-R198)SDKVersionconstant and updated all references to use the new dynamic value. (diode/client.go, [1];diode/dryrun.go, [2]Client Initialization and Metadata:
GRPCClientandDryRunClientstructs to includesdkNameandsdkVersionfields, which are set during client initialization and used in metadata and requests. (diode/client.go, [1] [2];diode/dryrun.go, [3] [4]diode/client.go, [1] [2];diode/dryrun.go, [3]userAgent()helper function. (diode/client.go, diode/client.goL566-L570)Testing Enhancements:
diode/client_test.go, [1];diode/dryrun_test.go, [2]