-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into intercom.refactor-proxy
- Loading branch information
Showing
30 changed files
with
3,304 additions
and
230 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,14 @@ jobs: | |
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
- name: Clone Devops Repo | ||
run: | | ||
git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-devops.git | ||
- name: Update Helm Charts and Raise Pull Request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
run: | | ||
git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-devops.git | ||
cd rudder-devops | ||
git checkout -b shared-transformer-rollback-${{ steps.target-version.outputs.tag_name }} | ||
|
@@ -57,3 +60,38 @@ jobs: | |
git push -u origin shared-transformer-rollback-${{ steps.target-version.outputs.tag_name }} | ||
gh pr create --fill | ||
- name: Update helm charts and raise pull request for enterprise customers on dedicated transformers | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
run: | | ||
cd rudder-devops | ||
git checkout -b dedicated-transformer-rollback-${{ steps.target-version.outputs.tag_name }} | ||
cd customer-objects | ||
declare -a enabled_ut_customers=() | ||
declare -a sub_directories=('enterprise-us' 'enterprise-eu') | ||
# identify the customers enabled in sub-directories | ||
for directory in "${sub_directories[@]}"; do | ||
for f in "./$directory"/*; do | ||
[[ -f $f ]] || continue | ||
enabled="$(yq e '.spec.user_transformer.enabled' $f)" | ||
if [ $enabled == "true" ]; then | ||
enabled_ut_customers+=( $f ) | ||
fi | ||
done | ||
done | ||
# bump up the customers version and repository information | ||
for customer in "${enabled_ut_customers[@]}"; do | ||
yq eval -i ".spec.user_transformer.image.version=\"${{ steps.target-version.outputs.tag_name }}\"" $customer | ||
git add $customer | ||
done | ||
git commit -m "chore: rollback dedicated transformers to ${{ steps.target-version.outputs.tag_name }}" | ||
git push -u origin dedicated-transformer-rollback-${{ steps.target-version.outputs.tag_name }} | ||
gh pr create --fill |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.19.0 | ||
18.19.1 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
bindings: | ||
- name: EventType | ||
path: ../../../../constants | ||
- path: ../../bindings/jsontemplate | ||
- name: defaultRequestConfig | ||
path: ../../../../v0/util | ||
|
||
steps: | ||
- name: validateInput | ||
template: | | ||
$.assert(.message.type, "message Type is not present. Aborting message"); | ||
$.assert(.message.type in {{$.EventType.([.IDENTIFY, .TRACK])}}, | ||
"message type " + .message.type + " is not supported"); | ||
$.assertConfig(.destination.Config.publicKey, "publicKey is not present. Aborting message"); | ||
$.context.email = .message.().({{{{$.getGenericPaths("emailOnly")}}}}); | ||
$.context.ko_profile_id = .message.traits.ko_profile_id ?? .message.context.traits.ko_profile_id ?? .message.properties.ko_profile_id; | ||
$.assert($.context.email || $.context.ko_profile_id, "Neither email or ko_profile_id are present on traits. Aborting message"); | ||
- name: setMessageType | ||
template: | | ||
$.context.messageType = .message.type.toLowerCase(); | ||
- name: preparePayloadForIdentify | ||
condition: $.context.messageType === {{$.EventType.IDENTIFY}} | ||
template: | | ||
const traits = .message.traits ?? .message.context.traits ?? {}; | ||
const koTraits = traits{~['ko_profile_id']} | ||
const basePayload = { | ||
email: $.context.email, | ||
profile_id: $.context.ko_profile_id, | ||
identifies: [{ | ||
type: $.context.messageType, | ||
sent_at: .message.().({{{{$.getGenericPaths("timestamp")}}}}), | ||
traits: koTraits | ||
}] | ||
}; | ||
$.context.payload = basePayload | ||
- name: preparePayloadForTrack | ||
condition: $.context.messageType === {{$.EventType.TRACK}} | ||
template: | | ||
const properties = .message.properties ?? {}; | ||
const koProperties = properties{~['ko_profile_id']} | ||
const basePayload = { | ||
ip: .message.context.ip ?? .message.request_ip, | ||
email: $.context.email, | ||
profile_id: $.context.ko_profile_id, | ||
events: [{ | ||
type: $.context.messageType, | ||
event: .message.event, | ||
message_id: .message.messageId, | ||
sent_at: .message.().({{{{$.getGenericPaths("timestamp")}}}}), | ||
properties: koProperties, | ||
context: .message.context | ||
}] | ||
}; | ||
$.context.payload = basePayload | ||
- name: buildResponseForProcessTransformation | ||
template: | | ||
const response = $.defaultRequestConfig(); | ||
response.body.JSON = $.context.payload; | ||
response.endpoint = "https://api2.getkoala.com/web/projects/" + .destination.Config.publicKey + "/batch"; | ||
response.headers = { | ||
"content-type": "application/json" | ||
}; | ||
response |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
bindings: | ||
- name: handleRtTfSingleEventError | ||
path: ../../../../v0/util/index | ||
|
||
steps: | ||
- name: validateInput | ||
template: | | ||
$.assert(Array.isArray(^) && ^.length > 0, "Invalid event array") | ||
- name: transform | ||
externalWorkflow: | ||
path: ./procWorkflow.yaml | ||
loopOverInput: true | ||
|
||
- name: successfulEvents | ||
template: | | ||
$.outputs.transform#idx.output.({ | ||
"batchedRequest": ., | ||
"batched": false, | ||
"destination": ^[idx].destination, | ||
"metadata": ^[idx].metadata[], | ||
"statusCode": 200 | ||
})[] | ||
- name: failedEvents | ||
template: | | ||
$.outputs.transform#idx.error.( | ||
$.handleRtTfSingleEventError(^[idx], .originalError ?? ., {}) | ||
)[] | ||
- name: finalPayload | ||
template: | | ||
[...$.outputs.failedEvents, ...$.outputs.successfulEvents] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ | |
"user_id": "rudder01", | ||
"id": "shopify_test_get_items_fail", | ||
"query_parameters": { | ||
"topic": ["carts_update"] | ||
"topic": ["carts_update"], | ||
"writeKey": ["wr"] | ||
}, | ||
"token": "shopify_test_get_items_fail", | ||
"email": "[email protected]", | ||
|
@@ -115,7 +116,8 @@ | |
"input": { | ||
"cart_token": "shopifyGetAnonymousId", | ||
"query_parameters": { | ||
"topic": ["checkouts_delete"] | ||
"topic": ["checkouts_delete"], | ||
"writeKey": ["wr"] | ||
}, | ||
"line_items": [], | ||
"note": null, | ||
|
@@ -154,7 +156,8 @@ | |
"input": { | ||
"id": "shopify_test3", | ||
"query_parameters": { | ||
"topic": ["carts_update"] | ||
"topic": ["carts_update"], | ||
"writeKey": ["wr"] | ||
}, | ||
"token": "shopify_test3", | ||
"line_items": [], | ||
|
@@ -252,7 +255,8 @@ | |
"user_id": "rudder01", | ||
"id": "shopify_test_cart", | ||
"query_parameters": { | ||
"topic": ["carts_update"] | ||
"topic": ["carts_update"], | ||
"writeKey": ["wr"] | ||
}, | ||
"token": "shopify_test_cart", | ||
"email": "[email protected]", | ||
|
@@ -1256,7 +1260,8 @@ | |
"input": { | ||
"id": "shopify_test4", | ||
"query_parameters": { | ||
"topic": ["carts_update"] | ||
"topic": ["carts_update"], | ||
"writeKey": ["wr"] | ||
}, | ||
"token": "shopify_test4", | ||
"line_items": [], | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.