Skip to content
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

chore(release): pull main into develop post release v1.73.1 #3631

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.73.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.73.0...v1.73.1) (2024-08-02)


### Bug Fixes

* update getAuthErrCategory and update error message for garl ([#3629](https://github.com/rudderlabs/rudder-transformer/issues/3629)) ([feadfcf](https://github.com/rudderlabs/rudder-transformer/commit/feadfcf6009ccc9b972634347448ba9428696ebb))

## [1.73.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.2...v1.73.0) (2024-07-31)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.73.0",
"version": "1.73.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const gaAudienceRespHandler = (destResponse, stageMsg) => {
// const { stat, err_code: errorCode } = respAttributes;

throw new NetworkError(
`${response?.error?.message} ${stageMsg}`,
`${JSON.stringify(response)} ${stageMsg}`,
status,
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status),
Expand Down
6 changes: 5 additions & 1 deletion src/v0/util/googleUtils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@
const authenticationError = respArr.map((resp) =>
get(resp, 'error.details.0.errors.0.errorCode.authenticationError'),
);
if (authenticationError.includes('TWO_STEP_VERIFICATION_NOT_ENROLLED')) {
if (
// https://developers.google.com/google-ads/api/docs/oauth/2sv
authenticationError.includes('TWO_STEP_VERIFICATION_NOT_ENROLLED') ||

Check warning on line 126 in src/v0/util/googleUtils/index.js

View check run for this annotation

Codecov / codecov/patch

src/v0/util/googleUtils/index.js#L126

Added line #L126 was not covered by tests
// https://developers.google.com/google-ads/api/docs/common-errors#:~:text=this%20for%20you.-,CUSTOMER_NOT_FOUND,-Summary
authenticationError.includes('CUSTOMER_NOT_FOUND')

Check warning on line 128 in src/v0/util/googleUtils/index.js

View check run for this annotation

Codecov / codecov/patch

src/v0/util/googleUtils/index.js#L128

Added line #L128 was not covered by tests
) {
return AUTH_STATUS_INACTIVE;
}
return REFRESH_TOKEN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const testScenariosForV0API = [
output: {
status: 400,
message:
'Request contains an invalid argument. during ga_audience response transformation',
'{"error":{"code":400,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"offlineUserDataJobError":"INVALID_SHA256_FORMAT"},"message":"The SHA256 encoded value is malformed.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"remove"},{"fieldName":"user_identifiers","index":0},{"fieldName":"hashed_email"}]}}]}],"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}} during ga_audience response transformation',
destinationResponse: {
error: {
code: 400,
Expand Down Expand Up @@ -313,11 +313,11 @@ export const testScenariosForV1API = [
body: {
output: {
message:
'Request contains an invalid argument. during ga_audience response transformation',
'{"error":{"code":400,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"offlineUserDataJobError":"INVALID_SHA256_FORMAT"},"message":"The SHA256 encoded value is malformed.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"remove"},{"fieldName":"user_identifiers","index":0},{"fieldName":"hashed_email"}]}}]}],"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}} during ga_audience response transformation',
response: [
{
error:
'Request contains an invalid argument. during ga_audience response transformation',
'{"error":{"code":400,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"offlineUserDataJobError":"INVALID_SHA256_FORMAT"},"message":"The SHA256 encoded value is malformed.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"remove"},{"fieldName":"user_identifiers","index":0},{"fieldName":"hashed_email"}]}}]}],"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}} during ga_audience response transformation',
metadata: generateGoogleOAuthMetadata(1),
statusCode: 400,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { generateProxyV1Payload } from '../../../testUtils';
import { commonHeaders, commonParams, expectedStatTags, validRequestPayload1 } from './business';
import { generateMetadata, generateProxyV1Payload } from '../../../testUtils';
import { commonHeaders, commonParams, validRequestPayload1 } from './business';

const commonStatTags = {
destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS',
destinationId: 'default-destinationId',
errorCategory: 'network',
errorType: 'aborted',
feature: 'dataDelivery',
implementation: 'native',
module: 'destination',
workspaceId: 'default-workspaceId',
};

export const oauthError = [
{
Expand Down Expand Up @@ -31,11 +42,11 @@ export const oauthError = [
output: {
authErrorCategory: 'REFRESH_TOKEN',
message:
'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. during ga_audience response transformation',
'{"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}} during ga_audience response transformation',
response: [
{
error:
'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. during ga_audience response transformation',
'{"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}} during ga_audience response transformation',
metadata: {
attemptNum: 1,
destinationId: 'default-destinationId',
Expand All @@ -51,16 +62,51 @@ export const oauthError = [
statusCode: 401,
},
],
statTags: {
destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS',
destinationId: 'default-destinationId',
errorCategory: 'network',
errorType: 'aborted',
feature: 'dataDelivery',
implementation: 'native',
module: 'destination',
workspaceId: 'default-workspaceId',
},
statTags: commonStatTags,
status: 401,
},
},
},
},
},
{
id: 'garl_oauth_scenario_with_wrong_customer_id',
name: 'google_adwords_remarketing_lists',
description: '[Proxy v1 API] :: Oauth where customer has provided wrong customerId',
successCriteria: 'The proxy should return 401 with authErrorCategory as AUTH_STATUS_INACTIVE',
scenario: 'Oauth',
feature: 'dataDelivery',
module: 'destination',
version: 'v1',
input: {
request: {
body: generateProxyV1Payload({
headers: { ...commonHeaders, Authorization: 'Bearer wrongCustomerID' },
params: { ...commonParams, customerId: 'wrongCustomerID' },
JSON: validRequestPayload1,
endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs',
accessToken: 'wrongCustomerID',
}),
method: 'POST',
},
},
output: {
response: {
status: 401,
body: {
output: {
authErrorCategory: 'AUTH_STATUS_INACTIVE',
message:
'{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"CUSTOMER_NOT_FOUND"},"message":"No customer found for the provided customer id."}],"requestId":"lvB3KOjGHsgduHjt0wCglQ"}]}} during ga_audience response transformation',
response: [
{
error:
'{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"CUSTOMER_NOT_FOUND"},"message":"No customer found for the provided customer id."}],"requestId":"lvB3KOjGHsgduHjt0wCglQ"}]}} during ga_audience response transformation',
metadata: { ...generateMetadata(1), secret: { accessToken: 'wrongCustomerID' } },
statusCode: 401,
},
],
statTags: commonStatTags,
status: 401,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,52 @@ export const networkCallsData = [
},
},
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create',
data: {
job: {
type: 'CUSTOMER_MATCH_USER_LIST',
customerMatchUserListMetadata: {
userList: 'customers/wrongCustomerID/userLists/709078448',
consent: {
adPersonalization: 'UNSPECIFIED',
adUserData: 'UNSPECIFIED',
},
},
},
},
headers: {
Authorization: 'Bearer wrongCustomerID',
'Content-Type': 'application/json',
'developer-token': 'dummy-dev-token',
},
method: 'POST',
},
httpRes: {
status: 401,
data: {
error: {
code: 401,
message:
'Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.',
status: 'UNAUTHENTICATED',
details: [
{
'@type': 'type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure',
errors: [
{
errorCode: {
authenticationError: 'CUSTOMER_NOT_FOUND',
},
message: 'No customer found for the provided customer id.',
},
],
requestId: 'lvB3KOjGHsgduHjt0wCglQ',
},
],
},
},
},
},
];
Loading