Skip to content

New adapter: HypeLab#4488

Open
Minebomber wants to merge 3 commits into
prebid:masterfrom
gohypelab:feat/hypelab-adapter
Open

New adapter: HypeLab#4488
Minebomber wants to merge 3 commits into
prebid:masterfrom
gohypelab:feat/hypelab-adapter

Conversation

@Minebomber

@Minebomber Minebomber commented May 6, 2026

Copy link
Copy Markdown

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

This PR adds the HypeLab bid adapter to Prebid Server Java.

The adapter supports site banner, native, and video inventory. It accepts property_slug and placement_slug bidder params, forwards eligible OpenRTB 2.6 requests to HypeLab, adds HypeLab display manager metadata, and maps HypeLab bid responses back into Prebid bid types.

🧠 Rationale behind the change

HypeLab needs a dedicated adapter because the request is not just a raw OpenRTB pass-through. The adapter validates required bidder params, sets tagid from placement_slug, preserves the HypeLab bidder ext, adds provider metadata, and resolves response bid type from mtype, ext.hypelab.creative_type, VAST markup, or the original impression media type.

🔎 New Bid Adapter Checklist

  • verify email contact works
  • 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?

  • Added unit coverage for request creation, required param validation, mixed valid/invalid impressions, response parsing failures, empty responses, and bid type resolution.
  • Added integration coverage for the /openrtb2/auction path and HypeLab adapter configuration.
  • Ran ./mvnw -Dtest=HypeLabBidderTest test successfully.
  • Generated a local JaCoCo report for HypeLabBidder: 96% instruction coverage and 97% line coverage.

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

Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/resources/bidder-config/hypelab.yaml Outdated
@Minebomber

Copy link
Copy Markdown
Author

Thanks for the feedback, I made an update based off of your review @CTMBNara

Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
Comment thread src/main/java/org/prebid/server/bidder/hypelab/HypeLabBidder.java Outdated
@Minebomber

Copy link
Copy Markdown
Author

Thanks for helping me work through this @CTMBNara. I pushed a patch for your requested changes.

@osulzhenko

Copy link
Copy Markdown
Collaborator

@Minebomber currently, PBS is on hold for adapter merges. The main focus is the next major update, 4.0, which should be finished by the end of Q2. Once that is done, we should be unblocked for merging other PRs. Sorry for the inconvenience.

.toList();
}

private static BidderBid makeBidderBid(Bid bid, String seat, Map<String, Imp> impIdToImp, String currency,

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.

    private static BidderBid makeBidderBid(Bid bid,
                                           String seat,
                                           Map<String, Imp> impIdToImp,
                                           String currency,
                                           List<BidderError> errors) {

Comment on lines +73 to +75
final BidRequest bidRequest = givenBidRequestWithExt(requestExt,
imp -> imp.id("imp1").banner(Banner.builder().w(300).h(250).build())
.ext(givenImpExt("property", "placement")));

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.

        final BidRequest bidRequest = givenBidRequestWithExt(
                requestExt,
                imp -> imp
                        .id("imp1")
                        .banner(Banner.builder().w(300).h(250).build())
                        .ext(givenImpExt("property", "placement")));

Comment on lines +88 to +93
assertThat(request.getMethod()).isEqualTo(HttpMethod.POST);
assertThat(request.getUri()).isEqualTo(ENDPOINT_URL);
assertThat(request.getImpIds()).containsExactly("imp1");
assertThat(request.getHeaders().get(HttpUtil.ACCEPT_HEADER)).isEqualTo("application/json");
assertThat(request.getHeaders().get(HttpUtil.CONTENT_TYPE_HEADER))
.isEqualTo("application/json;charset=utf-8");

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.

No need to check this properties

Comment on lines +96 to +109
assertThat(imp.getTagid()).isEqualTo("placement");
assertThat(imp.getDisplaymanager()).isEqualTo("HypeLab Prebid Server");
assertThat(imp.getDisplaymanagerver()).isEqualTo(PBS_VERSION);
assertThat(imp.getExt()).isEqualTo(mapper.valueToTree(
ExtPrebid.of(null, ExtImpHypeLab.of("property", "placement"))));

assertThat(payload.getExt()).isNotSameAs(requestExt);
assertThat(payload.getExt().getProperty("existing")).isEqualTo(existingExt).isNotSameAs(existingExt);
assertThat(payload.getExt().getProperty("source")).isEqualTo(mapper.valueToTree("prebid-server"));
assertThat(payload.getExt().getProperty("provider_version"))
.isEqualTo(mapper.valueToTree("prebid-server@" + PBS_VERSION));
assertThat(requestExt.getProperty("source")).isNull();
assertThat(requestExt.getProperty("provider_version")).isNull();
assertThat(jacksonMapper.decodeValue(request.getBody(), BidRequest.class)).isEqualTo(payload);

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.

Split into multiple tests

final BidRequest payload = result.getValue().getFirst().getPayload();

assertThat(result.getErrors()).isEmpty();
assertThat(payload.getImp().getFirst().getDisplaymanagerver()).isEqualTo("unknown");

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.

Use same approach for all assertions:

        assertThat(result.getValue())
                .extracting(HttpRequest::getPayload)
                .flatExtracting(BidRequest::getImp)
                .extracting(Imp::getDisplaymanagerver)
                .containsExactly("unknown")

Comment on lines +321 to +323
final List<Imp> imps = impCustomizers.length == 0
? singletonList(givenImp(UnaryOperator.identity()))
: Arrays.stream(impCustomizers)

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.

Remove logic with length == 0 and always provide imp

return givenBidRequestWithExt(null, impCustomizers);
}

private static BidRequest givenBidRequestWithExt(ExtRequest ext, UnaryOperator<Imp.ImpBuilder>... impCustomizers) {

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.

UnaryOperator<Imp.ImpBuilder>... impCustomizers -> Imp.. imps

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.

3 participants