Skip to content

Conversation

@osulzhenko
Copy link
Collaborator

@osulzhenko osulzhenko commented Mar 27, 2025

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

🧠 Rationale behind the change

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

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

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

@osulzhenko osulzhenko added do not merge Not the time for merging yet tests Functional or other tests labels Mar 27, 2025
@osulzhenko osulzhenko requested a review from marki1an March 27, 2025 11:10
@osulzhenko osulzhenko self-assigned this Mar 27, 2025
@osulzhenko osulzhenko changed the base branch from master to bid-adjustments-for-price-floors May 9, 2025 08:19
@osulzhenko osulzhenko removed the do not merge Not the time for merging yet label May 22, 2025
def response = pbsService.sendAuctionRequest(bidRequest)

then: "Final bid price should be adjusted for big with dealId"
response.seatbid.first.bid.find { it.dealid == dealId }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's dead code that does nothing

seatbid.first.bid.first.price = originalPrice
seatbid.first.bid.first.dealid = dealId
}
} as BidResponse
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need as BidResponse?

and: "Bidder request should contain currency from request"
and: "Bidder request should contain original imp.floors"
def bidderRequest = bidder.getBidderRequest(bidRequest.id)
assert bidderRequest.cur == [currency]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why currency assert removed?

private static final Integer MAX_STATIC_ADJUST_VALUE = Integer.MAX_VALUE
private static final String WILDCARD = '*'

private static final Map config = CURRENCY_CONVERTER_CONFIG +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename the config to PBS_CONFIG

STATIC | PBSUtils.getRandomPrice(MAX_CPM_ADJUST_VALUE, MAX_STATIC_ADJUST_VALUE) | ANY | getBidRequestWithFloors(MediaType.BANNER)
}

def "PBS should left original bidderRequest with null floors when request has bidAdjustments config"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like It's a similar test to PBS should adjust bid price for matching bidder and left original bidderRequest with null floors when request has bidAdjustments config

Copy link
Collaborator Author

@osulzhenko osulzhenko May 27, 2025

Choose a reason for hiding this comment

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

In most cases, they are similar, but for floors, you have floors config enabled and floors specified inside request

Comment on lines 1164 to 1188
private static BidRequest getDefaultVideoRequestWithPlacement(VideoPlacementSubtypes videoPlacementSubtypes) {
getBidRequestWithFloors(MediaType.VIDEO).tap {
imp.first.video.tap {
placement = videoPlacementSubtypes
}
}
}

private static BidRequest getDefaultVideoRequestWithPlcmt(VideoPlcmtSubtype videoPlcmtSubtype) {
getBidRequestWithFloors(MediaType.VIDEO).tap {
imp.first.video.tap {
plcmt = videoPlcmtSubtype
}
}
}

private static BidRequest getDefaultVideoRequestWithPlcmtAndPlacement(VideoPlcmtSubtype videoPlcmtSubtype,
VideoPlacementSubtypes videoPlacementSubtypes) {
getBidRequestWithFloors(MediaType.VIDEO).tap {
imp.first.video.tap {
plcmt = videoPlcmtSubtype
placement = videoPlacementSubtypes
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

private static BidRequest getDefaultVideoRequestWithPlacement(VideoPlacementSubtypes videoPlacementSubtypes) {
        getDefaultVideoRequestWithPlcmtAndPlacement(null, videoPlacementSubtypes)
    }

    private static BidRequest getDefaultVideoRequestWithPlcmt(VideoPlcmtSubtype videoPlcmtSubtype) {
        getDefaultVideoRequestWithPlcmtAndPlacement(videoPlcmtSubtype, null)
    }

    private static BidRequest getDefaultVideoRequestWithPlcmtAndPlacement(VideoPlcmtSubtype videoPlcmtSubtype,
                                                                          VideoPlacementSubtypes videoPlacementSubtypes) {
        getBidRequestWithFloors(MediaType.VIDEO).tap {
            imp.first.video.tap {
                plcmt = videoPlcmtSubtype
                placement = videoPlacementSubtypes
            }
        }
    }

Comment on lines 725 to 731
and: "Default bid response with JPY currency"
def originalPrice = PBSUtils.randomDecimal
def bidResponse = BidResponse.getDefaultBidResponse(bidRequest).tap {
cur = USD
seatbid.first.bid.first.price = originalPrice
}
bidder.setResponse(bidRequest.id, bidResponse)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong description

@osulzhenko osulzhenko requested a review from marki1an May 27, 2025 15:52
and: "Bidder request should contain default currency"
and: "Bidder request should contain original imp.floors"
def bidderRequest = bidder.getBidderRequest(bidRequest.id)
assert bidderRequest.cur == [currency]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, please leave a bidder request.cur

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check another cases

cur = currency
seatbid.first.bid.first.price = originalPrice
seatbid.first.bid.first.dealid = PBSUtils.randomString
} as BidResponse
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it isn't needed, same for others


and: "Bidder request should contain reversed imp.floors"
def bidderRequest = bidder.getBidderRequest(bidRequest.id)
assert bidderRequest.imp.bidFloorCur == [currency, currency]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please also add bidderRequest.cur, and same for other.

price = originalPrice
ext = new BidExt()
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove empty line

def currency = EUR
def impPrice = PBSUtils.getRandomPrice(MAX_CPM_ADJUST_VALUE)
def bidRequest = getBidRequestWithFloors(MediaType.BANNER).tap {
cur = [EUR]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: cur = [currency]


then: "Final bid price should be adjusted"
def bidAdjustedPrice = originalPrice * bidAdjustmentFactorsPrice
assert !response.ext.warnings
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add new and: block for warning and errors

@osulzhenko osulzhenko merged commit 2a3d7e8 into bid-adjustments-for-price-floors May 30, 2025
1 check passed
@osulzhenko osulzhenko deleted the functional-tests/adjust-floors branch May 30, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Functional or other tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants