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

Reload Adapter: New #3812

Merged
merged 5 commits into from
May 15, 2019
Merged

Reload Adapter: New #3812

merged 5 commits into from
May 15, 2019

Conversation

mafernandez80
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

  • test parameters for validating bids
bidder: 'reload',
params: {
        plcmID: "prebid_check",
        partID: "part_4",
        opdomID: "0",
        bsrvID: 0
    }

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.

@mafernandez80 Needs some changes before we can merge your adapter. Please address comments


export const spec = {
code: BIDDER_CODE,
aliases: [],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove aliases property if you are not creating any alias

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

export const spec = {
code: BIDDER_CODE,
aliases: [],
supportedMediaTypes: [BANNER],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Banner is default format. Please remove supportedMediaTypes property if you are only supporting banner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

*/
buildRequests: function (validBidRequests, bidderRequest) {

var vRequests = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use let/const where applicable. We recommend using ES6. Please update at other places as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

* @param {ServerResponse[]} serverResponses List of server's responses.
* @return {UserSync[]} The user syncs which should be dropped.
*/
getUserSyncs: function (syncOptions, serverResponses) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove if you are not using getUserSyncs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

* Register bidder specific code, which will execute if bidder timed out after an auction
* @param {data} Containing timeout specific data
*/
onTimeout: function (data) {},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove if you are not using onTimeout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

* Register bidder specific code, which will execute if a bid from this bidder won the auction
* @param {Bid} The bid that won the auction
*/
onBidWon: function (bid) {},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove if you are not using onBidWon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

*/
onBidWon: function (bid) {},

onSetTargeting: function (bid) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove if you are not using onSetTargeting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

* @param {json} args
*/

function ReloadClientTool(args) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this function do ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a class constructor. It is used to instantiate an interface class that we must use to have a single standard across all our adapters/drivers.


var that = this;


Copy link
Collaborator

Choose a reason for hiding this comment

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

Lot of unnecessary line breaks throughout the file. Please remove them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,300 @@
import { expect } from 'chai';
import { spec } from 'modules/reloadBidAdapter';
import { newBidder } from 'src/adapters/bidderFactory';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unused imports. Following are not used in your test file anywhere

import { newBidder } from 'src/adapters/bidderFactory';
import * as bidderFactory from 'src/adapters/bidderFactory';
import { deepClone } from 'src/utils';
import { config } from 'src/config';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@jaiminpanchal27
Copy link
Collaborator

@mafernandez80 Circleci failed due to lint errors. You can fix and check on local by running gulp lint

@mafernandez80
Copy link
Contributor Author

@jaiminpanchal27 I executed your command but lint ran ok.
Steps:
1.- Clone repository
2.- npm install
3.- copied our adapter & spec
4.- gulp lint

@jaiminpanchal27
Copy link
Collaborator

Yes, same happened for me too. Actually on running gulp lint, it autofixex the files. So if you now do git status, it will show you changes to commit.
To ignore autofixes run gulp lint --nolintfix

@mafernandez80
Copy link
Contributor Author

@jaiminpanchal27 I fixed all lint errors

@mafernandez80
Copy link
Contributor Author

@jaiminpanchal27 I see that there is a new release but our adapter has not been included. Is there anything still to be fixed? We really need this ASAP to start our tests. Thnx!

@jaiminpanchal27
Copy link
Collaborator

@mafernandez80 We release every Tuesday. It will be included in next release. I understand your urgency but one of my colleague had already started work on the release since morning.

I will test your params on hello world page and let you know if anything more is needed. Code looks good.

@jaiminpanchal27
Copy link
Collaborator

@mafernandez80 I am not getting valid bid back from your adapter. Here is the response from your endpoint. I used the params given in reloadBidAdapter.md file on Prebid hello_world page.

{"id":"5355660366943247","bidid":"fbs-br-d3jbibjgjvpcy1fs","seatbid":[{"bid":[{"id":"fbs-br-stbd-bd-d3jbibjgjvpcy1fu","impid":"2e4c0d6ff12ee4","crid":"2e4c0d6ff12ee4","price":0,"nurl":"","adm":"","ext":{"pcmdata":{},"error":{"msg":"Cannot read property 'fireEvent' of undefined","stack":"TypeError: Cannot read property 'fireEvent' of undefined\n    at fireUnderFilterString_Algo (/bidserver/BidServer/lib/proxy/v2.25/pcm_bundle.js:6323:26)\n    at fireUnderFilterString (/bidserver/BidServer/lib/proxy/v2.25/pcm_bundle.js:6319:9)\n    at _fireEventX (/bidserver/BidServer/lib/proxy/v2.25/pcm_bundle.js:6315:7)\n    at _fireEvent (/bidserver/BidServer/lib/proxy/v2.25/pcm_bundle.js:6329:7)\n    at _fb_PCM (/bidserver/BidServer/lib/proxy/v2.25/pcm_bundle.js:5891:5)\n    at _makePCMCall (/bidserver/BidServer/lib/engine/pcmengine.js:255:16)\n    at Object.callback (/bidserver/BidServer/lib/engine/pcmengine.js:99:15)\n    at Client.memcached.delegateCallback (/bidserver/BidServer/node_modules/memcached/lib/memcached.js:687:12)\n    at Client.rawDataReceived (/bidserver/BidServer/node_modules/memcached/lib/memcached.js:758:22)\n    at Client.BufferBuffer (/bidserver/BidServer/node_modules/memcached/lib/memcached.js:678:12)\n    at Socket.bowlofcurry (/bidserver/BidServer/node_modules/memcached/lib/utils.js:126:15)\n    at Socket.emit (events.js:193:13)\n    at Socket.EventEmitter.emit (domain.js:481:20)\n    at addChunk (_stream_readable.js:295:12)\n    at readableAddChunk (_stream_readable.js:272:13)\n    at Socket.Readable.push (_stream_readable.js:231:10)\n    at TCP.onStreamRead (internal/stream_base_commons.js:150:17)"},"plcmID":"4234897234","partID":"part_2","opdomID":0,"bsrvID":0,"banner":{"w":300,"h":250}}}],"seat":"fbs-br-stbd-d3jbibjgjvpcy1ft","group":0}]}

@mafernandez80
Copy link
Contributor Author

@jaiminpanchal27 I pasted test parameters when I created this pull request:
...
bidder: 'reload',
params: {
plcmID: "prebid_check",
partID: "part_4",
opdomID: "0",
bsrvID: 0
}
...

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.

LGTM.

@jaiminpanchal27
Copy link
Collaborator

Verified bids back with the params provided in PR description. Please update your test params in reloadBidAdapter.md file so I can merge your adapter.

@mafernandez80
Copy link
Contributor Author

@jaiminpanchal27 I updated test params with PR test.

@jaiminpanchal27 jaiminpanchal27 merged commit 3b9f9e1 into prebid:master May 15, 2019
VideoReach pushed a commit to VideoReach/Prebid.js that referenced this pull request Aug 1, 2019
* Reload Adapter: New

* Reload Adapter - Spec

* Reload Adapter and Spec - Changes according comments

* Reload Adapter & Spec: lint errors fixed

* Reload Adapter: Example updated
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

Successfully merging this pull request may close these issues.

2 participants