Skip to content

Add bucksense Adapter #3785

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

Merged
merged 5 commits into from
May 7, 2019
Merged

Conversation

bkse-stefanodechicchis
Copy link
Contributor

Type of change

  • [X ] New bidder adapter

Description of change

This is first release for Bucksense Adapter

  • test parameters for validating bids
{
  bidder: 'bucksense',
  params: {
    placementId : 1000
  }
}

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

  • contact email of the adapter’s maintainer ([email protected])
  • [ X] official adapter submission

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 Apr 29, 2019

docs PR prebid/prebid.github.io#1284

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Hi @bkse-stefanodechicchis

Thanks for submitting this adapter. I took a look through the changes, and there are a few things that need to be addressed. Please take at the notes below when you have the chance and let me know if you have any questions. Thanks!

General point:

  • The code coverage for the unit tests only reach 56.45%. For adapters, we'd want this to be at least 80% coverage. Can you add some more unit tests to fill the gaps? You can use the gulp test-coverage and gulp view-coverage in your prebid project to review the missing areas. Alternatively - you could remove some the empty functions from your adapter; this could help reduce the coverage gap (see comments below for the specific areas related to this point).

@@ -0,0 +1,171 @@
import { registerBidder } from 'src/adapters/bidderFactory';
import { BANNER } from 'src/mediaTypes';
Copy link
Collaborator

Choose a reason for hiding this comment

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

In lieu of this PR #3435, any imported files within a modules file needs to use the relative style path.

Can you please update these imports accordingly?

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 with new Push

* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bid) {
if (isNaN(bid)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The bid param is an object at this stage of the code, so this if statement check will always return true and cause the bidRequest for your bidder to be considered invalid.

Can you review this logic and adjust it accordingly?

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 with new Push

data: {
'pub_id': location.host,
'pl_id': bid.params.placementId,
'sys_href': encodeURI(location.href),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you haven't already looked at it, there are a set of data points you can use in your adapter to get information on the webpage loading the adapter. Please see the link below and consider using them if they would fit your needs:
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.

Thanks for point to this but in this release we would like to keep using the location object if it is not a problem

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

Is this code still a work-in-progress?

If not and you're not planning to support userSyncs (at least at this time) - you can just remove this function entirely from your adapter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

function not needed on this release, we removed.

* @param ...
* @return ...
*/
onTimeout: function(timeoutData) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to the getUserSyncs function - you can remove this function if you're not planning to use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

function not needed on this release, we removed.

* @param {object} bid The bid to validate.
* @return ...
*/
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.

Similar to the getUserSyncs function - you can remove this function if you're not planning to use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

function not needed on this release, we removed.


const WHOIS = 'BKSHBID-008';
const BIDDER_CODE = 'bucksense';
const URL = 'https://prebid.bksn.se:445/prebid';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the correct endpoint URL for your adapter?

When I tried to test the adapter, the POST requests to this URL were resulting in a 301 Moved Permanently response.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes request is doing a 301 but then got redirect to the script that return the BID. I have tested the prebid on the Hello World example. Let me know if you do not see the response at all from your test.

@jsnellbaker
Copy link
Collaborator

Hi @bkse-stefanodechicchis, Thanks for making the updates.

I retested the adapter and was now able to see the bid return and render successfully.

However, when I reran the coverage tests - the adapter is still below the ideal; it's at 72% currently.
Can you put together some additional unit tests to fill in the gaps?

Also can you update the various console.log statements in the adapter file to use theutils.logInfo() function instead? This function would categorize/brand the messages in the console that they're part of Prebid and would be more ideal to use.

We should be good to merge once these last few items are addressed. Thanks.

@bkse-stefanodechicchis
Copy link
Contributor Author

I'm struggling to increase the percentage of testing.
Screen Shot 2019-05-03 at 4 12 47 PM

My specs file already test all the 4 functions that are in the Adapter, so I thought I would add more scenarios to check in each function, but if II added some more and I don't see the % going up, so I think I'm in the wrong direction.
I appreciate any suggestions/help on what I'm doing wrong
Thanks

@jsnellbaker
Copy link
Collaborator

Hi @bkse-stefanodechicchis

Just to clarify, you are looking at your specific adapter's coverage rate correct? It's inside the modules sub-folder in that initial screen. See below for example:

Screen Shot 2019-05-06 at 8 25 44 AM

From what I can see (currently with what has been committed), the outstanding areas all relate to the bksdebug param.

If you setup a pair of tests where that field is enabled (one for requestBids and one for interpretResponse) and swap out the console.log with utils.logInfo - you could create a stub of the utils.logInfo function and run your checks against that stub (ie check for the called property is true for example). These new tests should help fill the gap.

- removed console.log and using utils.logInfo();
- removed bksdebug params;

pending issue:
- gulp test-coverage still under 80%
@bkse-stefanodechicchis
Copy link
Contributor Author

I just commit a new version, I removed the console.log and use utils.logInfo.
I'm not able to reach the 80% coverage I also removed the bksdebug param and added some more use case but the % just not moving up.

I look at the file from the gulp view-coverage
image
and I'm try to figure out why some IF or ELSE get a flag

@jsnellbaker
Copy link
Collaborator

Hi @bkse-stefanodechicchis I checked out your updates to the adapter test cases. I'm seeing your adapter coverage at 94% now (see below):
Screen Shot 2019-05-07 at 10 15 17 AM

Are you not seeing the same thing? If you're happy with how your adapter is handling certain scenarios (this is in reference to your last comment on the if/else statements in the interpretResponse), we should be okay to merge the PR.

Please let me know when you have the chance.

@bkse-stefanodechicchis
Copy link
Contributor Author

Hi, I get confuse I was looking at column "Branches" and the % was low there.
Anyway we are good in our side, so ready for the merge from our point of view.
Thanks

@jsnellbaker jsnellbaker merged commit 10ec9a5 into prebid:master May 7, 2019
jacekburys-quantcast pushed a commit to jacekburys-quantcast/Prebid.js that referenced this pull request May 15, 2019
* Add bucksense Adapter

* fixed first revision for new Bucksense adapter approval
https://circleci.com/gh/prebid/Prebid.js/2365?

* fixed second revision for new Bucksense adapter approval from jsnellbaker
prebid#3785

* fixed third revision for new Bucksense adapter approval.
prebid#3785

* fixed 4th revision from jsnellbaker
- removed console.log and using utils.logInfo();
- removed bksdebug params;

pending issue:
- gulp test-coverage still under 80%
VideoReach pushed a commit to VideoReach/Prebid.js that referenced this pull request Aug 1, 2019
* Add bucksense Adapter

* fixed first revision for new Bucksense adapter approval
https://circleci.com/gh/prebid/Prebid.js/2365?

* fixed second revision for new Bucksense adapter approval from jsnellbaker
prebid#3785

* fixed third revision for new Bucksense adapter approval.
prebid#3785

* fixed 4th revision from jsnellbaker
- removed console.log and using utils.logInfo();
- removed bksdebug params;

pending issue:
- gulp test-coverage still under 80%
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.

4 participants