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

Core: Transition PAAPI parameters #3670

Merged
merged 27 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1810e87
Added new PAA iab model.
And1sS Dec 16, 2024
abd3104
PAA WIP.
And1sS Dec 20, 2024
ebfa6df
Refactoring.
And1sS Dec 20, 2024
e4a45ef
Refactoring.
And1sS Dec 26, 2024
824d279
Refactoring.
And1sS Dec 26, 2024
4b60b51
Partly fixed unit tests.
And1sS Jan 7, 2025
5bf42c6
Fixed unit tests.
And1sS Jan 7, 2025
81d8c77
Added unit tests for BidResponseCreator and HttpBidderRequester
And1sS Jan 8, 2025
5d6d88b
Added igs.ae mapping.
And1sS Jan 9, 2025
4ca36ba
Removed TODOs.
And1sS Jan 9, 2025
9e492ba
Fixed styling.
And1sS Jan 9, 2025
8333f7c
Fixed naming.
And1sS Jan 9, 2025
9292540
Merge branch 'master' into feature/paa
And1sS Jan 10, 2025
b0c7f31
Fixes after merging master
And1sS Jan 10, 2025
85208f5
Fixed IxTest.
And1sS Jan 10, 2025
3882deb
Made paa format default to original.
And1sS Jan 14, 2025
0841723
Added missing validations.
And1sS Jan 14, 2025
032f15f
Fixed inconsistent unit test.
And1sS Jan 14, 2025
5163003
Merge branch 'master' into feature/paa
And1sS Jan 14, 2025
7fd613e
Fixed igi validations.
And1sS Jan 15, 2025
bfffd2f
Fixed styling.
And1sS Jan 15, 2025
d5d45c3
Added bidRequest level alias resolving and response level debug warni…
And1sS Jan 24, 2025
c466359
Refactored ImpAdjuster.
And1sS Jan 24, 2025
ce1d57f
Now paa debug warnings utilize debugEnabled flag.
And1sS Jan 24, 2025
d16a64b
Added metrics.
And1sS Jan 27, 2025
7ea648e
Test: `Transition PAAPI parameters` (#3634)
marki1an Jan 27, 2025
77df115
Merge branch 'refs/heads/master' into feature/paa
osulzhenko Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Made paa format default to original.
  • Loading branch information
And1sS committed Jan 14, 2025
commit 3882deb85f8fd67dc7861ae7279c0e62fe58b807
Original file line number Diff line number Diff line change
@@ -898,9 +898,9 @@ private List<ExtIgi> toExtBidResponseIgi(List<BidderResponseInfo> bidderResponse

private ExtIgi extIgiWithBidder(ExtIgi extIgi, String bidder) {
final List<ExtIgiIgs> extIgiIgs = CollectionUtils.emptyIfNull(extIgi.getIgs()).stream()
.map(igs -> Optional.ofNullable(igs)
.map(ExtIgiIgs::toBuilder)
.orElseGet(ExtIgiIgs::builder)
.filter(Objects::nonNull)
.filter(igs -> StringUtils.isNotEmpty(igs.getImpId()))
.map(igs -> igs.toBuilder()
.ext(ExtIgiIgsExt.of(bidder, bidderCatalog.resolveBaseBidder(bidder)))
.build())
.toList();
@@ -1229,7 +1229,7 @@ private static PaaFormat resolvePaaFormat(AuctionContext auctionContext) {
.or(() -> Optional.ofNullable(auctionContext.getAccount())
.map(Account::getAuction)
.map(AccountAuctionConfig::getPaaFormat))
.orElse(PaaFormat.IAB);
.orElse(PaaFormat.ORIGINAL);
}

/**
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
import org.prebid.server.auction.model.CachedDebugLog;
import org.prebid.server.auction.model.CategoryMappingResult;
import org.prebid.server.auction.model.MultiBidConfig;
import org.prebid.server.auction.model.PaaFormat;
import org.prebid.server.auction.model.TargetingInfo;
import org.prebid.server.auction.model.TimeoutContext;
import org.prebid.server.auction.model.debug.DebugContext;
@@ -91,6 +92,7 @@
import org.prebid.server.proto.openrtb.ext.response.ExtBidPrebid;
import org.prebid.server.proto.openrtb.ext.response.ExtBidPrebidVideo;
import org.prebid.server.proto.openrtb.ext.response.ExtBidResponse;
import org.prebid.server.proto.openrtb.ext.response.ExtBidResponseFledge;
import org.prebid.server.proto.openrtb.ext.response.ExtBidResponsePrebid;
import org.prebid.server.proto.openrtb.ext.response.ExtBidderError;
import org.prebid.server.proto.openrtb.ext.response.ExtDebugTrace;
@@ -3520,7 +3522,7 @@ public void shouldAddExtIgiIfAvailable() {
final Imp imp = givenImp("i1").toBuilder()
.ext(mapper.createObjectNode().put("ae", 1))
.build();
final BidRequest bidRequest = givenBidRequest(identity(), identity(), imp);
final BidRequest bidRequest = givenBidRequest(identity(), ext -> ext.paaFormat(PaaFormat.IAB), imp);
final ExtIgi igi = ExtIgi.builder()
.impid("impId")
.igs(singletonList(ExtIgiIgs.builder().config(mapper.createObjectNode()).build()))
@@ -3554,6 +3556,51 @@ public void shouldAddExtIgiIfAvailable() {
.build());
}

@Test
public void shouldDefaultToOriginalPaaFormat() {
// given
given(bidderCatalog.resolveBaseBidder("bidder1")).willReturn("adapter1");
final Imp imp = givenImp("i1").toBuilder()
.ext(mapper.createObjectNode().put("ae", 1))
.build();
final BidRequest bidRequest = givenBidRequest(identity(), identity(), imp);
final ExtIgi igi = ExtIgi.builder()
.impid("impId")
.igs(singletonList(ExtIgiIgs.builder().config(mapper.createObjectNode()).build()))
.build();

final Bid bid = Bid.builder().id("bidId1").price(BigDecimal.valueOf(2.37)).impid("i1").build();
final List<BidderResponse> bidderResponses = singletonList(
BidderResponse.of("bidder1",
BidderSeatBid.builder()
.bids(List.of(BidderBid.of(bid, banner, "USD")))
.igi(singletonList(igi))
.build(), 100));

final AuctionContext auctionContext = givenAuctionContext(
bidRequest,
contextBuilder -> contextBuilder.auctionParticipations(toAuctionParticipant(bidderResponses)));

// when
final BidResponse bidResponse = target
.create(auctionContext, CACHE_INFO, MULTI_BIDS)
.result();

// then
assertThat(bidResponse.getExt())
.extracting(ExtBidResponse::getPrebid)
.extracting(ExtBidResponsePrebid::getFledge)
.extracting(ExtBidResponseFledge::getAuctionConfigs)
.asList()
.containsExactly(
FledgeAuctionConfig.builder()
.impId("impId")
.config(mapper.createObjectNode())
.bidder("bidder1")
.adapter("adapter1")
.build());
}

@Test
public void shouldAddExtPrebidFledgeIfAvailableEvenIfBidsEmpty() {
// given