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

RockYou Adapter: Added RockYou Adapter supporting Prebid 1.0 #1977

Merged
merged 3 commits into from
Jan 23, 2018

Conversation

cameronhotchkies
Copy link
Contributor

Type of change

  • [ X ] New bidder adapter

Description of change

Created a new bidder adapter for RockYou.

  • Test parameters for validating bids without vast player:
{
  bidder: 'rockyou',
  params: {
    placementId: '4322'
  }
}
  • Test parameters for validating bids requiring vast player (this assumes that mediaTypes: { video: {}} is set in the adUnit):
{
  bidder: 'rockyou',
  params: {
    placementId: '4307'
  }
}

@matthewlane matthewlane self-requested a review January 3, 2018 00:11
@matthewlane matthewlane self-assigned this Jan 3, 2018
Copy link
Collaborator

@matthewlane matthewlane left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, a few changes requested below

@@ -0,0 +1,403 @@
import { expect } from 'chai';
import chai from 'chai';
Copy link
Collaborator

Choose a reason for hiding this comment

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

This import isn't needed, line can be dropped

import { expect } from 'chai';
import chai from 'chai';
import { spec, internals } from 'modules/rockyouBidAdapter';
import { ROTATION_ZONE } from 'modules/rockyouBidAdapter';
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't used in the test, line can be dropped


let validCallbacks = ['LOAD', 'IMPRESSION', 'COMPLETE', 'ERROR'];

for (event in validCallbacks) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

event should probably be preceded with const or let

Copy link
Collaborator

@matthewlane matthewlane left a comment

Choose a reason for hiding this comment

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

LGTM. Build failures were due to issue on Travis side and tests pass locally.

@cameronhotchkies Please also submit a PR to the docs repo to add a file for your adapter to the bidders directory so your adapter's params will appear on the bidders page

@cameronhotchkies
Copy link
Contributor Author

Thank you.

Docs updated at https://github.com/prebid/prebid.github.io/pull/551/files

if (!utils.isEmpty(bidRequest.sizes)) {
// Currently only the first size is utilized
let firstSize = bidRequest.sizes[0];
width = firstSize[0];
Copy link
Member

Choose a reason for hiding this comment

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

this won't work if sizes is defined like [300,250]. You'll need to check for that condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to clarify, sizes can be List[List[X,Y]] or List[X,Y] ?

Copy link
Member

Choose a reason for hiding this comment

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

that's right. There's a helper function you can use: https://github.com/prebid/Prebid.js/blob/master/src/utils.js#L113

Sorry this is a pain. The core should handle this but it's hard to update because every adapter might be doing it differently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a problem. Is the "HxW" vs [H,W] format (as returned by the helper function) more universal?

Copy link
Member

Choose a reason for hiding this comment

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

I think so. But the [H,W] | [[H,W]] format is what DFP uses so that's what our external API looks like. The core should normalize this so each adapter doesn't have to.

@mkendall07
Copy link
Member

@cameronhotchkies
one small change and this can merge.

@mkendall07 mkendall07 merged commit 3e6f0fb into prebid:master Jan 23, 2018
@ghost ghost removed the in progress label Jan 23, 2018
Millerrok pushed a commit to Vertamedia/Prebid.js that referenced this pull request Jan 24, 2018
* 'master' of https://github.com/prebid/Prebid.js:
  Prebid 1.2.0 Release
  Use polyfilled includes method (prebid#2061)
  RockYou Adapter: Added RockYou Adapter supporting Prebid 1.0 (prebid#1977)
  Optimera Adapter for 1.0. (prebid#1961)
  Use cross-browser integer check (prebid#2058)
  Fix skipped test (prebid#2059)
  Support multiple media formats within a single ad unit (prebid#1991)
  pre1api module that allows use of deprecated pre1.0 API in Prebid 1.0 (prebid#1976)
  Colossus SSP header bidding adapter 1.0.0 (prebid#2029)
  InSkin Bidder Adapter (prebid#2016)
  Update adapter to prebid v1.0 (prebid#1908)
  PubMatic 1.0 adapter (prebid#2011)
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
…1977)

* RockYou Adapter: Added RockYou Adapter supporting Prebid 1.0

* RockYou Adapter: Removed extraneous imports, replaced a for loop w/ forEach for variable scoping.

* RockYou Adapter: Updated the size handling to allow for multiple size definitions to be handled successfully
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