-
Notifications
You must be signed in to change notification settings - Fork 187
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
Kobler: New adapter (#3667) #3684
base: master
Are you sure you want to change the base?
Conversation
try { | ||
final ExtImpKobler impExt = parseImpExt(imp); | ||
|
||
if (bidRequest.getImp().indexOf(imp) == 0) { |
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.
don't use indexOf
, it spends unnecessary execution time to check each imp
} | ||
|
||
final Imp modifiedImp = modifyImp(imp, impExt, bidRequest); | ||
requests.add(makeHttpRequest(bidRequest, modifiedImp, testMode)); |
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 bidder should send only a single request with all the imps instead of a request per imp
return imp.toBuilder() | ||
.bidfloor(resolvedBidFloor.getValue()) | ||
.bidfloorcur(resolvedBidFloor.getCurrency()) | ||
.ext(mapper.mapper().valueToTree(extImpKobler)) |
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.
I don't see imp.ext change in Go
|
||
for (Imp imp : bidRequest.getImp()) { | ||
try { | ||
final ExtImpKobler impExt = parseImpExt(imp); |
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.
we don't need to parse imp.ext if it's not the first imp
return bidsFromResponse(bidResponse, errors); | ||
} | ||
|
||
private List<BidderBid> bidsFromResponse(BidResponse bidResponse, List<BidderError> errors) { |
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 errors list is redundant
private BidType getBidType(Bid bid) { | ||
final Integer markupType = ObjectUtils.defaultIfNull(bid.getMtype(), 0); | ||
|
||
return switch (markupType) { | ||
case 1 -> BidType.banner; | ||
default -> throw new PreBidException( | ||
"could not define media type for impression: " + bid.getImpid()); | ||
}; | ||
} |
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.
that's just not how it works in Go
@@ -0,0 +1,12 @@ | |||
adapters: | |||
kobler: | |||
endpoint: "https://bid.essrtb.com/bid/prebid_server_rtb_call" |
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 endpoint-compression is missed
BidderDeps koblerBidderDeps(BidderConfigurationProperties koblerConfigurationProperties, | ||
CurrencyConversionService currencyConversionService, | ||
@NotBlank @Value("${external-url}") String externalUrl, | ||
JacksonMapper mapper) { |
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.
indentation is bad
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.
I used a checkstyle and it didnt show mistakes. How it should looks like?
final ExtImpKobler impExt = parseImpExt(imp); | ||
|
||
if (bidRequest.getImp().indexOf(imp) == 0) { | ||
testMode = impExt.getTest(); |
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.
NPE will be thrown if imp.ext.test is NULL
🔧 Type of changes
✨ What's the context?
#3667