fix: Update integrationName to support postfix#28
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a custom postfix on the integrationName via custom flags. It updates the integrationName generation logic in the main kit file and adds a new test to validate the expected output when a custom postfix is provided.
- Updates integrationName generation with a new helper function.
- Modifies the attachLauncher call to receive the custom integrationName.
- Adds test coverage for the custom integration name behavior.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/src/tests.js | Adds a test to check that custom integrationName postfix is appended correctly. |
| src/Rokt-Kit.js | Introduces a generateIntegrationName helper and updates attachLauncher to support the custom postfix. |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the behavior of integrating a postfix into the integrationName for the Rokt forwarder based on the customFlags configuration.
- Added a new test to validate that a custom postfix is appended to integrationName when provided.
- Updated Rokt-Kit.js to compute integrationName using a new generateIntegrationName helper and modified the attachLauncher function to pass this value.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/src/tests.js | New test ensuring custom integration postfix is correctly applied. |
| src/Rokt-Kit.js | Updated integrationName generation and its propagation to the launcher. |
Comments suppressed due to low confidence (1)
test/src/tests.js:204
- [nitpick] Consider obtaining integrationName using the generateIntegrationName helper instead of duplicating the string construction logic in tests.
window.Rokt.integrationName = 'mParticle_wsdkv_1.2.3_kitv_' + packageVersion + '_' + customIntegrationName;
|
|
||
| var customIntegrationName = | ||
| customFlags && customFlags['Rokt.integrationName']; | ||
| self.integrationName = generateIntegrationName(customIntegrationName); |
There was a problem hiding this comment.
Any reason to keep the integration name on the class? It's only used once, I'd just call it a local variable that passes into attachLauncher instead
There was a problem hiding this comment.
Good callout.
There was a problem hiding this comment.
Pull Request Overview
This PR updates the integrationName generation logic to support a configurable postfix via customFlags and extends the corresponding test coverage.
- Updates the Rokt-Kit constructor to generate integrationName using an optional custom integration name.
- Updates the test suite to verify the appended integration name functionality.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/src/tests.js | Adds a test case to validate the custom integrationName postfix logic. |
| src/Rokt-Kit.js | Updates constructor and launcher attachment to incorporate customFlags for integrationName generation. |
Comments suppressed due to low confidence (1)
test/src/tests.js:224
- [nitpick] Consider extracting the expected integrationName into a variable to reduce duplication and improve test clarity.
window.Rokt.integrationName.should.equal('mParticle_wsdkv_1.2.3_kitv_' + packageVersion + '_' + customIntegrationName);
| var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion; | ||
|
|
||
| if (customIntegrationName) { | ||
| name += '_' + customIntegrationName; |
There was a problem hiding this comment.
[nitpick] Consider using template literals to construct the integrationName string, which would improve readability and maintainability.
| var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion; | |
| if (customIntegrationName) { | |
| name += '_' + customIntegrationName; | |
| var name = `mParticle_wsdkv_${coreSdkVersion}_kitv_${kitVersion}`; | |
| if (customIntegrationName) { | |
| name += `_${customIntegrationName}`; |
Summary
Add a postfix for
integrationNamethat can be configured via Custom Flags.Testing Plan
Pass in custom flag via window.mParticle.config to add an extra string to the
integrationName.