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

New adapter: Port Connatix adapter from PBS-Go #3781

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

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?

private final String endpointUrl;
private final JacksonMapper mapper;

private static final String BIDDER_CURRENCY = "USD";
Copy link
Collaborator

Choose a reason for hiding this comment

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

please do not mix up constants and dependencies, place constants first

CurrencyConversionService currencyConversionService,
JacksonMapper mapper) {
this.endpointUrl = HttpUtil.validateUrl(Objects.requireNonNull(endpointUrl));
this.currencyConversionService = currencyConversionService;
Copy link
Collaborator

Choose a reason for hiding this comment

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

requireNonNull

@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

return headers;
}

// check display manager version
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove comments

}

// check display manager version
private String buildDisplayManagerVersion(BidRequest request) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

static

.filter(Objects::nonNull)
.flatMap(Collection::stream)
.filter(Objects::nonNull)
.map(bid -> BidderBid.of(bid, getBidType(bid), bidResponse.getCur()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

BidderBid.of(bid, getBidType(bid), BID_CURRENCY))

cookie-family-name: connatix
iframe:
url: "https://capi.connatix.com/us/pixel?pId=53&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&callback={{redirect_url}}"
uid-macro: '$UID'
Copy link
Collaborator

Choose a reason for hiding this comment

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

'[UID]'

redirect:
url: "https://capi.connatix.com/us/pixel?pId=52&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&callback={{redirect_url}}"
uid-macro: '$UID'
supportCors: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

support-cors:

Comment on lines 4 to 5
ortb:
multiformat-supported: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

redundant

public class ConnatixTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBannerBidFromConnatix() throws IOException, JSONException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please leave only one test, we test here only the correctness of the configuration

@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

.orElse(StringUtils.EMPTY);
}

private MultiMap resolveHeaders(Device device) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

static

}

private static String buildDisplayManagerVersion(BidRequest request) {
final String formatting = "%s-%s";
Copy link
Collaborator

Choose a reason for hiding this comment

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

please extract as a constant

iframe:
url: "https://capi.connatix.com/us/pixel?pId=53&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&callback={{redirect_url}}"
uid-macro: '[UID]'
supportCors: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

support-cors

Copy link
Collaborator

Choose a reason for hiding this comment

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

^^

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

iframe:
url: "https://capi.connatix.com/us/pixel?pId=53&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&callback={{redirect_url}}"
uid-macro: '[UID]'
supportCors: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

^^

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
3 participants