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: Kobler #3904

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

New Adapter: Kobler #3904

wants to merge 16 commits into from

Conversation

TommyHPettersen
Copy link

* New Adapter: Kobler
Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, c65ede1

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:26:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:35:	MakeRequests		85.7%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:67:	MakeBids		100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:98:	getEndpoint		100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:106:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:121:	convertImpCurrency	100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:135:	contains		50.0%
total:									(statements)		92.2%

@bsardo bsardo self-assigned this Sep 20, 2024
@TommyHPettersen
Copy link
Author

Hello @bsardo @przemkaczmarek, what can I expect as an estimate for merging this, and is there anything I can contribute with to move this forward?

@przemkaczmarek przemkaczmarek self-requested a review October 7, 2024 12:47
Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, c9a87a6

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:26:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:35:	MakeRequests		87.5%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:70:	MakeBids		100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:101:	getEndpoint		100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:109:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:124:	convertImpCurrency	100.0%
github.com/prebid/prebid-server/v2/adapters/kobler/kobler.go:138:	contains		50.0%
total:									(statements)		92.5%

@TommyHPettersen
Copy link
Author

@przemkaczmarek Hello, is there anything blocking this for a second reviewer and is there anything I can do to help speed this process up?

@przemkaczmarek przemkaczmarek requested a review from bsardo October 21, 2024 07:58
przemkaczmarek
przemkaczmarek previously approved these changes Oct 21, 2024
@TommyHPettersen
Copy link
Author

Thank you for the review so far. @bsardo When do you think you have time to review this?

@bsardo
Copy link
Collaborator

bsardo commented Nov 4, 2024

Hi @TommyHPettersen, I'll give this a look as soon as the following is addressed.

We recently released PBS 3.0, more specifically v3.1.0, which updates Prebid Server package import references throughout the project from v2 to v3.
For example:

import (
    "github.com/prebid/prebid-server/v3/adapters"
)

As a result, please merge with master (no rebase) and then ensure all Prebid Server package import references in the files you’ve changed are v3 such that the test suite passes so we can resume reviewing. Thanks!

Copy link

github-actions bot commented Nov 5, 2024

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, a18ec12

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:26:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:35:	MakeRequests		87.5%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:70:	MakeBids		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:101:	getEndpoint		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:109:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:124:	convertImpCurrency	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:138:	contains		50.0%
total:									(statements)		92.5%

@TommyHPettersen
Copy link
Author

Thank you for the response @bsardo, i have now updated all the package imports to v3 and the test suite passes.

Hope this helps!

przemkaczmarek
przemkaczmarek previously approved these changes Nov 5, 2024
adapters/kobler/kobler.go Outdated Show resolved Hide resolved
adapters/kobler/kobler.go Outdated Show resolved Hide resolved
adapters/kobler/kobler.go Outdated Show resolved Hide resolved
adapters/kobler/kobler.go Outdated Show resolved Hide resolved
func (a adapter) getEndpoint(request *openrtb2.BidRequest) string {
if request.Test == 1 {
return a.devEndpoint
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't seen this behavior before. Why do you require a separate endpoint for test requests?

Choose a reason for hiding this comment

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

We have a test campaign in our DEV environment that's set to bid on a specific article. For this to work, we have to do some manual manipulation of the article in our system and this is easier to do in the DEV environment.

This is the same as for our Prebid.js adapter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO it's good to add some comments:
// Use a separate endpoint for testing purposes in the DEV environment.
// Required due to Kobler's internal test campaign setup.
because: Introducing a separate endpoint (devEndpoint) for test requests is unusual in Prebid Server, since standard tests use the same endpoint as the production environment.

Copy link
Author

Choose a reason for hiding this comment

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

@przemkaczmarek I have added this now, thank you!

adapters/kobler/kobler.go Outdated Show resolved Hide resolved
"description": "A schema which validates params accepted by the Kobler adapter",
"type": "object",

"properties": {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, how do map impressions to your system without any kind of identifier?

Choose a reason for hiding this comment

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

Since we're a contextual platform, we identify placements from the combination of the article URL and the allowed sizes. Both of these are always present without having to add any other identifier.

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, a67d266

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:36:	MakeRequests		87.5%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:71:	MakeBids		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:102:	getEndpoint		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:110:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:125:	convertImpCurrency	100.0%
total:									(statements)		95.9%

@TommyHPettersen
Copy link
Author

Thank you @SyntaxNode and @przemkaczmarek for the reviews, hoping we can get this merged soon as this PR has been open for a while!

@TommyHPettersen
Copy link
Author

Hello @VeronikaSolovei9, we have been waiting for this PR to be merged for 3 months and as far as I understand you guys have been updating to v3 in that time which might have blocked a lot of PRs, is there anything else I can do here to help get this PR merged? Thank you!

Copy link

github-actions bot commented Dec 9, 2024

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, e6b4eeb

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:36:	MakeRequests		87.5%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:71:	MakeBids		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:104:	getEndpoint		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:112:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:127:	convertImpCurrency	100.0%
total:									(statements)		95.9%

// Use a separate endpoint for testing purposes in the DEV environment.
// Required due to Kobler's internal test campaign setup.
func (a adapter) getEndpoint(request *openrtb2.BidRequest) string {
if request.Test == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed this with the team and decided request.test is not the best place to control the URL.
Instead we propose to add a test flag to imp[].ext.prebid.bidder.kobler or request.imp[].ext.kobler locations (they are equivalent).
With this approach this flag will be encapsulated to Kobler adapter only.
To make it work you will need to add an optional property to kobler.json, define imp_kobler.go and handle it in adapter code accordingly.
For the reference, please see missena.json, ExtImpMissena and usages of TestMode flag.

Copy link
Author

Choose a reason for hiding this comment

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

Okay thank you, I have now added a similar solution to our server adapter here

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, aba06b9

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:36:	MakeRequests		80.6%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:103:	MakeBids		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:134:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:149:	convertImpCurrency	100.0%
total:									(statements)		90.2%

package openrtb_ext

type ExtImpKobler struct {
Test *bool `json:"test"`
Copy link
Contributor

@VeronikaSolovei9 VeronikaSolovei9 Dec 12, 2024

Choose a reason for hiding this comment

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

No need to declare it as a pointer. Dafault value for bool is false.
Modify it to non-boolean and then just assign it without nil check: testMode = impExt.Test
Please keep in mind that if a request has more than one imp then testMode will have a value from the last impression.

Copy link
Author

Choose a reason for hiding this comment

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

I also check i == 0, so it should only be for the first imp we do this parsing.

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, c51b0e5

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:36:	MakeRequests		80.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:101:	MakeBids		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:132:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:147:	convertImpCurrency	100.0%
total:									(statements)		90.0%

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, cf56a4d

kobler

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:36:	MakeRequests		80.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:101:	MakeBids		100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:132:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/kobler/kobler.go:147:	convertImpCurrency	100.0%
total:									(statements)		90.0%

Copy link
Contributor

@VeronikaSolovei9 VeronikaSolovei9 left a comment

Choose a reason for hiding this comment

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

Thank you for the changes. LGTM

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.

6 participants