Repository navigation
Conversation
* chore: ai generated docs for airship * chore: migrate some streaming destination to new test format (#4435) * chore: migrate some streaming destination to new test format * chore: rebase to develop * fix: type * chore: review comments * chore: ing-svc workflow takes latest go tests * chore: restart deployment after creating a develop image (#4528) * chore: restart deployment after creating a develop image * fix: review comments * fix: add dependencies for kubectl * chore: review comments * chore: review comments * chore: add another job for dedicated deployment * chore: update sku mappings for product viewed event (#4467) * chore: update sku mappings for product viewed event, fix skipped tests * chore: remove skip false --------- Co-authored-by: Mahesh Kutty <[email protected]> * chore: add checkout step for deployment restart action (#4532) * chore: auto create ing-svc pr for go-tests * chore: restructure workflows * chore: workflow add permissions * chore: address security and compatibility issues * refactor: remove unused marketo bulk upload metrics (#4537) - Remove 13 unused marketo_bulk_upload metrics that were defined but not collected - These metrics were from old implementation and not actively used - Reduces Prometheus cardinality and improves performance - Keeps only actively used marketo metrics: fetch_token, lead_lookup, activity Fixes INT-3978 * chore: use latest vars for pod restart (#4538) * chore: gitworkflow version upgrades * chore: scan push revert to old version * chore: add lint rules to catch invalid or unresolved imports (#4531) * feat: onboard postscript destination (#4438) * feat: onboard postscript destination * chore: add nwhandler tests * chore: add comments, update tests, fix properties inconsistencies * chore: address comments * chore: add util tests * feat: onboard postscript destination * chore: add nwhandler tests * chore: add comments, update tests, fix properties inconsistencies * chore: address comments * chore: add util tests * chore: address comments * fix: subscriber updation logic * chore: add tests for code coverage * chore: address comments * chore: address comments, add docs * chore: remove catch --------- Co-authored-by: Mahesh Kutty <[email protected]> Co-authored-by: Mahesh Kutty <[email protected]> * chore(release): 1.106.0 --------- Co-authored-by: Vinay Teki <[email protected]> Co-authored-by: Dilip Kola <[email protected]> Co-authored-by: Manish Kumar <[email protected]> Co-authored-by: Mahesh Kutty <[email protected]> Co-authored-by: Yashasvi Bajpai <[email protected]> Co-authored-by: Mahesh Kutty <[email protected]> Co-authored-by: GitHub Actions <[email protected]>
Summary by CodeRabbit
WalkthroughThis update introduces a new Postscript destination integration, including configuration, transformation logic, utility functions, and comprehensive unit tests. Additionally, it adds new and updated GitHub Actions workflows for deployment automation, dependency updates, and notification improvements. Several workflow versions are bumped, and minor feature flag and type definition changes are included. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant EKSCluster
participant K8sAPI
GitHubActions->>GitHubActions: Setup AWS credentials & kubectl
GitHubActions->>EKSCluster: Update kubeconfig
loop For each namespace and deployment
GitHubActions->>K8sAPI: kubectl rollout restart deployment
GitHubActions->>K8sAPI: kubectl rollout status deployment
end
GitHubActions->>GitHubActions: Output completion message
sequenceDiagram
participant RudderStack
participant PostscriptTransform
participant PostscriptAPI
loop For each event in batch
RudderStack->>PostscriptTransform: Process event
alt Identify event with lookup
PostscriptTransform->>PostscriptAPI: Lookup subscriber
PostscriptAPI-->>PostscriptTransform: Lookup result
PostscriptTransform->>PostscriptAPI: Create or update subscriber
else Track event
PostscriptTransform->>PostscriptAPI: Create custom event
end
PostscriptAPI-->>PostscriptTransform: API response
end
PostscriptTransform->>RudderStack: Batch response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes
Possibly related PRs
Suggested reviewers
Suggestions for improvement:
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (11)
.github/actions/restart-deployment/action.yml (2)
41-43: Trim whitespace for deployment names as well
DEPLOYMENTSmay inherit spaces ("foo, bar"). Mirror the namespace trimming to avoid label-mismatch.- IFS=',' read -ra DEPLOYMENTS <<< "${{ inputs.deployment-name }}" + IFS=',' read -ra DEPLOYMENTS <<< "${{ inputs.deployment-name }}" + for i in "${!DEPLOYMENTS[@]}"; do + DEPLOYMENTS[$i]=$(echo "${DEPLOYMENTS[$i]}" | xargs) + done
49-58: Remove trailing spaces – YAML-lint flagged
Blank lines 52 and 57 contain stray spaces. They are harmless at runtime but failyamllintin pedantic mode..github/workflows/prepare-for-dev-deploy.yml (2)
88-105: Consider dropping the extracheckout– composite action does not require source
restart-deploymentonly needs the action directory itself, which is already in the workspace. Skipping checkout speeds the job ~30 s.
118-122: Strip trailing spaces & add terminal newline
Line 121 has padding after the deployment name, and the file lacks a final newline – both flagged byyamllint.- deployment-name: rudderstack-transformer + deployment-name: rudderstack-transformer +.github/workflows/update-ingestion-service.yml (2)
76-81:go getis deprecated for editing go.modSince Go 1.20,
go getoutsidego installis discouraged.
A future‐proof alternative:go mod edit -require=github.com/rudderlabs/rudder-transformer/go@${LATEST_SHA} go mod tidyNothing breaks today, but switching avoids deprecation warnings.
101-108: Remove trailing spaces to satisfy yamllintLine 107 contains whitespace-only content, tripping the lint check.
Simply delete the spaces on the blank line.- +src/v1/destinations/postscript/networkHandler.ts (1)
85-90: Consider modernizing the network handler patternThe current implementation uses legacy function constructor syntax. Consider refactoring to use ES6 class syntax or a factory function for better readability and type safety:
-function networkHandler(this) { - this.prepareProxy = prepareProxyRequest; - this.proxy = proxyRequest; - this.processAxiosResponse = processAxiosResponse; - this.responseHandler = responseHandler; -} +class NetworkHandler { + prepareProxy = prepareProxyRequest; + proxy = proxyRequest; + processAxiosResponse = processAxiosResponse; + responseHandler = responseHandler; +} + +export { NetworkHandler as networkHandler };Alternatively, if maintaining consistency with other handlers in the codebase is important, the current implementation is acceptable.
src/v0/destinations/postscript/transform.ts (1)
262-269: Consider validating connection parameter instead of providing defaultsThe fallback object for the connection parameter might mask configuration issues. Consider validating that the connection is properly provided:
- postscriptConnection ?? { - sourceId: 'default-source-id', - destinationId: 'default-destination-id', - enabled: true, - config: { - destination: {}, - }, - }, + postscriptConnection,If the connection is required, it's better to fail early with a clear error rather than using defaults that might not be meaningful.
src/v0/destinations/postscript/utils.test.ts (1)
599-602: Maintain consistent return structureFor consistency with other test cases, include the
subscriberId: undefinedproperty in the return objects.expect(results).toEqual([ - { exists: false, identifierValue: '+1234567890', identifierType: 'phone' }, - { exists: false, identifierValue: '+0987654321', identifierType: 'phone' }, + { exists: false, subscriberId: undefined, identifierValue: '+1234567890', identifierType: 'phone' }, + { exists: false, subscriberId: undefined, identifierValue: '+0987654321', identifierType: 'phone' }, ]);src/v0/destinations/postscript/utils.ts (1)
308-340: Clean batch response implementationThe implementation correctly creates individual responses for each event. Consider documenting why PostScript uses individual responses instead of true batching for future maintainers.
Add a comment explaining the individual response approach:
+ // PostScript API doesn't support bulk operations, so we create individual requests for each event // For PostScript, we create individual responses for each event events.forEach((event) => {src/v0/destinations/postscript/types.ts (1)
167-173: Consider removing redundant interfaceThe
RespListinterface appears to duplicate fields fromProcessedEvent. Consider whether this interface is necessary or ifProcessedEventcan be used directly.If this interface is not used elsewhere in the codebase, consider removing it to reduce redundancy and maintenance overhead.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (32)
.eslintrc.jsonis excluded by!**/*.jsonCHANGELOG.mdis excluded by!**/*.mdgo/webhook/testcases/testdata/testcases/shopify/identify_call_for_customers_create_event_0.jsonis excluded by!**/*.jsonpackage-lock.jsonis excluded by!**/package-lock.json,!**/*.jsonpackage.jsonis excluded by!**/*.jsonsrc/sources/shopify/pixelEventsMappings/productViewedEventMapping.jsonis excluded by!**/*.jsonsrc/v0/destinations/airship/README.mdis excluded by!**/*.mdsrc/v0/destinations/airship/docs/businesslogic.mdis excluded by!**/*.mdsrc/v0/destinations/airship/docs/retl.mdis excluded by!**/*.mdsrc/v0/destinations/postscript/README.mdis excluded by!**/*.mdsrc/v0/destinations/postscript/data/postscriptSubscriberConfig.jsonis excluded by!**/*.jsonsrc/v0/destinations/postscript/docs/businesslogic.mdis excluded by!**/*.mdsrc/v0/destinations/postscript/docs/retl.mdis excluded by!**/*.mdtest/integrations/component.test.tsis excluded by!**/test/**test/integrations/destinations/eventbridge/processor/data.tsis excluded by!**/test/**test/integrations/destinations/kafka/batch/data.tsis excluded by!**/test/**test/integrations/destinations/kafka/processor/data.tsis excluded by!**/test/**test/integrations/destinations/kinesis/processor/data.tsis excluded by!**/test/**test/integrations/destinations/personalize/processor/data.tsis excluded by!**/test/**test/integrations/destinations/postscript/common.tsis excluded by!**/test/**test/integrations/destinations/postscript/dataDelivery/business.tsis excluded by!**/test/**test/integrations/destinations/postscript/dataDelivery/data.tsis excluded by!**/test/**test/integrations/destinations/postscript/dataDelivery/network.tsis excluded by!**/test/**test/integrations/destinations/postscript/router/errorHandlingTestData.tsis excluded by!**/test/**test/integrations/destinations/postscript/router/identifyTestData.tsis excluded by!**/test/**test/integrations/destinations/postscript/router/mixedEventsTestData.tsis excluded by!**/test/**test/integrations/destinations/postscript/router/trackTestData.tsis excluded by!**/test/**test/integrations/sources/shopify/pixelMappingTests/CheckoutEventsTests.tsis excluded by!**/test/**test/integrations/sources/shopify/pixelMappingTests/CheckoutStepsTests.tsis excluded by!**/test/**test/integrations/sources/shopify/pixelMappingTests/ProductEventsTests.tsis excluded by!**/test/**test/integrations/testTypes.tsis excluded by!**/test/**test/integrations/testUtils.tsis excluded by!**/test/**
📒 Files selected for processing (22)
.github/actions/restart-deployment/action.yml(1 hunks).github/workflows/build-push-docker-image.yml(3 hunks).github/workflows/dt-test-and-report-code-coverage.yml(1 hunks).github/workflows/ingestion-service-test.yml(1 hunks).github/workflows/prepare-for-dev-deploy.yml(1 hunks).github/workflows/prepare-for-prod-dt-deploy.yml(1 hunks).github/workflows/publish-new-release.yml(1 hunks).github/workflows/slack-notify.yml(1 hunks).github/workflows/update-ingestion-service.yml(1 hunks)src/features.ts(1 hunks)src/sources/shopify/webpixelTransformations/pixelUtils.test.js(2 hunks)src/types/controlPlaneConfig.ts(1 hunks)src/util/prometheus.js(5 hunks)src/v0/destinations/eventbridge/transform.js(2 hunks)src/v0/destinations/postscript/config.ts(1 hunks)src/v0/destinations/postscript/transform.test.ts(1 hunks)src/v0/destinations/postscript/transform.ts(1 hunks)src/v0/destinations/postscript/types.ts(1 hunks)src/v0/destinations/postscript/utils.test.ts(1 hunks)src/v0/destinations/postscript/utils.ts(1 hunks)src/v1/destinations/postscript/networkHandler.test.ts(1 hunks)src/v1/destinations/postscript/networkHandler.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit Configuration File
Focus on ESLint errors (max 3) and warnings (max 5).
Files:
src/sources/shopify/webpixelTransformations/pixelUtils.test.jssrc/v0/destinations/eventbridge/transform.jssrc/util/prometheus.js
🧠 Learnings (7)
src/sources/shopify/webpixelTransformations/pixelUtils.test.js (3)
Learnt from: krishna2020
PR: #4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function in Shopify source transformation throws an error if request is not defined, making additional null checks in getEventFromV2Request function unnecessary.
Learnt from: krishna2020
PR: #4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function in the Shopify source throws an error if request is not defined, making additional null checks in getEventFromV2Request function unnecessary.
Learnt from: anantjain45823
PR: #2842
File: src/v1/sources/shopify/identifierEventsLayer.test.js:5-40
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The processIdentifierEvent function in identifierEventsLayer.test.js is designed to succeed for any input, hence no negative test cases are required.
src/v0/destinations/eventbridge/transform.js (6)
Learnt from: krishna2020
PR: #4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function in Shopify source transformation throws an error if request is not defined, making additional null checks in getEventFromV2Request function unnecessary.
Learnt from: vinayteki95
PR: #4220
File: src/middlewares/routerTransformCompactedPayloadV1.ts:13-24
Timestamp: 2025-04-02T08:21:38.217Z
Learning: In the Rudder Transformer codebase, use generic Error objects instead of TransformationError when error monitoring with Bugsnag is needed, as TransformationError is configured to not trigger Bugsnag alerts.
Learnt from: ItsSudip
PR: #4186
File: src/middlewares/arraySpreader.ts:48-63
Timestamp: 2025-04-08T02:59:55.677Z
Learning: In the ArraySpreader/BaseSpreader middleware, error handling for the transform function is already implemented in the caller (BaseSpreader's middleware method), making additional error handling in individual transform functions unnecessary.
Learnt from: krishna2020
PR: #4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function throws an error if request is not defined, making additional null checks in the getEventFromV2Request function unnecessary.
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
Learnt from: krishna2020
PR: #4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function in the Shopify source throws an error if request is not defined, making additional null checks in getEventFromV2Request function unnecessary.
src/v0/destinations/postscript/transform.ts (2)
Learnt from: ItsSudip
PR: #4497
File: src/v0/destinations/tiktok_ads/transformV2.js:686-691
Timestamp: 2025-07-15T06:27:07.528Z
Learning: For TikTok Ads destination in src/v0/destinations/tiktok_ads/transformV2.js, there are plans for a future enhancement to group events by eventSource when batching to ensure all events in a batch have the same event_source value, as acknowledged by ItsSudip in PR #4497.
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
src/v0/destinations/postscript/transform.test.ts (3)
Learnt from: anantjain45823
PR: #2842
File: src/v1/sources/shopify/identifierEventsLayer.test.js:5-40
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The processIdentifierEvent function in identifierEventsLayer.test.js is designed to succeed for any input, hence no negative test cases are required.
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
Learnt from: ItsSudip
PR: #4497
File: src/v0/destinations/tiktok_ads/transformV2.js:686-691
Timestamp: 2025-07-15T06:27:07.528Z
Learning: For TikTok Ads destination in src/v0/destinations/tiktok_ads/transformV2.js, there are plans for a future enhancement to group events by eventSource when batching to ensure all events in a batch have the same event_source value, as acknowledged by ItsSudip in PR #4497.
src/v0/destinations/postscript/utils.test.ts (4)
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
Learnt from: anantjain45823
PR: #2842
File: src/v1/sources/shopify/identifierEventsLayer.test.js:5-40
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The processIdentifierEvent function in identifierEventsLayer.test.js is designed to succeed for any input, hence no negative test cases are required.
Learnt from: ItsSudip
PR: #4497
File: src/v0/destinations/tiktok_ads/transformV2.js:686-691
Timestamp: 2025-07-15T06:27:07.528Z
Learning: For TikTok Ads destination in src/v0/destinations/tiktok_ads/transformV2.js, there are plans for a future enhancement to group events by eventSource when batching to ensure all events in a batch have the same event_source value, as acknowledged by ItsSudip in PR #4497.
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js assumes metadata is always an array throughout its implementation, but defensive programming should be added to handle cases where metadata might not be an array type to prevent runtime errors.
src/util/prometheus.js (1)
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
src/v0/destinations/postscript/utils.ts (2)
Learnt from: maheshkutty
PR: #4359
File: src/v0/util/index.js:2272-2272
Timestamp: 2025-05-29T13:29:39.436Z
Learning: The combineBatchRequestsWithSameJobIds function in src/v0/util/index.js is used by both Mixpanel and Google AdWords Offline Conversions destinations in production. The function assumes metadata is always an array in multiple operations (forEach, filter, sort, map) and needs defensive programming to handle non-array metadata cases to prevent runtime errors.
Learnt from: ItsSudip
PR: #4497
File: src/v0/destinations/tiktok_ads/transformV2.js:686-691
Timestamp: 2025-07-15T06:27:07.528Z
Learning: For TikTok Ads destination in src/v0/destinations/tiktok_ads/transformV2.js, there are plans for a future enhancement to group events by eventSource when batching to ensure all events in a batch have the same event_source value, as acknowledged by ItsSudip in PR #4497.
🧬 Code Graph Analysis (4)
src/v1/destinations/postscript/networkHandler.test.ts (2)
src/v1/destinations/postscript/networkHandler.ts (1)
networkHandler(92-92)src/v0/destinations/postscript/config.ts (1)
DESTINATION_NAME(27-27)
src/v0/destinations/postscript/transform.ts (5)
src/v0/destinations/postscript/types.ts (3)
PostscriptRouterRequest(191-195)ProcessedEvent(143-152)SubscriberLookupResult(157-162)src/v0/util/index.js (4)
getFieldValueFromMessage(687-693)getDestinationExternalID(1161-1170)getEventType(1950-1950)handleRtTfSingleEventError(1789-1806)src/v0/destinations/postscript/config.ts (3)
EXTERNAL_ID_TYPES(20-24)SUBSCRIBERS_ENDPOINT(11-11)CUSTOM_EVENTS_ENDPOINT(12-12)src/v0/destinations/postscript/utils.ts (4)
buildSubscriberPayload(78-153)buildCustomEventPayload(164-212)performSubscriberLookup(223-295)batchResponseBuilder(308-340)src/constants/index.js (1)
EventType(1-10)
src/v1/destinations/postscript/networkHandler.ts (3)
src/types/destinationTransformation.ts (3)
ResponseHandlerParams(247-257)ResponseProxyObject(262-270)DeliveryJobState(229-233)src/v0/destinations/postscript/config.ts (1)
DESTINATION_NAME(27-27)src/adapters/utils/networkUtils.js (1)
getDynamicErrorType(87-95)
src/v0/destinations/postscript/utils.test.ts (4)
src/v0/util/index.js (5)
getFieldValueFromMessage(687-693)getDestinationExternalID(1161-1170)constructPayload(1073-1147)getSuccessRespEvents(499-511)generateExclusionList(1350-1353)src/v0/destinations/postscript/utils.ts (6)
buildHeaders(44-49)validateRequiredFields(58-67)buildSubscriberPayload(78-153)buildCustomEventPayload(164-212)performSubscriberLookup(223-295)batchResponseBuilder(308-340)src/types/rudderEvents.ts (1)
RudderMessage(43-43)src/v0/destinations/postscript/types.ts (2)
ProcessedEvent(143-152)PostscriptDestination(179-179)
🪛 YAMLlint (1.37.1)
.github/actions/restart-deployment/action.yml
[error] 52-52: trailing spaces
(trailing-spaces)
[error] 57-57: trailing spaces
(trailing-spaces)
.github/workflows/prepare-for-dev-deploy.yml
[error] 122-122: no new line character at the end of file
(new-line-at-end-of-file)
[error] 122-122: trailing spaces
(trailing-spaces)
.github/workflows/update-ingestion-service.yml
[error] 107-107: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Code Coverage
- GitHub Check: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (28)
.github/workflows/slack-notify.yml (1)
25-25: Slack action version bump looks good – double-check for breaking changes
Moving fromv2.1.0tov2.1.1is normally a patch-level, non-breaking upgrade, but Slack’s action has introduced breaking API changes before. Please skim the release notes to be safe..github/workflows/dt-test-and-report-code-coverage.yml (1)
86-86: SonarQube scan action upgraded – verify marketplace deprecations
v5.3.0was released only days afterv5.2.0. Ensure none of the deprecations or new required inputs in 5.3 affect the scan (they occasionally tweak default Java versions)..github/workflows/publish-new-release.yml (1)
169-169: Patch upgrade for Slack notifier acknowledged
No objections; consistent with the other workflow bumps..github/workflows/build-push-docker-image.yml (1)
110-112: Confirm Buildx v3.11.1 availability on self-hosted runnersThe runners previously used v3.7.1; bumping straight to v3.11.1 should be harmless, but the binary is downloaded at runtime.
Double-check that:
- All self-hosted runners (ARM64 and AMD64 pools) can resolve and pull the new tag.
- No breaking changes were introduced between 3.7.x → 3.11.x that would affect
docker buildx bake/imagetools.If you haven’t already, run a dry-run build on each runner class.
Also applies to: 166-168, 218-218
.github/workflows/ingestion-service-test.yml (1)
37-43: Local replace path: verify it resolves on CI
go mod edit -replace github.com/rudderlabs/rudder-transformer/go=../goassumes the module directory is<repo-root>/go.
That’s correct today, but CI failures will be opaque if the layout changes.Consider guarding with a quick existence check:
test -d ../go || { echo "../go not found" ; exit 1 ; }Not blocking, but worth tightening.
.github/workflows/prepare-for-prod-dt-deploy.yml (1)
174-179: Job executes independently – intentional?
update-ingestion-servicehas noneeds, so it can run in parallel with image build/chart update jobs.
If the ingestion-service PR must reference the just-built tag (or rely ongenerate-tag-names), add an explicit dependency:needs: [generate-tag-names, build-transformer-image]Otherwise, confirm that running concurrently is acceptable.
src/sources/shopify/webpixelTransformations/pixelUtils.test.js (1)
241-241: LGTM! Test data enhancement improves coverage.The update from an empty SKU to
'sku-tcs-liquid'provides better test coverage by validating the handling of actual SKU values rather than just edge cases. This ensures theproductViewedEventBuildercorrectly processes and includes SKU data in the message properties.Also applies to: 257-257
src/v0/destinations/eventbridge/transform.js (1)
25-25: Good defensive programming enhancement.The additional
!isEmptyObject(event.destination.Config)check strengthens the validation by ensuring the configuration object is not only present but also contains actual data. This prevents processing events with empty configuration objects and maintains consistent error handling.src/features.ts (1)
100-100: LGTM! Feature flag addition follows established pattern.The new
POSTSCRIPT: trueflag enables the Postscript destination integration and follows the consistent pattern used for other destination feature flags in the configuration.src/types/controlPlaneConfig.ts (1)
9-9: LGTM! Type definition extension maintains backward compatibility.The optional
ResponseRulesproperty extends theDestinationDefinitiontype to support response rule configurations while maintaining backward compatibility. TheRecord<string, unknown> | nulltype provides appropriate flexibility for various response rule structures.src/v1/destinations/postscript/networkHandler.test.ts (1)
1-361: Excellent comprehensive test coverage for network handler.This test suite demonstrates excellent testing practices with:
- Comprehensive status code coverage: Tests success (2xx), client errors (4xx), server errors (5xx), and throttling (429)
- Proper error type validation: Correctly validates
NetworkError,RetryableError, andThrottledErrorare thrown for appropriate status codes- Edge case handling: Tests empty/null response bodies and error metadata preservation
- Clean test structure: Uses data-driven approach with well-defined test cases and helper functions
- Error metadata verification: Validates that error tags are properly included for 4xx errors but not for throttling/retryable errors
The parameterized testing approach with the
TestCaseinterface makes the tests maintainable and easy to extend.src/v1/destinations/postscript/networkHandler.ts (1)
26-77: Well-structured response handler implementationThe response handler correctly processes PostScript API responses with comprehensive error handling. The implementation properly:
- Creates the required
responsearray for V1 delivery status tracking- Handles all standard HTTP status codes with appropriate error types
- Uses the shared
getDynamicErrorTypeutility for consistent error categorizationsrc/v0/destinations/postscript/config.ts (1)
10-27: Clean and well-organized configurationThe configuration file properly structures all necessary constants for the PostScript destination. Good practices observed:
- Clear separation of concerns (API endpoints, mappings, ID types)
- Consistent naming conventions
- Proper use of const declarations
src/util/prometheus.js (1)
299-299: Appropriate cleanup of unused metricsThe removal of Marketo bulk upload metrics appears to be a clean refactoring that removes unused metric definitions. This helps reduce memory overhead and simplifies the metrics registry.
Also applies to: 342-342, 632-632, 663-663, 735-735
src/v0/destinations/postscript/transform.test.ts (1)
1-453: Comprehensive test coverage with well-structured test casesThe test suite provides excellent coverage of the PostScript transform functionality:
- Proper mock isolation of external dependencies
- Clear test organization with descriptive test names
- Coverage of both success and error scenarios
- Good use of helper functions to reduce duplication
- Tests for edge cases (null inputs, missing fields)
src/v0/destinations/postscript/transform.ts (1)
152-274: Well-implemented batch processing with proper error handlingThe router transformation function demonstrates excellent design:
- Concurrent event processing with
mapInBatches- Smart subscriber lookup batching for efficiency
- Proper separation of successful and failed events
- Event order preservation after lookup updates
The implementation correctly handles the lookup-based approach for determining create vs update operations.
src/v0/destinations/postscript/utils.test.ts (5)
17-75: Well-structured mock setupThe mock setup is comprehensive and follows best practices for unit testing. Good use of TypeScript type assertions for the mocked functions.
110-135: Comprehensive header building testsGood coverage of both scenarios - with and without the partner API key environment variable. The tests correctly verify the header structure.
137-183: Thorough validation testingExcellent coverage of validation scenarios including edge cases like empty required fields array. The error message assertions ensure proper user feedback.
365-505: Well-designed event payload testsComprehensive coverage of identification fallback logic and edge cases like missing event names. The timestamp handling tests ensure proper ISO format conversion.
624-791: Thorough batch response testingGood coverage of different endpoints and methods. The tests correctly verify that PostScript creates individual responses for each event rather than true batching.
src/v0/destinations/postscript/utils.ts (4)
44-49: Clean header constructionSimple and effective implementation. Good use of environment variable for partner API key configuration.
58-67: Effective validation logicGood use of filter to identify missing fields and providing a clear error message with all missing fields listed.
164-212: Well-implemented event payload builderGood fallback logic for subscriber identification and proper timestamp conversion to ISO format. The custom properties extraction is handled cleanly.
223-295: Robust subscriber lookup implementationExcellent error handling with fallback behavior and proper logging. The batch lookup approach optimizes API calls effectively.
src/v0/destinations/postscript/types.ts (3)
20-48: Well-designed configuration schemasGood use of zod for validation with appropriate error messages. The passthrough() allows for future extensibility without breaking changes.
59-136: Comprehensive API type definitionsThe payload and response types are well-structured with appropriate optional fields. Good inclusion of pagination metadata in lookup responses.
218-245: Robust error handling typesExcellent error type definitions that handle both single errors and field-specific validation errors. The network error structure provides good context for debugging.
| - name: Restart Pods in the provided Namespaces | ||
| shell: bash | ||
| run: | | ||
| # Split comma-separated namespaces and restart deployment in each | ||
| IFS=',' read -ra NAMESPACES <<< "${{ inputs.k8s-namespace }}" | ||
| IFS=',' read -ra DEPLOYMENTS <<< "${{ inputs.deployment-name }}" | ||
|
|
||
| echo "🚀 Starting deployment restart process..." | ||
| echo "Deployment: ${{ inputs.deployment-name }}" | ||
| echo "Namespaces: ${{ inputs.k8s-namespace }}" |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add set -euo pipefail for robust Bash execution
Currently a failed kubectl command will only fail the step if it returns a non-zero exit, but undetected unset variables or pipeline failures may slip through. Placing strict mode at the top of the script guards against silent errors.
- run: |
+ run: |
+ set -euo pipefail📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Restart Pods in the provided Namespaces | |
| shell: bash | |
| run: | | |
| # Split comma-separated namespaces and restart deployment in each | |
| IFS=',' read -ra NAMESPACES <<< "${{ inputs.k8s-namespace }}" | |
| IFS=',' read -ra DEPLOYMENTS <<< "${{ inputs.deployment-name }}" | |
| echo "🚀 Starting deployment restart process..." | |
| echo "Deployment: ${{ inputs.deployment-name }}" | |
| echo "Namespaces: ${{ inputs.k8s-namespace }}" | |
| - name: Restart Pods in the provided Namespaces | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| # Split comma-separated namespaces and restart deployment in each | |
| IFS=',' read -ra NAMESPACES <<< "${{ inputs.k8s-namespace }}" | |
| IFS=',' read -ra DEPLOYMENTS <<< "${{ inputs.deployment-name }}" | |
| echo "🚀 Starting deployment restart process..." | |
| echo "Deployment: ${{ inputs.deployment-name }}" | |
| echo "Namespaces: ${{ inputs.k8s-namespace }}" |
🤖 Prompt for AI Agents
In .github/actions/restart-deployment/action.yml around lines 37 to 46, add the
line "set -euo pipefail" at the very beginning of the bash script under the run
section. This will enable strict mode in bash, causing the script to exit
immediately on errors, unset variables, or pipeline failures, making the
deployment restart process more robust and error-proof.
| it('should build subscriber payload for update operation', () => { | ||
| const message: RudderMessage = { | ||
| type: 'identify', | ||
| userId: 'user123', | ||
| traits: { | ||
| phone: '+1234567890', | ||
| email: '[email protected]', | ||
| }, | ||
| context: { | ||
| traits: { | ||
| subscriberId: 'sub_123', | ||
| }, | ||
| }, | ||
| } as RudderMessage; | ||
| mockGetDestinationExternalID.mockReturnValue('sub_123'); // Has subscriber ID (update operation) | ||
| mockConstructPayload.mockReturnValue({ | ||
| subscriber_id: 'sub_123', | ||
| phone_number: '+1234567890', | ||
| email: '[email protected]', | ||
| }); | ||
|
|
||
| // Mock extractCustomFields to not add any custom properties | ||
| mockExtractCustomFields.mockImplementation(() => { | ||
| // No custom properties for this test | ||
| }); | ||
|
|
||
| const payload = buildSubscriberPayload(message); | ||
|
|
||
| expect(payload).not.toHaveProperty('subscriber_id'); // Should be removed for updates | ||
| expect(payload).toEqual({ | ||
| phone_number: '+1234567890', | ||
| email: '[email protected]', | ||
| external_id: 'sub_123', | ||
| shopify_customer_id: NaN, | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Fix NaN in shopify_customer_id field
The test expects shopify_customer_id: NaN at line 286, which indicates the implementation converts undefined/null to Number() without proper validation. This could cause API errors.
The implementation should only include shopify_customer_id when a valid numeric value is available:
if (shopifyCustomerId) {
- payload.shopify_customer_id = Number(shopifyCustomerId);
+ const numericId = Number(shopifyCustomerId);
+ if (!isNaN(numericId)) {
+ payload.shopify_customer_id = numericId;
+ }
}Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/v0/destinations/postscript/utils.test.ts around lines 253 to 288, the
test expects shopify_customer_id to be NaN, which suggests the code converts
undefined or null to Number() without validation. To fix this, update the
implementation so that shopify_customer_id is only included in the payload if it
has a valid numeric value; otherwise, omit this field entirely to prevent
sending NaN in the API payload.
| if (shopifyCustomerId) { | ||
| payload.shopify_customer_id = Number(shopifyCustomerId); | ||
| } |
There was a problem hiding this comment.
Validate numeric conversion for shopify_customer_id
The conversion to Number without validation can result in NaN values being sent to the API, which could cause errors.
if (shopifyCustomerId) {
- payload.shopify_customer_id = Number(shopifyCustomerId);
+ const numericId = Number(shopifyCustomerId);
+ if (!isNaN(numericId)) {
+ payload.shopify_customer_id = numericId;
+ }
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (shopifyCustomerId) { | |
| payload.shopify_customer_id = Number(shopifyCustomerId); | |
| } | |
| if (shopifyCustomerId) { | |
| const numericId = Number(shopifyCustomerId); | |
| if (!isNaN(numericId)) { | |
| payload.shopify_customer_id = numericId; | |
| } | |
| } |
🤖 Prompt for AI Agents
In src/v0/destinations/postscript/utils.ts around lines 111 to 113, the code
converts shopifyCustomerId to a Number without validation, which may produce NaN
values. Add a check to ensure the conversion result is a valid number before
assigning it to payload.shopify_customer_id. Only assign the numeric value if it
is a valid number to prevent sending NaN to the API.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4543 +/- ##
===========================================
+ Coverage 91.57% 91.63% +0.05%
===========================================
Files 639 643 +4
Lines 33786 34020 +234
Branches 7989 8048 +59
===========================================
+ Hits 30940 31174 +234
+ Misses 2616 2588 -28
- Partials 230 258 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



👑 An automated PR