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

Extract common bidders config properties to default config #1451

Closed
rpanchyk opened this issue Aug 27, 2021 · 3 comments
Closed

Extract common bidders config properties to default config #1451

rpanchyk opened this issue Aug 27, 2021 · 3 comments

Comments

@rpanchyk
Copy link
Contributor

rpanchyk commented Aug 27, 2021

This one is about refactoring of configuration inside PBS.

Intro

We have multiple repeating configuration options in bidder configs which are the same. Here are a few full bidders' configs:

File: src/main/resources/bidder-config/appnexus.yaml

adapters:
  appnexus:
    enabled: false
    endpoint: http://ib.adnxs.com/openrtb2
    pbs-enforces-gdpr: true
    pbs-enforces-ccpa: true
    modifying-vast-xml-allowed: true
    deprecated-names:
    aliases:
      districtm:
        enabled: false
    meta-info:
      maintainer-email: some@email.com
      app-media-types:
        - banner
        - video
        - native
      site-media-types:
        - banner
        - video
      supported-vendors:
      vendor-id: 32
    usersync:
      url: https://ib.adnxs.com/getuid?
      redirect-url: /setuid?bidder=adnxs...
      cookie-family-name: adnxs
      type: redirect
      support-cors: false

File: src/main/resources/bidder-config/conversant.yaml

adapters:
  conversant:
    enabled: false
    endpoint: http://api.hb.ad.cpe.dotomi.com/s2s/header/24
    pbs-enforces-gdpr: true
    pbs-enforces-ccpa: true
    modifying-vast-xml-allowed: true
    generate-bid-id: true
    deprecated-names:
    aliases: {}
    meta-info:
      maintainer-email: some@email.com
      app-media-types:
        - banner
        - video
      site-media-types:
        - banner
        - video
      supported-vendors:
      vendor-id: 24
    usersync:
      url: https://prebid-match.dotomi.com
      redirect-url: /setuid?bidder=conversant...
      cookie-family-name: conversant
      type: redirect
      support-cors: false

File: src/main/resources/bidder-config/rubicon.yaml

adapters:
  rubicon:
    enabled: false
    endpoint: http://exapi-us-east.rubiconproject.com/a/api/exchange.json
    pbs-enforces-gdpr: true
    pbs-enforces-ccpa: true
    deprecated-names:
    aliases: {}
    modifying-vast-xml-allowed: true
    generate-bid-id: false
    XAPI:
      Username:
      Password:
    meta-info:
      maintainer-email: some@email.com
      app-media-types:
        - banner
      site-media-types:
        - banner
        - video
      supported-vendors:
        - activeview
        - adform
        - comscore
        - doubleverify
        - integralads
        - moat
        - sizemek
        - whiteops
      vendor-id: 52
    usersync:
      url: https://pixel.rubiconproject.com/exchange/sync.php
      redirect-url:
      cookie-family-name: rubicon
      type: redirect
      support-cors: false

Problem

Each of the above has a list of identical properties:

adapters:
  <BIDDER>:
    enabled: false
    pbs-enforces-gdpr: true
    pbs-enforces-ccpa: true
    modifying-vast-xml-allowed: true

So, this can be painful if we'll need to change for example, the name or value of any of those.

Solution

We have at least two ways to reduce bidder's config:

  1. Move values to default Spring config in code. This is not perfect - we don't need to mix code with configuration.
  2. Create default config section in application.yaml file:
adapter-defaults:
  enabled: false
  pbs-enforces-gdpr: true
  pbs-enforces-ccpa: true
  modifying-vast-xml-allowed: true

If bidder wants to override any of above, for example appnexus.aliases, it can be added to bidder's config YAML file.

So, PBS will merge this default bidder config with particular bidder's config.

The second approach is more preferable since it describes all possible values for bidder's config in viewable method.

As a improvement follows - we don't need to go though all of 100x bidders' configurations to add new properties.

@muuki88
Copy link
Contributor

muuki88 commented Aug 28, 2021

Thanks a lot for the detailed explanation 💪🎉

I fully agree with your approach. We have been using the typesafe config library for quite some time and using this pattern in other places as well.

@rpanchyk
Copy link
Contributor Author

thx @muuki88
we're still thinking of best approach. But the idea of extracting common bidders' properties is alive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants