-
Notifications
You must be signed in to change notification settings - Fork 190
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
Loyal: New Adapter (#3140) #3183
Conversation
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.
Java Ci failed because of checkstyle issues, please fix them
src/test/resources/org/prebid/server/it/test-application.properties
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/resources/org/prebid/server/it/test-application.properties
Outdated
Show resolved
Hide resolved
Could you fix the comments are left? |
Yesturday I pushed changes. whitch comments are left? (I think I prepared everythink) |
@SerhiiNahornyi Are we rdy to merge? |
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.
My bad, I didn't pay attention to the Go version of the bidder
fyi @SerhiiNahornyi
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/resources/org/prebid/server/it/test-application.properties
Outdated
Show resolved
Hide resolved
@AntoxaAntoxic U can check, I have hope that everthink is fine now. |
src/main/java/org/prebid/server/bidder/loyal/proto/LoyalImpExtBidder.java
Outdated
Show resolved
Hide resolved
"bidder": { | ||
"placementId": "testPlacementId" | ||
} |
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.
the type is missing, isn't the test failing?
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.
yes and this same is in Go. Its Request not expected response.
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/resources/org/prebid/server/it/openrtb2/loyal/test-auction-loyal-request.json
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
for (Imp imp : request.getImp()) { | ||
try { | ||
final ExtImpLoyal extImpLoyal = parseExtImp(imp); | ||
if (isValidImp(extImpLoyal)) { |
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.
no sure we need this check, one of those field are required by the json scheme
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.
You said:
AntoxaAntoxic 2 weeks ago
the following logic is missing
if len(adapterRequests) == 0 {
errs = append(errs, errors.New("found no valid impressions"))
return nil, errs
}
and this is part of this
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.
and you've implemented it already a few lines below
if (httpRequests.isEmpty()) {
return Result.withError(BidderError.badInput("found no valid impressions"));
}
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.
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.
so this is the Go code
if loyalExt.PlacementID != "" {
impExt.LoyalBidderExt.PlacementID = loyalExt.PlacementID
impExt.LoyalBidderExt.Type = "publisher"
} else if loyalExt.EndpointID != "" {
impExt.LoyalBidderExt.EndpointID = loyalExt.EndpointID
impExt.LoyalBidderExt.Type = "network"
}
as you see the imp that doesn't have the placementId
and endpointId
fields won't be treated as invalid, but you've added the unit test that defines invalid bid as the following:
private static Imp givenBadImp(UnaryOperator<Imp.ImpBuilder> impCustomizer) {
return impCustomizer.apply(Imp.builder()
.id("invalidImp")
.ext(mapper.valueToTree(ExtPrebid.of(null,
ExtImpLoyal.of(null, null)))))
.build();
}
So my conclusion the logic of your version of the bidder differs from the GO's version
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.
okey, now its clear. I hade made wrong badImp, I was doing it in wrong way.
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/loyal/LoyalBidderTest.java
Outdated
Show resolved
Hide resolved
private static Imp givenImp(UnaryOperator<Imp.ImpBuilder> impCustomizer) { | ||
return impCustomizer.apply(Imp.builder() | ||
.id("123") | ||
.ext(mapper.valueToTree(ExtPrebid.of(null, | ||
ExtImpLoyal.of("placementId", "endpointId"))))) | ||
.build(); | ||
} | ||
|
||
private static Imp givenImp2(UnaryOperator<Imp.ImpBuilder> impCustomizer) { | ||
return impCustomizer.apply(Imp.builder() | ||
.id("321") | ||
.ext(mapper.valueToTree(ExtPrebid.of(null, | ||
ExtImpLoyal.of("placementId", "endpointId"))))) | ||
.build(); | ||
} |
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.
why do you need two different methods if there is a customizer that can be used for that matter?
for (Imp imp : request.getImp()) { | ||
try { | ||
final ExtImpLoyal extImpLoyal = parseExtImp(imp); | ||
if (isValidImp(extImpLoyal)) { |
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.
so this is the Go code
if loyalExt.PlacementID != "" {
impExt.LoyalBidderExt.PlacementID = loyalExt.PlacementID
impExt.LoyalBidderExt.Type = "publisher"
} else if loyalExt.EndpointID != "" {
impExt.LoyalBidderExt.EndpointID = loyalExt.EndpointID
impExt.LoyalBidderExt.Type = "network"
}
as you see the imp that doesn't have the placementId
and endpointId
fields won't be treated as invalid, but you've added the unit test that defines invalid bid as the following:
private static Imp givenBadImp(UnaryOperator<Imp.ImpBuilder> impCustomizer) {
return impCustomizer.apply(Imp.builder()
.id("invalidImp")
.ext(mapper.valueToTree(ExtPrebid.of(null,
ExtImpLoyal.of(null, null)))))
.build();
}
So my conclusion the logic of your version of the bidder differs from the GO's version
No description provided.