Skip to content

Port Mobkoi: New Adapter#3942

Merged
CTMBNara merged 7 commits into
prebid:masterfrom
mbonnafon:port-mobkoi-adapter-from-golang-to-java
Jun 4, 2025
Merged

Port Mobkoi: New Adapter#3942
CTMBNara merged 7 commits into
prebid:masterfrom
mbonnafon:port-mobkoi-adapter-from-golang-to-java

Conversation

@mbonnafon
Copy link
Copy Markdown
Contributor

@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-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?

The endpoint is not yet in production, so no impact.

🏎 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?

@mbonnafon mbonnafon marked this pull request as ready for review May 1, 2025 08:26
@AntoxaAntoxic AntoxaAntoxic linked an issue May 8, 2025 that may be closed by this pull request
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/resources/bidder-config/mobkoi.yaml
Comment thread src/main/resources/bidder-config/mobkoi.yaml
@mbonnafon mbonnafon requested a review from AntoxaAntoxic May 9, 2025 16:59
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/spring/config/bidder/MobkoiConfiguration.java Outdated
Comment thread src/main/resources/bidder-config/mobkoi.yaml Outdated
@mbonnafon mbonnafon requested a review from AntoxaAntoxic May 14, 2025 08:17
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/test/java/org/prebid/server/bidder/mobkoi/MobkoiBidderTest.java Outdated
Comment thread src/test/java/org/prebid/server/bidder/mobkoi/MobkoiBidderTest.java
Comment thread src/test/java/org/prebid/server/bidder/mobkoi/MobkoiBidderTest.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java
@mbonnafon mbonnafon requested a review from AntoxaAntoxic May 14, 2025 09:29
AntoxaAntoxic
AntoxaAntoxic previously approved these changes May 14, 2025
@mbonnafon
Copy link
Copy Markdown
Contributor Author

@AntoxaAntoxic, do you think the failing test is related to my PR? I don't see the mobkoi keyword in the error output.

@AntoxaAntoxic
Copy link
Copy Markdown
Collaborator

@mbonnafon no worries, they are unstable from time to time

Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java
Comment thread src/main/java/org/prebid/server/bidder/mobkoi/MobkoiBidder.java Outdated
Comment on lines +96 to +104
private String resolveEndpoint(String customUri) {
try {
HttpUtil.validateUrl(customUri);
final URI uri = new URI(customUri);
return uri.resolve("/bid").toString();
} catch (IllegalArgumentException | URISyntaxException e) {
return endpointUrl;
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

https://github.com/prebid/prebid-server-java/blob/master/docs/developers/bid-adapter-porting-guide.md#specific-rules-and-tips-for-porting

Point 5.2: Fully dynamic hostnames in URLs aren't allowed in bid adapters.

Please, add a comment for that method:

  // url is already validated with `bidder-params` json schema

Also, you can remove HttpUtil.validateUrl(customUri); step

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@CTMBNara, so we take the assumption that all custom URIs are valid?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mbonnafon this check will be done by new Uri().toString()

Comment thread src/test/java/org/prebid/server/bidder/mobkoi/MobkoiBidderTest.java Outdated
Comment on lines +97 to +99
if (customUri == null) {
return endpointUrl;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move it outside of try catch block

Comment on lines -111 to -124
@Test
public void makeHttpRequestsShouldConstructorEndpointWhenTheCustomIsInvalidInMobkoiExtension() {
// given
final ObjectNode mobkoiExt = impExt("pid", "invalid-URI");
final BidRequest bidRequest = givenBidRequest(impBuilder -> impBuilder.ext(mobkoiExt));

// when
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// then
assertThat(result.getValue()).extracting(HttpRequest::getUri).containsExactly("https://test.endpoint.com/bid");
assertThat(result.getErrors()).isEmpty();
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Return this test

@mbonnafon
Copy link
Copy Markdown
Contributor Author

@AntoxaAntoxic @CTMBNara Thanks both for the reviews! What's the next step before merging?

@CTMBNara CTMBNara merged commit 7e2cacf into prebid:master Jun 4, 2025
8 checks passed
@mbonnafon
Copy link
Copy Markdown
Contributor Author

Hi @AntoxaAntoxic / @CTMBNara out of curiosity, do you have any visibility on the next release window?

riteshghodrao pushed a commit to riteshghodrao/prebid-server-java that referenced this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port PR from PBS-Go: New Adapter: Mobkoi

4 participants