Skip to content

Conversation

@mbonnafon
Copy link
Owner

@mbonnafon mbonnafon commented Apr 29, 2025

🔧 Type of changes

  • new bid adapter
  • bid adapter update
  • new feature
  • new analytics adapter
  • new module
  • module update
  • bugfix
  • documentation
  • configuration
  • dependency update
  • tech debt (test coverage, refactorings, etc.)

✨ What's the context?

New bidder adapter for Mobkoi, port from PBS-Go.
Maintainer: platformteam@mobkoi.com

Related Changes:

🔎 New Bid Adapter Checklist

  • verify email contact works: New Adapter: Mobkoi prebid/prebid-server#4240 (comment)
  • NO fully dynamic hostnames: only overridable hostname
  • geographic host parameters are NOT required
  • direct use of HTTP is prohibited - implement an existing Bidder interface that will do all the job
  • if the ORTB is just forwarded to the endpoint, use the generic adapter - define the new adapter as the alias of the generic adapter
  • cover an adapter configuration with an integration test

🧪 Test plan

How do you know the changes are safe to ship to production?

🏎 Quality check

  • Are your changes following our code style guidelines?
  • Are there any breaking changes in your code? No breaking changes.
  • Does your test coverage exceed 90%?
  • Are there any erroneous console logs, debuggers or leftover code in your changes?

throw new PreBidException("Missing mediaType for bid: " + bid.getId());
}

if (markupType != 1) {

Choose a reason for hiding this comment

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

Can we enum the 1 as banner please :)

Copy link
Owner Author

Choose a reason for hiding this comment

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

BidType.banner enum value is 0. Initially I used:

return switch (markupType) {
            case 1 -> BidType.banner;
            default -> throw new PreBidException(
                    "Unable to fetch mediaType " + bid.getMtype() + " in multi-format: " + bid.getImpid());
        };

But enums with 1 value are not allowed.

I can either:

  1. create a variable
final int banner = 1;
        if (markupType != banner) {
        }
  1. add a comment

Choose a reason for hiding this comment

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

A comment will suffice as its a single test

}

private static List<BidderBid> extractBids(BidResponse bidResponse) {
if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) {

Choose a reason for hiding this comment

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

bidResponse.getSeatbid().isEmpty() ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

As per contributing guidelines, I followed already existing adapters style, they all have this logic to check if it's empty

Copy link
Owner Author

Choose a reason for hiding this comment

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

image


private static List<BidderBid> extractBids(BidResponse bidResponse) {
if (bidResponse == null || CollectionUtils.isEmpty(bidResponse.getSeatbid())) {
return Collections.emptyList();

Choose a reason for hiding this comment

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

emptyList()

Copy link
Owner Author

Choose a reason for hiding this comment

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

Same here

Copy link
Owner Author

Choose a reason for hiding this comment

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

image

}
}

private Boolean validCustomEndpointUrl(String customUrl) {

Choose a reason for hiding this comment

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

should be boolean no?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Agreed better to use primitive types

@willoughby
Copy link

Repo is in the wrong place @mbonnafon https://github.com/mbonnafon/prebid-server-java

@mbonnafon
Copy link
Owner Author

@willoughby

Repo is in the wrong place @mbonnafon https://github.com/mbonnafon/prebid-server-java

Yes, I did that on purpose, to submit a clean PR

@mbonnafon mbonnafon force-pushed the port-mobkoi-adapter-from-golang-to-java branch from 71ccdef to 946d515 Compare April 29, 2025 10:09
@mbonnafon mbonnafon force-pushed the port-mobkoi-adapter-from-golang-to-java branch from 946d515 to a376abd Compare April 29, 2025 11:29
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.

3 participants