Skip to content

Conversation

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

What's the context for the changes?
New Connatix Adapter (port from Go)
#3601

🧠 Rationale behind the change

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

🔎 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
  • [n/a] 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?

@Override
public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request) {
// Device IP required - bounce if not available
if (request.getDevice() == null
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd extract device into a separate variable since it's used later as well

@Net-burst Net-burst changed the title Port 3601 connatix adapter Connatix: Port adapter from PBS-Go Feb 25, 2025
@Net-burst Net-burst changed the title Connatix: Port adapter from PBS-Go New adapter: Port Connatix adapter from PBS-Go Feb 25, 2025
@katherynhrabik
Copy link
Contributor Author

updates in response to comments are in progress

final BidRequest bidRequest = givenBidRequest(
request -> request.device(Device.builder().ip("deviceIp").build()),
impBuilder -> impBuilder.ext(mapper.valueToTree(ExtPrebid.of(null, mapper.createArrayNode())))
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

according to the code style closing parenthesis should be on the previous line

please double-check everywhere in the PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

^^

AntoxaAntoxic
AntoxaAntoxic previously approved these changes Feb 27, 2025
@osulzhenko osulzhenko changed the title New adapter: Port Connatix adapter from PBS-Go Connatix: Port adapter from PBS-Go Feb 28, 2025
final BidRequest bidRequest = givenBidRequest(
request -> request.device(Device.builder().ip("deviceIp").build()),
impBuilder -> impBuilder.ext(mapper.valueToTree(ExtPrebid.of(null, mapper.createArrayNode())))
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

^^

Comment on lines 341 to 361
@SafeVarargs
private static BidRequest givenBidRequest(UnaryOperator<BidRequest.BidRequestBuilder> bidRequestCustomizer,
UnaryOperator<Imp.ImpBuilder>... impCustomizers) {
return bidRequestCustomizer.apply(BidRequest.builder()
.imp(Stream.of(impCustomizers)
.map(ConnatixBidderTest::givenImp)
.toList()))
.build();
}

private static Imp givenImp(UnaryOperator<Imp.ImpBuilder> impCustomizer) {
return impCustomizer.apply(Imp.builder()).build();
}

private static Imp givenImp(ExtImpConnatix extImpConnatix) {
return givenImp(imp -> imp.ext(mapper.valueToTree(ExtPrebid.of(null, extImpConnatix))));
}

private static ExtImpConnatix givenExt(UnaryOperator<ExtImpConnatix.ExtImpConnatixBuilder> extCustomizer) {
return extCustomizer.apply(ExtImpConnatix.builder().placementId("placementId")).build();
}
Copy link
Collaborator

@CTMBNara CTMBNara Mar 4, 2025

Choose a reason for hiding this comment

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

You can simplify all makeHttpRequests* tests by adding default Device object to givenBidRequest method:

    private static BidRequest givenBidRequest(UnaryOperator<BidRequest.BidRequestBuilder> bidRequestCustomizer,
                                               Imp... imps) {

         return bidRequestCustomizer.apply(BidRequest.builder()
                 .imp(List.of(imps))
                 .device(Device.builder().ip("deviceIp).build())
                 .build();
     }

Also, use givenImp and givenBidRequest(UnaryOperator<BidRequest.BidRequestBuilder>, Imp...) combo, instead of current approach

return bidRequestCustomizer.apply(BidRequest.builder().imp(asList(imps))).build();
}

@SafeVarargs
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove @SafeVarargs annotation

@osulzhenko
Copy link
Collaborator

@katherynhrabik Please update to actual master

@CTMBNara CTMBNara merged commit 0944054 into prebid:master Mar 18, 2025
8 checks passed
karimMourra pushed a commit to karimMourra/prebid-server-java that referenced this pull request Apr 24, 2025
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: Connatix: Add viewability field Port PR from PBS-Go: New Adapter: Connatix

5 participants