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

Kobler: New adapter (#3667) #3684

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

przemkaczmarek
Copy link
Collaborator

🔧 Type of changes

  • new bid adapter

✨ What's the context?

#3667

@Net-burst Net-burst linked an issue Jan 21, 2025 that may be closed by this pull request
try {
final ExtImpKobler impExt = parseImpExt(imp);

if (bidRequest.getImp().indexOf(imp) == 0) {
Copy link
Collaborator

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));
Copy link
Collaborator

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))
Copy link
Collaborator

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);
Copy link
Collaborator

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) {
Copy link
Collaborator

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

Comment on lines +155 to +163
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());
};
}
Copy link
Collaborator

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"
Copy link
Collaborator

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

Comment on lines +32 to +35
BidderDeps koblerBidderDeps(BidderConfigurationProperties koblerConfigurationProperties,
CurrencyConversionService currencyConversionService,
@NotBlank @Value("${external-url}") String externalUrl,
JacksonMapper mapper) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

indentation is bad

Copy link
Collaborator Author

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();
Copy link
Collaborator

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

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.

Port PR from PBS-Go: New Adapter: Kobler
2 participants