Skip to content

Conversation

@mbonnafon
Copy link
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
@mbonnafon mbonnafon requested a review from AntoxaAntoxic May 9, 2025 16:59
@mbonnafon mbonnafon requested a review from AntoxaAntoxic May 14, 2025 08:17
@mbonnafon mbonnafon requested a review from AntoxaAntoxic May 14, 2025 09:29
AntoxaAntoxic
AntoxaAntoxic previously approved these changes May 14, 2025
@mbonnafon
Copy link
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
Collaborator

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

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
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
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
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 on lines 97 to 99
if (customUri == null) {
return endpointUrl;
}
Copy link
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
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
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
Contributor Author

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

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