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

Merged
merged 29 commits into from
Nov 13, 2024
Merged

New Adapter: Nativo #3790

merged 29 commits into from
Nov 13, 2024

Conversation

rafataveira
Copy link
Contributor

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
Contributor 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: "[email protected]"
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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor 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%

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
Contributor 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=.

@rafataveira
Copy link
Contributor Author

@bsardo could you please recheck it? We pushed a fixed this morning to solve this issue.

@bsardo bsardo assigned bsardo and unassigned onkarvhanumante Nov 8, 2024
Copy link
Collaborator

@bsardo bsardo left a comment

Choose a reason for hiding this comment

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

@rafataveira your cookie sync looks good now and the adapter looks good overall. I just took over review responsibilities from Onkar as he is currently unavailable. I left just a few more comments. Please take a look, update and ping me when ready so I can prioritize re-review. Thanks for your patience.

Comment on lines +16 to +19
userSync:
redirect:
url: https://jadserve.postrelease.com/suid/101787?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&ntv_gpp_consent={{.GPP}}&ntv_r={{.RedirectURL}}
userMacro: NTV_USER_ID
Copy link
Collaborator

Choose a reason for hiding this comment

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

Confirmed redirect user sync is working. Observed 302 to PBS setuid endpoint with a user ID which is successfully added to cookie.
Screenshot 2024-11-08 at 9 09 40 AM

return bidResponse, errs
}

func getMediaTypeForImp(bid openrtb2.Bid, imps []openrtb2.Imp) (openrtb_ext.BidType, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: I suggest just passing in what you need so instead of copying the bid object just pass in bidImpID string as the first parameter.

}
}
}
return "", fmt.Errorf("Unrecognized impression type in response from nativo: %s", bid.ImpID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a supplemental JSON test where the bid returns an imp ID that is different from what is in the request so that this code path is executed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can delete this test. It is exactly the same as 204-response-from-nativo.json.


func TestBidderNativo(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderNativo, config.Adapter{
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.

I suggest using a fake URL here and in all of your JSON test files for maintenance purposes.

"h": 50
}
],
"type": "banner",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see this field seatbid[i].type is in all of your JSON tests. This is not a valid ORTB bid response field so I suggest removing it as it is misleading. There is a field seatbid[i].bid[j].mtype which can be used to indicate the media type and this is strongly recommended instead of deriving the media type from impression IDs via your function getMediaTypeForImp but that is up to you if you want to make use of it at this time.

At a minimum, please remove this "type" field from all of your JSON test mock responses.

Copy link

github-actions bot commented Nov 8, 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, bb1d602

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 8, 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, 116abc4

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		94.4%
github.com/prebid/prebid-server/v3/adapters/nativo/nativo.go:83:	getMediaTypeForImp	100.0%
total:									(statements)		94.4%

@rafataveira
Copy link
Contributor Author

@bsardo all the comments have been addressed. could you please validate?

@rafataveira
Copy link
Contributor Author

@bsardo Following up with this. Are you able to review it again and merge it? Thank you.

@bsardo
Copy link
Collaborator

bsardo commented Nov 12, 2024

@przemkaczmarek please give this another look given recent changes.

@bsardo bsardo merged commit 63af8af into prebid:master Nov 13, 2024
5 checks passed
@rafataveira
Copy link
Contributor Author

Thank you @bsardo . Quick question, when and what version will Prebid Server with our adapter be available for publishers?

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