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: Nativo #3790

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

New Adapter: Nativo #3790

wants to merge 20 commits into from

Conversation

rafataveira
Copy link

No description provided.

Copy link

github-actions bot commented Jul 3, 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, 8c798c9

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:27:	MakeRequests		85.7%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:48:	MakeBids		92.9%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:89:	getMediaTypeForImp	100.0%
total:									(statements)		93.8%

@rafataveira
Copy link
Author

@onkarvhanumante Is there any ETA for reviewing this PR?
When is the next version expected to be released?
TIA

@onkarvhanumante
Copy link
Contributor

onkarvhanumante commented Aug 1, 2024

@rafataveira PR tests are failing due to file miss format. Requesting to format files

Run ./validate.sh --nofmt --cov --race 10
gofmt needs to be run, 2 files have issues.  Below is a list of files to review:
adapters/nativo/nativo.go
adapters/nativo/nativo_test.go

@ashishshinde-pubm
Copy link
Contributor

@rafataveira Does this bidder supports request.test parameter and respond with dummy response ? or is there any way this bidder can return dummy response for test purpose ?

@@ -0,0 +1,19 @@
endpoint: "https://exchange.postrelease.com/esi?ntv_epid=7"
maintainer:
email: "prebiddev@nativo.com"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've sent an email to this address to confirm it is correct. Please respond to the email with a "received" message.

Copy link
Author

Choose a reason for hiding this comment

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

It is correct. I've just replied to the email.

Copy link
Collaborator

Choose a reason for hiding this comment

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

mail confirmed

"title": "Nativo Adapter Params",
"description": "A schema which validates params accepted by the Nativo adapter",
"type": "object",

Copy link
Collaborator

Choose a reason for hiding this comment

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

NIP, please delete white line

Copy link
Author

Choose a reason for hiding this comment

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

done


func TestBidderNativo(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderNativo, config.Adapter{
Endpoint: "https://foo.io/?src=prebid"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is it "https://foo.io/?src=prebid" ?
It should be endpoint from yaml

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,19 @@
endpoint: "https://exchange.postrelease.com/esi?ntv_epid=7"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"esi?ntv_epid=7" does not look fine

Copy link
Author

Choose a reason for hiding this comment

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

this is correct, that's the url to our exchange server, in this case, prebid server.

@rafataveira
Copy link
Author

@onkarvhanumante I will review all comments and make the changes accordingly.

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, 46e7869

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:27:	MakeRequests		85.7%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:48:	MakeBids		92.9%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:89:	getMediaTypeForImp	100.0%
total:									(statements)		93.8%

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, 3e8a7db

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:27:	MakeRequests		85.7%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:48:	MakeBids		92.9%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:89:	getMediaTypeForImp	100.0%
total:									(statements)		93.8%

@przemkaczmarek
Copy link
Collaborator

works:
image

przemkaczmarek
przemkaczmarek previously approved these changes Sep 25, 2024
@bsardo
Copy link
Collaborator

bsardo commented Sep 25, 2024

works: image

I see this 200 response as well but it is supposed to redirect (302) to the PBS setuid endpoint which is specified in your ntv_r parameter. @rafataveira

@rafataveira
Copy link
Author

@bsardo
Copy link
Collaborator

bsardo commented Sep 30, 2024

@bsardo This is the result of the redirect I get: https://prebid.adnxs.com/pbs/v1/setuid?bidder=Nativo&gdpr=&gdpr_consent=&f=i&uid=%22c0ed3c17-4ba0-4d2e-9cf2-cbf8f9037793%22 image

Hi @rafataveira, I suggest testing your user sync with localhost so that your bidder is known and so that you can ensure your server redirects to the setuid endpoint of the PBS host, which in this case will be the localhost setuid endpoint. Start this process by first hitting the localhost PBS cookie sync endpoint:
POST localhost:8000/cookie_sync with body {"bidders": ["nativo"]} and that will give you the url that would be dropped as a pixel kicking off the cookie sync that should ultimately redirect to the setuid endpoint.

Copy link

github-actions bot commented Oct 1, 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, fec9463

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:26:	MakeRequests		85.7%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:46:	MakeBids		83.3%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:83:	getMediaTypeForImp	88.9%
total:									(statements)		86.1%

@rafataveira
Copy link
Author

@bsardo This is the result of the redirect I get: https://prebid.adnxs.com/pbs/v1/setuid?bidder=Nativo&gdpr=&gdpr_consent=&f=i&uid=%22c0ed3c17-4ba0-4d2e-9cf2-cbf8f9037793%22 image

Hi @rafataveira, I suggest testing your user sync with localhost so that your bidder is known and so that you can ensure your server redirects to the setuid endpoint of the PBS host, which in this case will be the localhost setuid endpoint. Start this process by first hitting the localhost PBS cookie sync endpoint: POST localhost:8000/cookie_sync with body {"bidders": ["nativo"]} and that will give you the url that would be dropped as a pixel kicking off the cookie sync that should ultimately redirect to the setuid endpoint.

I found the issue with the double quotes on userMacro. Now it should work as expected.

@bsardo
Copy link
Collaborator

bsardo commented Oct 3, 2024

@rafataveira we're still seeing an issue with the user sync. Your server is responding with a 200. Since you've classified this user sync as type redirect, your server should be responding with a 302 redirect to the url defined in the ntv_r parameter with the user id macro populated.

@rafataveira
Copy link
Author

rafataveira commented Oct 7, 2024

@bsardo I couldn't reproduce this behaviour. As you can see, our server responds with 302 and correctly redirects to the URL defined in the ntv_r parameter with the user ID macro populated.
image
This is the same cookie sync URL used by Prebid Server Java version and other partners.
Also, make sure to use the secure URL (https).

https://jadserve.postrelease.com/suid/101787?gdpr=&gdpr_consent=&us_privacy=&ntv_gpp_consent=&ntv_r=https%3A%2F%2Fprebid.adnxs.com%2Fpbs%2Fv1%2Fsetuid%3Fbidder%3DNativo%26gdpr%3D%26gdpr_consent%3D%26f%3Di%26uid%3DNTV_USER_ID

@rafataveira
Copy link
Author

@onkarvhanumante @przemkaczmarek @bsardo, is the cookie sync URL the only thing preventing you from approving this PR? We have some clients waiting for the GO version to go live for quite some time. Could you please go ahead and approve it? The cookie sync URL is the same as prebid-server-java and other partners, and it is working as expected.

@bsardo
Copy link
Collaborator

bsardo commented Oct 17, 2024

@onkarvhanumante @przemkaczmarek @bsardo, is the cookie sync URL the only thing preventing you from approving this PR? We have some clients waiting for the GO version to go live for quite some time. Could you please go ahead and approve it? The cookie sync URL is the same as prebid-server-java and other partners, and it is working as expected.

Hi @rafataveira, yes the user sync is the only thing holding this up. We tried the URL you provided as well and it is still not working for me or Peter and we are based in the US and Poland respectively in case this is a geographic region issue. We are still seeing a 200 instead of a 302 redirect. This issue needs to be resolved before merging this PR as is unless you want to break the user sync functionality out into a separate PR so that the rest of this can be merged now. At this point, I am leaving the user sync investigation up to you though I will triple check with another team member that the 200 issue is occurring and report back later today.

@rafataveira
Copy link
Author

@bsardo I see what is happening to your validation. This is a production cookie sync URL which has different kinds of internal validations to avoid fraud and won't redirect if a possible fraud is detected. It works for me because I am in a VPN environment. This has nothing to do with our GO version adapter at all. If this is still a blocker for you to approve this PR, (even though it is not a problem) we can remove it from this PR and also, change our validation for Prebid Server to always redirect. Let me know what you recommend.

przemkaczmarek
przemkaczmarek previously approved these changes Oct 22, 2024
@bsardo
Copy link
Collaborator

bsardo commented Oct 22, 2024

@rafataveira we're required to verify the user sync endpoints works. Can you either provide details on how to construct a request so that it is not flagged by your servers as potential fraud or change your server validations so that the URL generated by the cookie sync endpoint always results in a redirect? I'll leave that decision to you at this time as I'm not aware of how your validation works.

@rafataveira
Copy link
Author

@bsardo we have pushed a fix for the redirect validation. Can you please validate and if all looks good can we merge the PR?

@aparekh-nativo
Copy link

@bsardo can we get an update on the cookie sync validation ?

Copy link

github-actions bot commented Nov 1, 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, 6d45678

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:26:	MakeRequests		85.7%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:46:	MakeBids		83.3%
github.com/prebid/prebid-server/v2/adapters/nativo/nativo.go:83:	getMediaTypeForImp	88.9%
total:									(statements)		86.1%

@bsardo
Copy link
Collaborator

bsardo commented Nov 1, 2024

Hi @aparekh-nativo, @rafataveira tests are failing and your PR branch does not run because you have some incorrect package references after merging with master. All package imports should reference v3 instead of v2. It looks like the offending files are adapter_builders.go, nativo.go and nativo_test.go. Yesterday we released PBS 3.0 which updated all package references to v3. See #4029.

Copy link

github-actions bot commented Nov 4, 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, 96b26e9

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:26:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:46:	MakeBids		83.3%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:83:	getMediaTypeForImp	88.9%
total:									(statements)		86.1%

Copy link

github-actions bot commented Nov 4, 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, e35a49e

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:26:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:46:	MakeBids		83.3%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:83:	getMediaTypeForImp	88.9%
total:									(statements)		86.1%

@rafataveira
Copy link
Author

@bsardo The merge issue and test failures are fixed. Could you please go ahead and merge it?

@bsardo
Copy link
Collaborator

bsardo commented Nov 4, 2024

Hi @rafataveira, now I see the redirect working but the user id macro NTV_USER_ID is not being populated:
Screenshot 2024-11-04 at 5 13 40 PM

Your server appears to just be echoing whatever I send as uid=.

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