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

New Adapter: bidglass #3861

Merged
merged 3 commits into from
Jun 25, 2019
Merged

New Adapter: bidglass #3861

merged 3 commits into from
Jun 25, 2019

Conversation

dliebner
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • [x ] 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

Added the bidglass adapter + tests

  • test parameters for validating bids
{
  bidder: 'bidglass',
  params: {
    'adUnitId': '-1'
  }
}

Be sure to test the integration with your adserver using the Hello World sample page.

For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:

Other information

@bretg
Copy link
Collaborator

bretg commented May 28, 2019

Docs PR prebid/prebid.github.io#1328

Copy link
Contributor

@sumit116 sumit116 left a comment

Choose a reason for hiding this comment

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

Hi,
Thanks for submitting your adaptor. I tested your adaptor on hello-world page and found functionality working fine. But you haven't added any definition to functions like getUserSyncs(), onTimeout(), onBidWon() and onSetTargeting(). Would you want to add something to them, may be just a log.

Also, the unit test coverage is slightly below the required criteria of 80% (its 79.xx %), can you add a few more tests for the same.

Can you please make the minor changes I have mentioned, and let me know if you have any questions.

Thanks.

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

Choose a reason for hiding this comment

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

the formal params are missing here. Can you please add some code, may be just a log in function definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking the time to review our adapter! We've made the updates as requested. One question - is there a gulp (or other) command to check the coverage for an individual bidder's unit tests?

A note regarding the empty function definitions - we don't plan on using getUserSyncs, onTimeout, onBidWon, or onSetTargeting to any practical effect in the near future.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the update. You can use gulp test-coverage, and then gulp view-coverage to view unit test-coverage of any adaptor file. The view command will open coverage on http://localhost:1999/, where you can navigate to your file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

- Added formal params to getUserSyncs function definition
- getUserSyncs now always returns an array
- Improved unit test coverage
@sumit116
Copy link
Contributor

Tested the adaptor on hello_world page and all unit tests have passed. Test coverage of the adaptor is 80%. The changes are working well against all parameters listed in https://github.com/prebid/Prebid.js/blob/master/PR_REVIEW.md, hence approving the PR.

@sumit116 sumit116 requested review from jaiminpanchal27 and sumit116 and removed request for sumit116 June 13, 2019 09:12
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.

@dliebner Please see comments.

* @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.

getUserSyncs, onTimeout, onBidWon and onSetTargeting are all optional. You can remove from the spec if you do not plan to use these features

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks.

*/

let imps = [];
let getReferer = function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already pass this information in bidderRequest. Check http://prebid.org/dev-docs/bidder-adaptor.html#referrers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our rules for determining and reporting referer and origins vary slightly from prebid's built-in methods. We'd prefer to use our own methods for consistency's sake across our platform.

bidResponses.push({
requestId: bid.requestId,
cpm: parseFloat(bid.cpm),
width: parseInt(bid.width),
Copy link
Collaborator

Choose a reason for hiding this comment

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

parseInt takes two parameters string and radix. I would suggest to add radix as it does not default to 10 and may return unexpected results.
More info here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt and interesting article on parseInt https://medium.com/dailyjs/parseint-mystery-7c4368ef7b21

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, good call.

* @return {Bid[]} An array of bids which were nested inside the server.
*/
interpretResponse: function(serverResponse) {
// const serverBody = serverResponse.body;
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove dead code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do. Commit pending.

- Removed unused methods: getUserSyncs, onTimeout, onBidWon,
onSetTargeting
- Removed getUserSyncs unit test
- Removed "dead code"
- Removed some unnecessary comments
- Fixed usage of parseInt
@dliebner
Copy link
Contributor Author

Hey, is there anything else you need from us here?

@jaiminpanchal27 jaiminpanchal27 merged commit 9d2f06c into prebid:master Jun 25, 2019
VideoReach pushed a commit to VideoReach/Prebid.js that referenced this pull request Aug 1, 2019
* Added bidglass adapter + test

* PR Review Updates:

- Added formal params to getUserSyncs function definition
- getUserSyncs now always returns an array
- Improved unit test coverage

* PR Review Updates:

- Removed unused methods: getUserSyncs, onTimeout, onBidWon,
onSetTargeting
- Removed getUserSyncs unit test
- Removed "dead code"
- Removed some unnecessary comments
- Fixed usage of parseInt
sa1omon pushed a commit to gamoshi/Prebid.js that referenced this pull request Nov 28, 2019
* Added bidglass adapter + test

* PR Review Updates:

- Added formal params to getUserSyncs function definition
- getUserSyncs now always returns an array
- Improved unit test coverage

* PR Review Updates:

- Removed unused methods: getUserSyncs, onTimeout, onBidWon,
onSetTargeting
- Removed getUserSyncs unit test
- Removed "dead code"
- Removed some unnecessary comments
- Fixed usage of parseInt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants