-
Notifications
You must be signed in to change notification settings - Fork 257
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
[MOLOCO] Add a new field Platform Name
in settings
#2114
Conversation
'Content-Type': 'application/json' | ||
} | ||
private getEndpoint() { | ||
return `https://${this.platformName.replace(/_/g, '-')}-evt.rmp-api.moloco.com/cdp/SEGMENT` |
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.
Pointer: Now uses platformName
instead of platform
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.
hi @heonjang - we'll need to handle the case where platformName is undefined. This will be the case for all customers who have the Integration already in use.
async sendEvent(body: Record<string, any>): Promise<ModifiedResponse> { | ||
const headers = { | ||
'x-api-key': this.apiKey, | ||
'x-platform-id': this.platformId, |
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.
Pointer: Now uses platformId
instead of platform
@@ -32,6 +32,12 @@ const destination: DestinationDefinition<Settings> = { | |||
type: 'string', | |||
required: true | |||
}, | |||
platformName: { |
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.
Newly added platformName
field
Platform Name
in settings
label: 'Platform Name', | ||
description: 'Name of the platform', | ||
type: 'string', | ||
required: true |
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.
hi @heonjang - we can't add a new 'required' field to code which is already in use by customers. It will result in all events being dropped and not processed by customers who have already set up the Destination.
Can we set required:false, and then in code ensure that we don't fail if this field is undefined?
hi @heonjang thanks for raising this PR. Thanks, |
@joe-ayoub-segment Thanks for the review! I've updated the code and made that field optional. It will now use platformId if platformName is not passed when forging a URL. |
hi @heonjang - looks like a bunch of failing CI checks. Any chance you could take a look please?
Looks like you need to do something like this:
in the common/request-client.ts file |
Nevermind - I'll merge it now and apply the fix in main |
hi @heonjang this PR has been deployed. Please confirm you are happy with the change. |
Everything looks great. Thank you for your work! |
Testing
Summary
This PR adds a new field to settings:
platformName
Previously,
platform
was used for both URL creation and in the request header, but nowplatformName
will be used for URL creation, andplatformId
will be used for the header separately.Note: there are lots of changes automatically created due to pre-commit linter