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

Ogury: port new adapter from Go #3788

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

Conversation

zxPhoenix
Copy link
Contributor

🔧 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 Ogury adapter (Port PR from PBS-Go)
#3700

🧠 Rationale behind the change

Why did you choose to make these changes? Were there any trade-offs you had to consider?

🔎 New Bid Adapter Checklist

  • verify email contact works (I believe this happened go-side. this is a port)
  • NO fully dynamic hostnames
  • 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?
Unit tests with decent coverage

🏎 Quality check

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

@zxPhoenix zxPhoenix changed the title New adapter: Port Ogury adapter from PBS-Go Port Ogury: New Adapter Feb 26, 2025
@osulzhenko osulzhenko requested a review from CTMBNara February 26, 2025 16:50
@osulzhenko osulzhenko changed the title Port Ogury: New Adapter Ogury: port new adapter from Go Feb 28, 2025
@osulzhenko osulzhenko linked an issue Feb 28, 2025 that may be closed by this pull request
Comment on lines 61 to 64
if (request == null || CollectionUtils.isEmpty(request.getImp())) {
errors.add(BidderError.badInput("There are no valid impressions to create bid request to ogury bidder"));
return Result.withErrors(errors);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for this checks

Comment on lines 115 to 133
private List<Imp> modifyImps(BidRequest request, Consumer<Imp> impWithOguryParamsHandler) {
return Optional.of(request)
.map(BidRequest::getImp)
.map(sourceImps -> sourceImps.stream().map(imp -> {
final ObjectNode impExt = resolveImpExt(imp);
final ObjectNode impExtBidderHoist = resolveImpExtBidderHoist(impExt);

final ObjectNode modifiedImpExt = modifyImpExt(impExt, impExtBidderHoist);
final BigDecimal bidFloor = resolveBidFloor(request, imp);
final Imp modifiedImp = modifyImp(imp, bidFloor, modifiedImpExt);

if (hasOguryParams(impExtBidderHoist)) {
impWithOguryParamsHandler.accept(modifiedImp);
}

return modifiedImp;
}))
.map(Stream::toList).orElse(null);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please, see examples how to iterate over imps in other adapters
See https://github.com/prebid/prebid-server-java/pull/3768/files as a starting point

@zxPhoenix zxPhoenix requested a review from CTMBNara March 7, 2025 13:26
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: Ogury
2 participants