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

Prebid 1.0 prebid server #1846

Merged
merged 19 commits into from
Nov 28, 2017

Conversation

snapwich
Copy link
Collaborator

Type of change

  • Refactoring (no functional changes, no api changes)

Description of change

This is an update of the prebidServerBidAdapter and s2sTesting modules to be 1.0 compliant.

Some of this changed the interface of the prebidServerBidAdapter to be more like a regular bidAdapter (the queueSync and setConfig methods were removed in favor of pbjs.setConfig (which calls queueSync as well)), and the adapter.callBids method was extended to expect additional arguments (a bidRequests array, addBidResponse function, done function, and ajax helper). So while there were no changes to the public API, there were changes to internal API which could affect other submissions, such as other server adapters.

Let me know if you have any questions or comments on how those internal APIs were changed.

assert.ok(logErrorSpy.calledOnce, true);
});
});
// describe('setS2SConfig', () => {
Copy link
Member

Choose a reason for hiding this comment

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

are these tests failing or should just be removed altogether?

Copy link
Collaborator

Choose a reason for hiding this comment

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

will move them to prebidServerBidAdapter_spec.js

if (bid.params[key]) {
const converted = types[key](bid.params[key]);
if (converted !== bid.params[key]) {
utils.logMessage(`Mismatched type for Prebid Server : ${bid.bidder} : ${key}. Required Type:${types[key]}`);
Copy link
Member

Choose a reason for hiding this comment

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

let's remove this message. It doesn't serve any real purpose.

},
};

let _cookiesQueued = false;
Copy link
Member

Choose a reason for hiding this comment

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

it doesn't look like value ever changes. Is it needed?

});
}

// const receivedBidIds = result.bids ? result.bids.map(bidObj => bidObj.bid_id) : [];
Copy link
Member

Choose a reason for hiding this comment

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

dead code can be removed

@mkendall07
Copy link
Member

This LGTM with a few minor updates. @harpere can you push updates for those items while Rich is out?

Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a comment

Choose a reason for hiding this comment

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

@snapwich @harpere
Left some comments.
Tested with https://jsfiddle.net/oy3mzh4p/
I do not see any s2s request in network tab.


let _s2sConfigDefaults = {
enabled: false,
endpoint: CONSTANTS.S2S.DEFAULT_ENDPOINT,
Copy link
Collaborator

Choose a reason for hiding this comment

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

These constants are not defined in constants.json

Copy link
Collaborator

Choose a reason for hiding this comment

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

As mentioned elsewhere we should leave the endpoint defaults blank, and probably just hard code the adapter, either here or in config.js like was mentioned in another comment.

@@ -22,16 +22,6 @@ const DEFAULT_USERSYNC = {
syncDelay: 3000
};
const DEFAULT_TIMEOUTBUFFER = 200;
const DEFAULT_S2SCONFIG = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we keep default values here in this file ?
How will other s2s adapters get default values ? Like this guy #1819

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to me @jaiminpanchal27, but want to let @snapwich weigh in before changing it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, we shouldn't have real defaults for endpoint and syncEndpoint. We should be bidder agnostic.

Copy link
Member

Choose a reason for hiding this comment

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

possibly in 1.0. If we omit them now it will break publishers integrations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I figured the adapters would specify their defaults. Do we want to constrain server adapters to the same configuration? We could, but I assumed we'd let each server adapter behave how it wished, as well as encapsulate as much code as possible inside the module as to not pollute the prebid-core w/ stuff related to a specific module.

Copy link
Member

Choose a reason for hiding this comment

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

yeah I'm ok with each server adapter specifying it's own defaults.

let [clientBidRequests, serverBidRequests] = bidRequests.reduce((partitions, bidRequest) => {
partitions[Number(typeof bidRequest.src !== 'undefined' && bidRequest.src === CONSTANTS.S2S.SRC)].push(bidRequest);
return partitions;
}, [[], []]);

if (serverBidRequests.length) {
let adaptersServerSide = _s2sConfig.bidders;
Copy link
Collaborator

Choose a reason for hiding this comment

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

_s2sConfig is not having any default values here. I am getting below object

{
  "enabled": true,
  "bidders": [
    "appnexusAst"
  ],
  "accountId": "<some-id>"
}

I tested with this test page

Copy link
Member

Choose a reason for hiding this comment

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

@snapwich
Did you check this? Jaimin said it was broken for him when he tested.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just tested with the latest and I seem to be getting the defaults. I'll push the few changes I have and see if that helps, but I think it should have been working before as well.

Eric Harper and others added 2 commits November 22, 2017 00:38
const getConfig = config.getConfig;

const TYPE = S2S.SRC;
const cookieSetUrl = 'https://acdn.adnxs.com/cookieset/cs.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be bidder agnostic, so shouldn't hard code it.

Copy link
Member

Choose a reason for hiding this comment

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

yeah probably want to add it to the S2S options.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

adding a property called 'cookieSetUrl'

@harpere
Copy link
Collaborator

harpere commented Nov 22, 2017

@mkendall07 made your suggested changes, but want to let @snapwich weigh in on @jaiminpanchal27's comments

@snapwich
Copy link
Collaborator Author

updated

@snapwich
Copy link
Collaborator Author

I added an API for modules to be able to set defaults for config settings. It's similar to setConfig except we don't want subscribers notified when we are just settings defaults.

@mkendall07 mkendall07 merged commit bbc2df0 into prebid:prebid-1.0 Nov 28, 2017
matthewlane pushed a commit that referenced this pull request Dec 7, 2017
* Concurrent auctions (#1593)

* Adding timestamp function to utils

* Auction manager (WIP)

* WIP

* Updated targeting with auction instances and added auction status

* Updated appnexus and appnexusAst adapter

* Added done callback

* Removing bidmanager functions

* Removing deprecated public api functions

* remove bidmanager file

* Revert "remove bidmanager file"

This reverts commit 616409e.

* Updated appnexus and rubicon adapters to call done callback after all responses are back

* Added todo

* Fixing circular dependency

* filter s2s requests

* Emit auction end
Add getBidsRequested function

* remove unused stuff from adapters

* cleanup and fixes

* Unit test fixes
Added exclude to karma temporarily to support unit tests

* added setTimeout for each auction instance

* added constants closer to code

* binded auction object inside done method

* Adding auctionmanager_spec tests and fixes

* Remove breakpoint

* Moving auction to separate file and unit tests

* Merged manually

* Merged config api changes

* Passing adunits, adunitscodes via constructor and fixing unit tests

* added ajax with timeout

* convert targeting module to factory pattern

* Auction code refactored and unit tests

* Updated bidderfactory for 1.0 changes and added unit tests

* Renamed placementCode to adUnitCode

* Refactor auction and update unit tests

* JSDoc for auction and auctionManager

* Unit test fixes after rebase

* Manual merge new updates to bidmanager and its spec file into auction

* Update appnexusAst spec file

* Refactor

* Prebid 1.0 does not require no_bid to be added

* removed side effect by cloning objects

* bug fix to set status on already used bid

* Removing all !1.0 complaiant adapters

* Adding aliases to appnexusAst adapter

* Removed bidmanager from currency

* Add ignore-loader to handle .md files (#1646)

* Auction module refactor (#1644)

* Auction moduel refactor

* remove comment and global cbtimeout

* Config api updates (#1633)

* Add timeoutBuffer, s2sconfig, bidderSequence to config

* Removing deprecated function and its unit test

* fixed linting errors

* Adapter/rubicon bid adapter markup (#1674)

* initial take on rubiconBidAdapter markup

* formatting

* formatting, cont.

* formatting, cont.

* Prebid 1.0 Fix issue with video bid validation (#1680)

* Fix issue with video bid validation

* Modified tests to stub `auctionManager.getBidsRequested` instead of `getBidRequest`

* Move stub to beforeEach hook

* Fix lint errors

* Add bidRequests param to bid validation

* Auction module updated to support currency/hook (#1733)

* added hook module to prebid core that allows extension of arbitrary functions

* remove unused dependency tiny-queue

* change PluginFunction to HookedFunction

* more hook documentation fixes

* Auction module updated to support currency/hook

* remove unused dependency tiny-queue

* change PluginFunction to HookedFunction

* more hook documentation fixes

* WIP

* allow context for hooked functions

* added tests for context

* remove withContext, just use bind

* fix in hooks so asyncSeries keeps proper bound context

* Unit test fixes

* Updated bid validation function

* Fixed video unit test

* updated sizeMapping to use sizeConfig and support labels (#1772)

* updated sizeMapping to use sizeConfig and support labels

* added new tests for labels and sizes w/ sizeConfig when making auction

* made some names clearer and added type to labels for sizeMapping

* make error message more descriptive in adaptermanager

* remove extra line in adpatermanager

* update package.json with correct version. (#1813)

* Unit test fixes for IE 10 and other old browsers (#1810)

* Added fix for location.origin

* Fixed test case failing in IE and Safari browsers

* Added utils.getOrigin method

* Updated renderer to use hooks

* Rename appnexusAst adapter to appnexus adapter (#1848)

* Renamed appnexusAst adapter to appnexus

* Updated unit test to use appnexus bidderCode

* Remove completed todo comment

* fixed safeframe for 1.0 (#1834)

* Emit array of objects from BID_TIMEOUT event (#1824)

* Emit array of objects from BID_TIMEOUT event

* requestId is now auctionId

* Use v4 UUID to match previous requestId format

* Move function

* Move public winningBids to auction (#1828)

* Move public winningBids to auction

* removed _winningBids

* removed _winningBids

* bugfix: return only new bids

* Updates for PubWise Prebid 1.0 Support (#1847)

* Updates for Prebid 1.0 Support

* Updates for Bug Fixes and a small refactor

* update JSDoc comment. Remove trailing space (#1872)

tests were failing due to no trailing space eslint rule.

* Prebid 1.0 adxcg analytics adapter fix for bidtimeout event (#1871)

* adxcg analytics adapter for 1.0 bidtimeout event

* update tests for adxcg analytics 1.0

* Prebid 1.0 prebid server (#1846)

* fix adaptermanager s2sTest unit tests

* fix s2s log message

* remove errant comment

* fixed log statement

* removed seemingly unnecessary call to transformHeightWidth(adUnit);

* removed legacy sizeMapping code block

* initial refactor of prebidServerBidAdapter working w/o tests

(cherry picked from commit 2b843d0)

* add transformSizes back for prebidServer adUnits to fix request

* fixed adapterManager_spec tests

* added prebidServerBidAdapter tests for 1.0

* fixed lint errors

* make sure addBidResponse and doneCb are stubbed for s2s calls

* s2s requests now firing BID_REQUESTED event

* fixed commented tests and other minor fixes

* update defaults in prebidServerBidAdapter and fix doBidderSync bug

* add new API for setting defaults in config for modules

* Targeting updates (#1689)

* Cherry pick alias bidder

* Cherry pick alias bidder

* Cherry pick alias bidder

* Updated test case to not import adapter

* targeting updates

* targeting functions refactoring

* Refactored functions

* more refactor of function

* added jsdoc and some more refactor

* check bid expiry and filtering used bids

* make sure we have the right version

* Update version to fix invalid semver

* video bug fix (#1906)

* video bug fix
added required params to prebidServerAdapter

* Emitted auction_end and updated ttl for prebidServer

* fix logging of server adapters

* Manually merge bidManager code to auction module (#1905)

* Unit test fix in IE for adxcgAnalytics Adapter (#1929)

* IE bug fix

* get only unique bidders

* added log message for xhr timeout (#1928)

* remove polyfill.js and remove global polyfills (#1918)

* remove polyfill.js and remove global polyfills

* make sure find, findIndex, and includes use core-js in tests

* switch from virtual function bind core-js to explicit usage.

* remove transform-function-bind babel plugin

* Replace usePrebidCache with cache:url and remove default (#1904)

* replace usePrebidCache with video:cacheUrl and remove default

* remove newConfig in dfpAdServerVideo_spec that isn't doing anything

* change video.cacheUrl to cache.url

* update to cache.url in auction and remove from adapter

* pulsepointLiteBidAdapter renamed to pulsepointBidAdapter (#1931)

* ET-1691: Pulsepoint Analytics adapter for Prebid. (#1)

* ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter

* ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter

* ET-1691: cleanup

* ET-1691: minor

* ET-1691: revert package.json change

* Adding bidRequest to bidFactory.createBid method as per #509

* ET-1765: Adding support for additional params in PulsePoint adapter (#2)

* ET-1850: Fixing #866

* Minor fix

* Adding mandatory parameters to Bid

* Pulsepoint adapter changes

* readme updates

* add 'x_source.tid' to rubicon requests (#1933)

* Bring in pre-1.0 native-image asset adapter change (#1934)

* 33Across Adapter: Removed the usage of utils library (#1917)

* Removed the usage of utils library to get bidder requests during userSync since this info will now be passed into the method

* Fixed extra space which cause lint to fail

* Implemented user sync per code review feedback in #1917

* Minor feedback changes

* Re-instated lint check for all files which was accidentally commited after testing

* Prebid 1.0 server cache (#1935)

* add cache stuff to video for prebid server

* add description for cacheMarkup
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* Concurrent auctions (prebid#1593)

* Adding timestamp function to utils

* Auction manager (WIP)

* WIP

* Updated targeting with auction instances and added auction status

* Updated appnexus and appnexusAst adapter

* Added done callback

* Removing bidmanager functions

* Removing deprecated public api functions

* remove bidmanager file

* Revert "remove bidmanager file"

This reverts commit 616409e.

* Updated appnexus and rubicon adapters to call done callback after all responses are back

* Added todo

* Fixing circular dependency

* filter s2s requests

* Emit auction end
Add getBidsRequested function

* remove unused stuff from adapters

* cleanup and fixes

* Unit test fixes
Added exclude to karma temporarily to support unit tests

* added setTimeout for each auction instance

* added constants closer to code

* binded auction object inside done method

* Adding auctionmanager_spec tests and fixes

* Remove breakpoint

* Moving auction to separate file and unit tests

* Merged manually

* Merged config api changes

* Passing adunits, adunitscodes via constructor and fixing unit tests

* added ajax with timeout

* convert targeting module to factory pattern

* Auction code refactored and unit tests

* Updated bidderfactory for 1.0 changes and added unit tests

* Renamed placementCode to adUnitCode

* Refactor auction and update unit tests

* JSDoc for auction and auctionManager

* Unit test fixes after rebase

* Manual merge new updates to bidmanager and its spec file into auction

* Update appnexusAst spec file

* Refactor

* Prebid 1.0 does not require no_bid to be added

* removed side effect by cloning objects

* bug fix to set status on already used bid

* Removing all !1.0 complaiant adapters

* Adding aliases to appnexusAst adapter

* Removed bidmanager from currency

* Add ignore-loader to handle .md files (prebid#1646)

* Auction module refactor (prebid#1644)

* Auction moduel refactor

* remove comment and global cbtimeout

* Config api updates (prebid#1633)

* Add timeoutBuffer, s2sconfig, bidderSequence to config

* Removing deprecated function and its unit test

* fixed linting errors

* Adapter/rubicon bid adapter markup (prebid#1674)

* initial take on rubiconBidAdapter markup

* formatting

* formatting, cont.

* formatting, cont.

* Prebid 1.0 Fix issue with video bid validation (prebid#1680)

* Fix issue with video bid validation

* Modified tests to stub `auctionManager.getBidsRequested` instead of `getBidRequest`

* Move stub to beforeEach hook

* Fix lint errors

* Add bidRequests param to bid validation

* Auction module updated to support currency/hook (prebid#1733)

* added hook module to prebid core that allows extension of arbitrary functions

* remove unused dependency tiny-queue

* change PluginFunction to HookedFunction

* more hook documentation fixes

* Auction module updated to support currency/hook

* remove unused dependency tiny-queue

* change PluginFunction to HookedFunction

* more hook documentation fixes

* WIP

* allow context for hooked functions

* added tests for context

* remove withContext, just use bind

* fix in hooks so asyncSeries keeps proper bound context

* Unit test fixes

* Updated bid validation function

* Fixed video unit test

* updated sizeMapping to use sizeConfig and support labels (prebid#1772)

* updated sizeMapping to use sizeConfig and support labels

* added new tests for labels and sizes w/ sizeConfig when making auction

* made some names clearer and added type to labels for sizeMapping

* make error message more descriptive in adaptermanager

* remove extra line in adpatermanager

* update package.json with correct version. (prebid#1813)

* Unit test fixes for IE 10 and other old browsers (prebid#1810)

* Added fix for location.origin

* Fixed test case failing in IE and Safari browsers

* Added utils.getOrigin method

* Updated renderer to use hooks

* Rename appnexusAst adapter to appnexus adapter (prebid#1848)

* Renamed appnexusAst adapter to appnexus

* Updated unit test to use appnexus bidderCode

* Remove completed todo comment

* fixed safeframe for 1.0 (prebid#1834)

* Emit array of objects from BID_TIMEOUT event (prebid#1824)

* Emit array of objects from BID_TIMEOUT event

* requestId is now auctionId

* Use v4 UUID to match previous requestId format

* Move function

* Move public winningBids to auction (prebid#1828)

* Move public winningBids to auction

* removed _winningBids

* removed _winningBids

* bugfix: return only new bids

* Updates for PubWise Prebid 1.0 Support (prebid#1847)

* Updates for Prebid 1.0 Support

* Updates for Bug Fixes and a small refactor

* update JSDoc comment. Remove trailing space (prebid#1872)

tests were failing due to no trailing space eslint rule.

* Prebid 1.0 adxcg analytics adapter fix for bidtimeout event (prebid#1871)

* adxcg analytics adapter for 1.0 bidtimeout event

* update tests for adxcg analytics 1.0

* Prebid 1.0 prebid server (prebid#1846)

* fix adaptermanager s2sTest unit tests

* fix s2s log message

* remove errant comment

* fixed log statement

* removed seemingly unnecessary call to transformHeightWidth(adUnit);

* removed legacy sizeMapping code block

* initial refactor of prebidServerBidAdapter working w/o tests

(cherry picked from commit 2b843d0)

* add transformSizes back for prebidServer adUnits to fix request

* fixed adapterManager_spec tests

* added prebidServerBidAdapter tests for 1.0

* fixed lint errors

* make sure addBidResponse and doneCb are stubbed for s2s calls

* s2s requests now firing BID_REQUESTED event

* fixed commented tests and other minor fixes

* update defaults in prebidServerBidAdapter and fix doBidderSync bug

* add new API for setting defaults in config for modules

* Targeting updates (prebid#1689)

* Cherry pick alias bidder

* Cherry pick alias bidder

* Cherry pick alias bidder

* Updated test case to not import adapter

* targeting updates

* targeting functions refactoring

* Refactored functions

* more refactor of function

* added jsdoc and some more refactor

* check bid expiry and filtering used bids

* make sure we have the right version

* Update version to fix invalid semver

* video bug fix (prebid#1906)

* video bug fix
added required params to prebidServerAdapter

* Emitted auction_end and updated ttl for prebidServer

* fix logging of server adapters

* Manually merge bidManager code to auction module (prebid#1905)

* Unit test fix in IE for adxcgAnalytics Adapter (prebid#1929)

* IE bug fix

* get only unique bidders

* added log message for xhr timeout (prebid#1928)

* remove polyfill.js and remove global polyfills (prebid#1918)

* remove polyfill.js and remove global polyfills

* make sure find, findIndex, and includes use core-js in tests

* switch from virtual function bind core-js to explicit usage.

* remove transform-function-bind babel plugin

* Replace usePrebidCache with cache:url and remove default (prebid#1904)

* replace usePrebidCache with video:cacheUrl and remove default

* remove newConfig in dfpAdServerVideo_spec that isn't doing anything

* change video.cacheUrl to cache.url

* update to cache.url in auction and remove from adapter

* pulsepointLiteBidAdapter renamed to pulsepointBidAdapter (prebid#1931)

* ET-1691: Pulsepoint Analytics adapter for Prebid. (#1)

* ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter

* ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter

* ET-1691: cleanup

* ET-1691: minor

* ET-1691: revert package.json change

* Adding bidRequest to bidFactory.createBid method as per prebid#509

* ET-1765: Adding support for additional params in PulsePoint adapter (#2)

* ET-1850: Fixing prebid#866

* Minor fix

* Adding mandatory parameters to Bid

* Pulsepoint adapter changes

* readme updates

* add 'x_source.tid' to rubicon requests (prebid#1933)

* Bring in pre-1.0 native-image asset adapter change (prebid#1934)

* 33Across Adapter: Removed the usage of utils library (prebid#1917)

* Removed the usage of utils library to get bidder requests during userSync since this info will now be passed into the method

* Fixed extra space which cause lint to fail

* Implemented user sync per code review feedback in prebid#1917

* Minor feedback changes

* Re-instated lint check for all files which was accidentally commited after testing

* Prebid 1.0 server cache (prebid#1935)

* add cache stuff to video for prebid server

* add description for cacheMarkup
@robertrmartinez robertrmartinez deleted the prebid-1.0-prebidServer branch July 5, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants