Skip to content

Conversation

@osulzhenko
Copy link
Collaborator

@osulzhenko osulzhenko commented May 4, 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 the tests Functional or other tests label May 4, 2025
@osulzhenko osulzhenko requested a review from marki1an May 4, 2025 16:32
@osulzhenko osulzhenko self-assigned this May 4, 2025
id = UUID.randomUUID()
impid = imp.id
price = PBSUtils.getRandomPrice()
price = imp.bidFloor != null ? PBSUtils.getRandomPrice(imp.bidFloor) : PBSUtils.getRandomPrice()
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 we should apply imp.bidFloor != null ? imp.bidFloor : PBSUtils.getRandomPrice()

"request ${bidRequest.id}, reason: ${URL_EMPTY_WARNING_MESSAGE("$BASIC_FETCH_URL$bidRequest.accountId", message)}"
}
// Required: Sync no longer logs "in progress"—only "none" or "error" statuses are recorded
protected static final String FETCHING_DISABLED_ERROR = 'Fetching is disabled'
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. Please removethe comment
  2. Please use double quotes, not a single "Fetching is disabled"

}

def "PBS shouldn't emit error in log and response when floors is not in request and floors fetching disabled for account"() {
given: "Account with disabled fetching"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Empty space

Comment on lines 1679 to 1680
and: "Flush metrics"
flushMetrics(floorsPbsService)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this block before where:
It isn't mandatory, it's rather a code style for us.
Also, it can be applied to other

bidRequest << [BidRequest.getDefaultBidRequest(), getBidRequestWithFloors().tap { it.ext.prebid.floors = null }]
}

def "PBS should emit error in log and response when data is invalid and floors fetching disabled for account and enabled for request"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

"PBS should emit error in log and response when floor data is empty and floors fetching disabled for account and enabled for request"

Comment on lines 114 to 116
static BigDecimal getRandomPrice(BigDecimal min, BigDecimal max = 10, int scale = 3) {
getRandomDecimal(min, max).setScale(scale, HALF_UP)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't see a point to have it

Comment on lines 1631 to 1635
def priceFloors = new AccountPriceFloorsConfig(enabled: true, fetch: new PriceFloorsFetch(enabled: false))
def accountAuctionConfig = new AccountAuctionConfig(priceFloors: priceFloors)
def accountConfig = new AccountConfig(auction: accountAuctionConfig)
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
accountDao.save(account)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here you can use getAccountWithEnabledFetch method and just with

.tap{
...priceFloors.enabled = false
}

assert metrics[ALERT_GENERAL] == 1
}

def "PBS shouldn't emit error in log and response when data is invalid and floors fetching disabled for account and #requestFloors for request"() {
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:
"PBS shouldn't emit error in log and response when floor data is empty and floors fetching disabled for account and #requestFloors for request"

assert metrics[ALERT_GENERAL] == 1
}

def "PBS shouldn't emit error or warning when floors for account configured correctly"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

@osulzhenko osulzhenko closed this May 5, 2025
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