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

Add support for multiple sizes #5626

Merged

Conversation

estavillo
Copy link
Contributor

Type of change

  • Feature

Description of change

Added support for multiple slot sizes

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

  • contact email of the adapter’s maintainer
  • official adapter submission

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

Other information

'sizes': [[0, 1], [2, 3], [4, 5], [6, 7]]
};

expect(spec.isBidRequestValid(bid)).to.equal(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not believe this tests the code change.

You'll need to probably build the requests spec.buildRequests and validate data.bf is present and looks correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a new unit test for this; thanks for calling that out :)

@@ -275,6 +275,9 @@ function buildRequests (validBidRequests, bidderRequest) {
}
if (params.inSlot) {
data.si = parseInt(params.inSlot, 10);
if (params.sizes) {
data.bf = params.sizes.map((i) => `${i[0]}x${i[1]}`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is a new thing, if you could please add this at least to your .md and make sure it is known it MUST be an array of size arrays like so: [[0, 1], [2, 3], [4, 5], [6, 7]]

Else, make this code catch bad input better so no exceptions are thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to md file and catching bad input better

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure you actually pushed the commits for this yet.

I do not see the md file update or any logic change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, just pushed again

@robertrmartinez robertrmartinez self-assigned this Aug 18, 2020
@stale
Copy link

stale bot commented Sep 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 2, 2020
@robertrmartinez
Copy link
Collaborator

@estavillo

Please update PR in order to keep it from auto closing.

@stale stale bot removed the stale label Sep 8, 2020
@estavillo estavillo force-pushed the AT-6613-gumgum-multiple-sizes branch 4 times, most recently from 79cb509 to 62e4ad0 Compare September 8, 2020 19:13
@@ -25,6 +25,18 @@ var adUnits = [
}
}
]
},{
code: 'test-div',
sizes: [[0, 1], [2, 3], [4, 5], [6, 7]],
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code change seems to be taking from params.sizes not adUnit.sizes

So I think the md file should have this inside the gumgum bidder params as an option.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If not intended to be in your markdown file, maybe it should be in the prebid docs?

Not required to have it here so I will still merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct; I removed this for now

};
sizes
const bidRequest = spec.buildRequests([request])[0];
expect(bidRequest.data.bf).to.equal('0x1,0x2');
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@robertrmartinez robertrmartinez left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@robertrmartinez
Copy link
Collaborator

Looks like there are some test issues.

Please take a look and fix them

'inSlot': '123',
'sizes': [[0, 1], [0, 2]]
};
sizes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Think you need to remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed :)

Copy link
Collaborator

@robertrmartinez robertrmartinez left a comment

Choose a reason for hiding this comment

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

fix _spec file please

@robertrmartinez robertrmartinez merged commit 0d3c632 into prebid:master Sep 8, 2020
BrightMountainMediaInc pushed a commit to BrightMountainMediaInc/Prebid.js that referenced this pull request Sep 14, 2020
add UT


UT

Co-authored-by: Estavillo <fernando@gumgum.com>
BrightMountainMediaInc pushed a commit to BrightMountainMediaInc/Prebid.js that referenced this pull request Sep 14, 2020
@lbenmore lbenmore deleted the AT-6613-gumgum-multiple-sizes branch January 4, 2022 17:28
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