-
Notifications
You must be signed in to change notification settings - Fork 3
chore: allow setting the wrapper sdk version & source id for open feature support #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for explicitly setting the wrapper SDK version and source ID across the SDK. Key changes include:
- Propagating the new sourceId and sdkVersion parameters in API client, event creation, configuration, and dependency injection.
- Updating tests and helper functions to validate and exercise the new parameters.
- Extending the SourceID enum with additional values for various platforms.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/remote/ApiClientImplTest.kt | Updated tests to pass new sourceId and sdkVersion values. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/event/EventInteractorTest.kt | Added sourceId and sdkVersion parameters in event interactor instantiation. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/event/EventCreatorsKtTest.kt | Updated event creator test cases with new parameter assertions. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/event/BKTExceptionToEventDataMetricEventTest.kt | Modified expected sourceId and sdkVersion in metric event tests. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/TestHelpers.kt | Injected new sourceId and sdkVersion in test helper functions. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/LoggerHolderTest.kt | Added a call to LoggerHolder.clearLoggers in the test to avoid concurrency issues. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/BKTConfigTest.kt | Introduced tests validating the wrapper SDK source ID and version behavior. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/remote/ApiClientImpl.kt | Updated the API client to accept and propagate the new parameters. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/request/GetEvaluationsRequest.kt | Removed default values and required passing sourceId and sdkVersion explicitly. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/SourceID.kt | Extended SourceID with additional platform values. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/logger.kt | Added a clearLoggers() method to allow cleanup of registered loggers. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/event/EventInteractor.kt | Propagated new parameters into event creation functions. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/event/EventCreators.kt | Updated all event creation functions to require sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/di/InteractorModule.kt | Updated dependency injection to include sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/di/DataModule.kt | Injected sourceId and sdkVersion from configuration into the data module. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/di/Component.kt | Updated component injection to pass sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt | Extended the configuration and builder to support the new wrapper SDK properties. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTClient.kt | Added a call to LoggerHolder.clearLoggers() upon client destroy. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt
Outdated
Show resolved
Hide resolved
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/di/InteractorModule.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the ability to set the wrapper SDK version and sourceId throughout the SDK, updating both production and test code. Key changes include:
- Adding sourceId and sdkVersion parameters to API client, event creator, and configuration methods.
- Updating tests to supply the new sourceId and sdkVersion values.
- Extending the SourceID enum with new identifiers and adjusting the dependency injection setup accordingly.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/remote/ApiClientImplTest.kt | Updated tests to verify API calls with new sourceId and sdkVersion parameters. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/event/EventInteractorTest.kt | Refactored event tests to use config-based sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt | Modified configuration builder to incorporate wrapper SDK parameters and resolve sourceId/sdVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/SourceID.kt | Extended the SourceID enum with additional values for new SDK integrations. |
Other files across the codebase | Adjusted constructors, DI modules, and event creators to handle the new parameters. |
bucketeer/src/test/kotlin/io/bucketeer/sdk/android/internal/event/EventInteractorTest.kt
Show resolved
Hide resolved
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt
Outdated
Show resolved
Hide resolved
@cre8ivejp please help me to take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces configurable wrapper SDK version and source ID functionality by adding sourceId and sdkVersion parameters to API client, event creation, and configuration methods. It also extends the internal SourceID enum with new entries and fixes a memory leak in LoggerHolder.
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/remote/ApiClientImpl.kt | Updated API calls to pass sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/remote/ApiClient.kt | Changed interface visibility to internal. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/request/RegisterEventsRequest.kt | Made sourceId and sdkVersion required parameters. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/request/GetEvaluationsRequest.kt | Made sourceId and sdkVersion required parameters. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/jsonadapter/SourceIDAdapter.kt | Changed class visibility to internal. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/model/SourceID.kt | Extended the SourceID enum with additional wrapper IDs. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/logger.kt | Added clearLoggers() to clear registered log handlers. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/event/EventInteractor.kt | Updated event creation calls to include sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/event/EventCreators.kt | Updated event creator functions to replace hardcoded sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/di/* | Updated dependency injection modules to pass sourceId and sdkVersion. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt | Revised configuration builder with options for wrapperSdkSourceId and wrapperSdkVersion, with resolution logic. |
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTClient.kt | Ensured loggers are cleared during client destroy. |
bucketeer/src/androidTest/kotlin/io/bucketeer/sdk/android/e2e/* | Added tests verifying events correctly include the new sourceId and sdkVersion properties. |
bucketeer/build.gradle | Removed an unused test dependency. |
Comments suppressed due to low confidence (1)
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/BKTConfig.kt:150
- [nitpick] It may be beneficial to add a more detailed documentation comment for the resolveSourceIdAndSdkVersion, resolveSdkSourceId, and resolveSdkVersion functions to clarify the resolution policy for unsupported wrapper SDK source IDs.
val (sourceId, sdkVersion) = resolveSourceIdAndSdkVersion(...
bucketeer/src/main/kotlin/io/bucketeer/sdk/android/internal/event/EventCreators.kt
Show resolved
Hide resolved
feat: allow set the proxy SourceId chore: typo correct fix: lint fail feat: add SDK version support to the config chore: added comment about wrapperSDKVersion feat: allow set the wrapper SDK version & SourceID
0cfe6e1
to
8452ec9
Compare
@cre8ivejp its ready, please help me to take a look |
OPEN_FEATURE_SWIFT(101), | ||
OPEN_FEATURE_JAVASCRIPT(102), | ||
OPEN_FEATURE_GO(103), | ||
OPEN_FEATURE_NODEJS(104), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We changed this. Please update the android PR, too.
OPEN_FEATURE_NODEJS(104), | |
OPEN_FEATURE_NODE(104), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,6 +1,6 @@ | |||
package io.bucketeer.sdk.android.internal.model | |||
|
|||
enum class SourceID( | |||
internal enum class SourceID( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that Go uses ID
for naming convention, but for Kotlin too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I don't think so. But it was like that a long time ago and I kept it as is.
As its internal enum. Let's me change it to Id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated 587f618
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This PR supports explicitly setting the wrapper SDK version and source ID across the SDK.
Key Changes