-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Sovrn 1.0 compliance #1796
Sovrn 1.0 compliance #1796
Conversation
…sReceived in Sovrn adapter and Sovrn tests.
… this is the stated standard for Prebid 1.0.0.
…son', as this is the stated standard for Prebid 1.0.0." This reverts commit 0338ce7.
…a the ServerRequest object.
…ig for GET requests. Added test for this second change and removed tests for passing null or undefined member variables into the request.options object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updated adapter. Please also add your .md file in this PR: http://prebid.org/dev-docs/bidder-adapter-1.html#planning-your-adapter
Thanks, I'll get that put together. As far as the test ad unit that returns test creatives, does this need to be able to serve on any site? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tedrand We run test from localhost
so if the test creatives serve from there that's fine. We can also rewrite localhost to a specific domain if needed, if that's the case just make sure to add a note about this to the .md file. In any case I was able to receive bids with my usual setup and your test parameters so that part is good. A few changes requested before merging:
Sovrn's adapter integration to the Prebid library. Posts plain-text JSON to the /rtb/bid endpoint. | ||
|
||
# Test Parameters | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line and line 46 should mark the code with ```
import { expect } from 'chai'; | ||
import { spec } from 'modules/sovrnBidAdapter'; | ||
import { newBidder } from 'src/adapters/bidderFactory'; | ||
import { REPO_AND_VERSION } from 'src/constants'; | ||
import bidmanager from 'src/bidmanager'; | ||
import adloader from 'src/adloader'; | ||
var utils = require('src/utils'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bidmanager
, adloader
, and utils
modules aren't used in the new test, can be removed
modules/sovrnBidAdapter.js
Outdated
seatbid[0].bid.map(sovrnBid => { | ||
sovrnBidResponses.push({ | ||
requestId: sovrnBid.impid, | ||
bidderCode: spec.code, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bidderCode
will be set automatically by bidderFactory
now, this line can be dropped
modules/sovrnBidAdapter.js
Outdated
* @param {id, seatbid} sovrnResponse A successful response from Sovrn. | ||
* @return {Bid[]} An array of formatted bids. | ||
*/ | ||
interpretResponse: function({id, seatbid}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1748 changed the first argument of interpretResponse
to:
{
body: responseBody,
headers: {
get: function(header) { /* returns a header from the HTTP response */ }
}
}
so destructuring like
{body: {id, seatbid}}
or however you'd prefer to grab the body
, and updating corresponding tests should get this back to working properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @matthewlane for the info here. Just so I am on the same page, destructuring as you have suggested will lead to the same functionality as what we currently have implemented? I am just making sure that we do not have to change the bid response's JSON structure on our end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, updating in this way will give the same functionality as before #1748 was merged to master, and there are no changes required to the JSON structure sent from your endpoint.
For a (non-destructuring) example, appnexusAst was updated here to pick the response data off the body
property. Before #1748 we used the first parameter directly. This update lets us keep working properly and no changes were made to our endpoint because behind the scenes it's the same data coming through, just on the body
property of the first parameter rather than the first parameter itself now.
Let me know if you have more questions, and I'll verify the change works whenever the PR is updated
src/adapters/bidderFactory.js
Outdated
@@ -66,6 +66,7 @@ import { logWarn, logError, parseQueryStringParameters, delayExecution } from 's | |||
* @property {('GET'|'POST')} method The type of request which this is. | |||
* @property {string} url The endpoint for the request. For example, "//bids.example.com". | |||
* @property {string|object} data Data to be sent in the request. | |||
* @property {object} options Content-Type set in the header of the bid request, overrides default 'text/plain'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed changes to core modules are welcome but should be made in a separate PR. Also calls from 1.0 bidders will have contentType: 'text/plain'
set by default, so needing to set options: {contentType: 'text/plain'}
on the object returned by your buildRequests
function is unnecessary I believe?
Edit: oh this is already in master via #1681? GitHub shows these files as changed for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sorry I couldn't figure out why that was happening either.
…rn-1.0-compliance
… into 'interpretResponse'. Updated README and tests per PR review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. The package.json and package-lock.json changes should be dropped from the PR though then we're good for merge
package-lock.json
Outdated
@@ -0,0 +1,16925 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File should be dropped from PR
package.json
Outdated
@@ -43,7 +43,7 @@ | |||
"eslint-plugin-standard": "^3.0.1", | |||
"faker": "^3.1.0", | |||
"fs.extra": "^1.3.2", | |||
"gulp": "^3.8.7", | |||
"gulp": "^3.9.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to check the version upgrade in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
darn sorry! i will roll those back
this should be good now, I think |
…hese files are not affected for this PR.
@tedrand Can you delete the If you're able to do this within the next three hours that'd be great as we're releasing today, if not I'll do a manual merge to still get it in, but would prefer doing it from GitHub |
* unstream/master: (36 commits) + Add Optimatic Bid Adapter (prebid#1837) Add Bridgewell adapter (prebid#1825) Kumma adapter updated for Prebid 1.0 (prebid#1766) Touchup add bid response (prebid#1822) Fix skipped test (prebid#1836) Added new size in Rubicon pbjs Adapter (prebid#1842) HuddledMasses header bidding adapter (prebid#1806) Increment pre version Prebid 0.33.0 Release Update AOL adapter for v1.0 (prebid#1693) Sovrn 1.0 compliance (prebid#1796) Platform.io Bidder Adapter update (prebid#1817) Drop non-video bidders from video ad units (prebid#1815) Update renderAd to replace ${AUCTION_PRICE} in adUrl (prebid#1795) Pulsepoint adapter: fixing bid rejection due to missing mandatory bid params. (prebid#1823) Remove require.ensure entirely (prebid#1816) Add custom keyword support for pbs bid adapter (prebid#1763) OpenX Video Adapter update to Prebid v1.0 (prebid#1724) Fix test that hard-coded pbjs global. (prebid#1786) Update Pollux Adapter to v1.0 (prebid#1694) ...
….33.0 to aolgithub-master * commit '3e9756098bb20ecbe0314f16eed5298c5675b24c': (32 commits) Wrapped content type in options object. Added partners ids. Added changelog entry. Prebid 0.33.0 Release Update AOL adapter for v1.0 (prebid#1693) Sovrn 1.0 compliance (prebid#1796) Platform.io Bidder Adapter update (prebid#1817) Drop non-video bidders from video ad units (prebid#1815) Update renderAd to replace ${AUCTION_PRICE} in adUrl (prebid#1795) Pulsepoint adapter: fixing bid rejection due to missing mandatory bid params. (prebid#1823) Remove require.ensure entirely (prebid#1816) Add custom keyword support for pbs bid adapter (prebid#1763) OpenX Video Adapter update to Prebid v1.0 (prebid#1724) Fix test that hard-coded pbjs global. (prebid#1786) Update Pollux Adapter to v1.0 (prebid#1694) PubMatic adapter (prebid#1707) Added sizes to Rubicon Adapter (prebid#1818) jsonpFunction name should match the namespace (prebid#1785) Adding 33Across adapter (prebid#1805) Unit test fix (prebid#1812) ...
sovrnImps.push(imp); | ||
sovrnImps.push({ | ||
id: bid.bidId, | ||
banner: { w: 1, h: 1 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tedrand Is this hardcoded as 1x1 because Sovrn knows the size based on the ID? It seems like the bid.sizes and bid.params.sizes properties will be totally ignored by the adapter. Is that correct?
@mkendall07 If that’s the case, then https://github.com/prebid/Prebid.js/blob/master/modules/sovrnBidAdapter.md should be updated to omit the sizes fields, right?
* Update Sovrn adapter. Add test coverage. Enable deal IDs. * HS-271: Avoid using private variables such as _bidsRequested and _bidsReceived in Sovrn adapter and Sovrn tests. * lint * Add bidfloor param to test. * changed post content-type in bidder factory to 'application/json', as this is the stated standard for Prebid 1.0.0. * Revert "changed post content-type in bidder factory to 'application/json', as this is the stated standard for Prebid 1.0.0." This reverts commit 0338ce7. * Changed method for altering contentType so that it is configurable via the ServerRequest object. * Altered PR to conform to change reviews. added unit tests. * Added comment to pass Trion adapter test. * Removed false-y check for request.options. Added request.options config for GET requests. Added test for this second change and removed tests for passing null or undefined member variables into the request.options object. * small optimization to request.options to remove extra object declaration. * Re-wrote the Sovrn bid adapter to be compliant with Prebid 1.0.0. * Pushed bugfix found during whatismyip beta test, and small refactor. * Added README for adapter with test ad units. * Adjusted Sovrn bid adapter to correspond to new JSON structure passed into 'interpretResponse'. Updated README and tests per PR review. * removed unneeded biddercode param in adapter and fixed JSON spacing on input. * Final updates to remove bidder code from expected response in unit tests. * Reversed changes made to package.json and package-lock.json so that these files are not affected for this PR. * Removed package-lock.json file.
Type of change
Description of change
Adjustments to Sovrn bid adapter to ensure compliance with Prebid 1.0.0.