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: Brave #2396

Merged
merged 7 commits into from
Jan 31, 2023
Merged

New Adapter: Brave #2396

merged 7 commits into from
Jan 31, 2023

Conversation

thebraveio
Copy link
Contributor

No description provided.

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.

LGTM!

@@ -0,0 +1,98 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Super nitpick: please remove empty lines from json files where they are present.

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.

I added some minor comments.
Other than that code looks good, local testing looks good as well.
I'll re-approve it again after you make changes :)

@bretg
Copy link
Contributor

bretg commented Oct 6, 2022

docs PR prebid/prebid.github.io#4039

@VeronikaSolovei9 VeronikaSolovei9 dismissed their stale review October 12, 2022 18:44

Please address comments

@AlexBVolcy
Copy link
Contributor

There is a PR #2370 that is being merged today that will cause conflicts to new adapter PRs.

To resolve these conflicts, you'll need to do the following:

In brave.go, update the Builder() function signature to include a new parameter server config.Server

In brave_test.go, update any test that includes a call to Builder() to pass a config.Server object, to that call (i.e. config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "datacenter"})

After the merge, you can look at other adapters to see how the server object is implemented as an example.

Copy link
Contributor

@SyntaxNode SyntaxNode left a comment

Choose a reason for hiding this comment

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

Nice test coverage. Left a few comments about multi impression support and bid type detection.

adapters/brave/brave.go Show resolved Hide resolved
} else if imp.Native != nil {
mediaType = openrtb_ext.BidTypeNative
}
return mediaType
Copy link
Contributor

Choose a reason for hiding this comment

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

Although many adapters do this, we consider it an anti-pattern. Does your bidding server return the media type in the response? Such as the new OpenRTB 2.6 mtype field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, we using 2.5 and response with adm without mtype, that's why we have to recognise type by using req parameter


func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderBrave, config.Adapter{
Endpoint: "http://point.braveglobal.tv/?t=3&partner={{.PublisherID}}"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider using an obviously fake url for testing. There is no need for this to match the real endpoint and might be harder to maintain if you need to change it in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh ok, got it , thanks

exchange/adapter_builders.go Show resolved Hide resolved
@SyntaxNode
Copy link
Contributor

This code is identical to #2399. If these are aliases of the same underlying bidder, it's better to implement it just once and use an alias. Less code to maintain.

@bsardo
Copy link
Collaborator

bsardo commented Oct 26, 2022

This code is identical to #2399. If these are aliases of the same underlying bidder, it's better to implement it just once and use an alias. Less code to maintain.

Hi @thebraveio, just checking in to see if you can shed some light on this. Thanks!

@thebraveio
Copy link
Contributor Author

Added commit with fixes

@bsardo
Copy link
Collaborator

bsardo commented Nov 7, 2022

Hi @thebraveio, can you merge with master when you get a chance? Your code is failing the go 1.19 validation checks due to go fmt changes that were introduced with the recent upgrade to go 1.19 on master.

Also your code is failing the validate-merge step due to some recent changes we made on master regarding the ORTB library. You'll need to update the reference to the mxmcherry version of the library to the prebid version.

@bsardo bsardo removed their assignment Nov 7, 2022
@thebraveio
Copy link
Contributor Author

updated, check it again pls

@bsardo
Copy link
Collaborator

bsardo commented Nov 18, 2022

@thebraveio you still have errors to fix. The tests aren't passing because you have references to video heroes data structures in this PR.

@thebraveio
Copy link
Contributor Author

@thebraveio you still have errors to fix. The tests aren't passing because you have references to video heroes data structures in this PR.

yes, my mistake, sorry

@thebraveio
Copy link
Contributor Author

hi Guys, could you review the pull ? it just on pending for review

go.sum Outdated
@@ -29,12 +29,18 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not push changes in go.sum if you didn't modify go.mod. This should not be a part of this PR, there are no new libraries added

Copy link
Contributor

@VeronikaSolovei9 VeronikaSolovei9 Nov 30, 2022

Choose a reason for hiding this comment

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

UPD: discussed it with the team, it's ok to have changes in go.sum, no actions needed

AlexBVolcy
AlexBVolcy previously approved these changes Dec 5, 2022
Copy link
Contributor

@AlexBVolcy AlexBVolcy left a comment

Choose a reason for hiding this comment

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

LGTM

@bsardo
Copy link
Collaborator

bsardo commented Jan 4, 2023

Hi @thebraveio, would you mind rolling back the changes you made to go.sum?

@bsardo
Copy link
Collaborator

bsardo commented Jan 17, 2023

Hi @thebraveio, just checking in to see if you saw my earlier request to roll back changes to go.sum. No rush 🙂

@videoheroes
Copy link
Contributor

sorry for a delay, I checkout file to version was pulled before push

@bsardo
Copy link
Collaborator

bsardo commented Jan 20, 2023

@videoheroes, @thebraveio, no worries. It looks like you have two more lines in go.sum that involve the github.com/go-sql-driver/mysql package to restore and that is why the tests are failing.

@videoheroes
Copy link
Contributor

videoheroes commented Jan 24, 2023

yes, seems like I need to update go.* to #2356

@thebraveio
Copy link
Contributor Author

Hi Guys ! I see we do not pass security auto test, do you know where it comes from, as we do not touch any core code it can be versions problem again ?

Copy link
Contributor

@AlexBVolcy AlexBVolcy left a comment

Choose a reason for hiding this comment

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

LGTM! Discussed with the team today, you don't have to worry about the Trivy security failure, as we can still approve and merge in a PR if that's the only thing wrong with it.

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.

LGTM

@bsardo bsardo merged commit 30c86d4 into prebid:master Jan 31, 2023
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.

7 participants