Skip to content

Tests: Accept targeting.site as array#4426

Open
marki1an wants to merge 3 commits intomasterfrom
amp-targeting-site-remove-drop-site-validation
Open

Tests: Accept targeting.site as array#4426
marki1an wants to merge 3 commits intomasterfrom
amp-targeting-site-remove-drop-site-validation

Conversation

@marki1an
Copy link
Collaborator

@marki1an marki1an commented Mar 9, 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?

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?

@marki1an marki1an self-assigned this Mar 9, 2026
@marki1an marki1an added the tests Functional or other tests label Mar 9, 2026
@marki1an marki1an changed the title Test:Accept targeting.site as array Tests: Accept targeting.site as array Mar 9, 2026
@marki1an
Copy link
Collaborator Author

marki1an commented Mar 9, 2026

Corresponding issue prebid/prebid-server#4079

def "PBS amp shouldn't emit error for targeting when site is array"() {
given: "Create targeting with array of site"
def anyRandomValue = PBSUtils.randomString
def targeting = ["site": [PBSUtils.randomString], "any" : anyRandomValue]
Copy link
Collaborator

Choose a reason for hiding this comment

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

work only for for site object(s) "site": [Site.defaultSite] , and what if empty, or >1?

Comment on lines +1940 to +1943

where:
siteValue << [null, [], [PBSUtils.randomString], [Site.defaultSite], [Site.defaultSite, PBSUtils.randomString],
[PBSUtils.randomString, Site.defaultSite], [App.defaultApp, Site.defaultSite]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, this implementation isn't correct based on the existing code. If you look at OrtbTypesResolver.normalizeBidRequest, it should throw an error for non-site objects.
We also need to cover:

  • cases where site.size >= 2 it it okay.
  • What are the side effects on bidderRequest and bidRequest?
    Please investigate this further

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.

2 participants