Skip to content

New adapter: HypeLab#4488

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

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

Conversation

@Minebomber
Copy link
Copy Markdown

@Minebomber Minebomber commented May 6, 2026

🔧 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 on lines +80 to +82
return Result.of(Collections.singletonList(BidderUtil.defaultRequest(outgoingRequest, headers(), endpointUrl,
mapper)),
errors);
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.

        return Result.of(
                Collections.singletonList(BidderUtil.defaultRequest(
                        outgoingRequest,
                        headers(),
                        endpointUrl,
                        mapper)),
                errors);

Comment on lines +97 to +99
if (imp.getExt() == null) {
throw new PreBidException("imp %s: unable to unmarshal ext".formatted(imp.getId()));
}
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.

imp.ext can't be null here. Remove this check

try {
final ExtPrebid<?, ExtImpHypeLab> extPrebid =
mapper.mapper().convertValue(imp.getExt(), HYPELAB_EXT_TYPE_REFERENCE);
extImp = extPrebid != null ? extPrebid.getBidder() : null;
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.

imp.ext.prebid can't be null here

Comment on lines +110 to +112
if (extImp == null) {
throw new PreBidException("imp %s: unable to unmarshal ext.bidder".formatted(imp.getId()));
}
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.

Can't be null

Comment on lines +127 to +129
return mapper.fillExtension(outgoingExt, Map.of(
"source", SOURCE,
"provider_version", PROVIDER_VERSION_PREFIX + pbsVersion()));
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.

Here you can add properties as usual. I asked you to use mapper.fillExtension for ext.getProperties() so it will make a deep copy

}

final Map<String, Imp> impIdToImp = request.getImp().stream()
.collect(Collectors.toMap(Imp::getId, imp -> imp));
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.

imp -> imp -> Function.identity()

mediaTypeCount++;
}

return mediaTypeCount == 1 ? Optional.of(bidType) : Optional.empty();
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.

Optional.of -> Optional.ofNullable

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.

2 participants