Skip to content

Conversation

@osulzhenko
Copy link
Collaborator

@osulzhenko osulzhenko commented Jul 11, 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 self-assigned this Jul 11, 2025
@osulzhenko osulzhenko added the tests Functional or other tests label Jul 11, 2025
@osulzhenko osulzhenko added work in progress Signals not finished work and removed blocked labels Sep 1, 2025
@osulzhenko osulzhenko marked this pull request as ready for review September 1, 2025 09:34
@osulzhenko osulzhenko removed the work in progress Signals not finished work label Sep 1, 2025
import org.prebid.server.functional.model.request.profile.ProfileMergePrecedence
import org.prebid.server.functional.util.ObjectMapperWrapper

class ProfileMergePrecedenceConvert implements AttributeConverter<ProfileMergePrecedence, String>, ObjectMapperWrapper {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I hope you don't need the ObjectMapperWrapper dependency here

import org.prebid.server.functional.model.request.profile.ProfileType
import org.prebid.server.functional.util.ObjectMapperWrapper

class ProfileTypeConvert implements AttributeConverter<ProfileType, String>, ObjectMapperWrapper {
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 with ObjectMapperWrapper


@ToString(includeNames = true, ignoreNulls = true)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy)
class FilesystemAccount {
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 such a class?(Don't see any use case)

import org.prebid.server.functional.model.config.AccountConfig

@ToString(includeNames = true, ignoreNulls = true)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy)
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 need a strategy for now

PrebidOptions options

@JsonProperty("profiles")
List<String> profilesNames
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 to profileNames

Comment on lines 434 to 436
Boolean copyToContainer(String content, String containerPath) {
pbsContainer.copyToContainer(content, containerPath)
}
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 have usages

.replace("]", "_")
}

PrebidServerContainer copyToContainer(String content, String containerPath) {
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 don't need a snippet of this code till to line 165

Comment on lines 55 to 65
final static <T> T decodeYaml(String yamlString, Class<T> clazz) {
yaml.readValue(yamlString, clazz)
}

final static <T> T decodeYaml(String yamlString, TypeReference<T> typeReference) {
yaml.readValue(yamlString, typeReference)
}

final static <T> T decodeYaml(InputStream inputStream, Class<T> clazz) {
yaml.readValue(inputStream, clazz)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe we can remove those three methods

private static final ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(NON_NULL)
.registerModule(new ZonedDateTimeModule())
private static final YAMLMapper yaml = new YAMLMapper().setSerializationInclusion(NON_NULL)
.registerModule(new ZonedDateTimeModule()) as YAMLMapper
Copy link
Collaborator

Choose a reason for hiding this comment

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

.registerModule(new ZonedDateTime Module()) can be removed since we don't use date time in serialisation

Comment on lines 47 to 48
accountId varchar(64) NOT NULL,
profileId varchar(128) NOT NULL,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like to change of accountId varchar to 40 and the same for profileId.


private static final ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(NON_NULL)
.registerModule(new ZonedDateTimeModule())
private static final YAMLMapper yaml = new YAMLMapper().setSerializationInclusion(NON_NULL) as YAMLMapper
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 yaml to yamlMapper


private static final String REJECT_ERROR_MESSAGE = 'replace'
private static final String LIMIT_ERROR_MESSAGE = 'Profiles exceeded the limit.'
private static final String INVALID_REQEUST_PREFIX = 'Invalid request format: Error during processing profiles: '
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
private static final String INVALID_REQEUST_PREFIX = 'Invalid request format: Error during processing profiles: '
private static final String INVALID_REQUEST_PREFIX = 'Invalid request format: Error during processing profiles: '

Comment on lines 127 to 129
and: "Default account"
def account = new Account(uuid: bidRequest.accountId, status: ACTIVE)
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.

We don't need this account for passing test

]

private static final Map<String, String> PROFILES_CONFIG = [
'adapters.openx.enabled' : "true",
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 don't need this bidder

}
}

def "PBS should skip invalid request profile from database when merge strategy #mergeStrategy"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here, please check that bidder called

assert !secondBidderImpBanner.btype
}

def "PBS should include invalid or missing profiles into limit count"() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Literally can't understand what the test does

Comment on lines 867 to 870
given: "PBS with profiles.fail-on-unknown config"
def failOnUnknownProfilesConfig = new HashMap<>(PROFILES_CONFIG)
failOnUnknownProfilesConfig["auction.profiles.fail-on-unknown"] = "true"
def prebidServerService = pbsServiceFactory.getService(failOnUnknownProfilesConfig)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be simplified wihout creating a hashMap pbsServiceFactory.getService(PROFILES_CONFIG + ["auction.profiles.fail-on-unknown": true])

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for others

Comment on lines 886 to 887
and: "Flash metrics"
flushMetrics(prebidServerService)
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 for this case

@osulzhenko osulzhenko requested a review from marki1an September 3, 2025 13:25
class RequestProfile extends Profile<BidRequest> {

static RequestProfile getProfile(String accountId = PBSUtils.randomString,
String name = PBSUtils.randomString,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Formating

Comment on lines 326 to 328
and: "Default account"
def account = new Account(uuid: accountId, status: ACTIVE)
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.

Please remove account

when: "PBS processes auction request"
def response = pbsWithStoredProfiles.sendAuctionRequest(bidRequest)

then: "No errors should be emitted in debug"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does it mean in debug?

@osulzhenko osulzhenko requested a review from marki1an September 4, 2025 07:46
@osulzhenko osulzhenko merged commit 855f129 into add-profiles Sep 4, 2025
1 check passed
@osulzhenko osulzhenko deleted the functional-tests/profiles branch September 4, 2025 11:10
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