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

RP adapter: update segment logic #1260

Merged
merged 4 commits into from
May 17, 2021
Merged

RP adapter: update segment logic #1260

merged 4 commits into from
May 17, 2021

Conversation

SerhiiNahornyi
Copy link
Collaborator

No description provided.

@@ -1039,10 +1039,10 @@ private void mergeFirstPartyDataFromUser(ExtUser userExt, ObjectNode result) {
}
}

private void enrichWithIabAttribute(ObjectNode target, List<Data> data) {
private void enrichWithIabAttribute(ObjectNode target, List<Data> data, int... segtaxValues) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably to be less cryptic it is better to use Set<Integer> instead of var-args.
This allows to extract all possible combinations to the class fields, like USER_SEGTAXES and SITE_SEGTAXES.

final JsonNode taxonomyName = ext != null ? ext.get("taxonomyname") : null;
return taxonomyName != null && taxonomyName.isTextual()
&& StringUtils.containsIgnoreCase(taxonomyName.textValue(), "iab");
private boolean containsSegtaxValue(ObjectNode ext, int... segtaxValues) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be static?

}

private ObjectNode existingRubiconSiteExtRpTarget(ExtSite siteExt) {
final RubiconSiteExt siteRubiconExt = siteExt != null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor. Pls rename siteRubiconExt to rubiconSiteExt.

target != null && !target.isEmpty() ? target : null)));
}

private ObjectNode existingRubiconSiteExtRpTarget(ExtSite siteExt) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls rename existingRubiconSiteExtRpTargetOrEmptyNode.

Comment on lines 797 to 802
final ObjectNode firstSiteExtNode = mapper.createObjectNode();
firstSiteExtNode.put("segtax", 1);
final Data firstDataAttribute = Data.builder()
.segment(singletonList(Segment.builder().id("firstSegmentId")
.build()))
.ext(firstSiteExtNode).build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be extracted to givenXXX method.

}
]
},
"device": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls keep this test simple as possible and remove not related fields here.

@SerhiiNahornyi SerhiiNahornyi requested a review from rpanchyk May 15, 2021 13:32
@rpanchyk rpanchyk merged commit 1abb5bb into master May 17, 2021
@rpanchyk rpanchyk deleted the rubicon/iab/update branch May 17, 2021 09:00
nickluck9 pushed a commit that referenced this pull request Aug 9, 2021
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants