Skip to content

New Adapter: Nativery #4321

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

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

Conversation

andreafassina
Copy link

@andreafassina andreafassina commented Apr 28, 2025


// getMediaTypeForBid switch nativery type in bid type.
func getMediaTypeForBid(bid *bidExt) (openrtb_ext.BidType, error) {
switch bid.Nativery.BidType {

Choose a reason for hiding this comment

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

Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeNative. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.


// getMediaTypeForBid switch nativery type in bid type.
func getMediaTypeForBid(bid *bidExt) (openrtb_ext.BidType, error) {
switch bid.Nativery.BidType {

Choose a reason for hiding this comment

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

Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeVideo. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.

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, 52b65f4

nativery

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:18:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:30:	MakeRequests		73.3%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:88:	buildNativeryExt	71.4%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:103:	buildRequest		100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:124:	MakeBids		77.4%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:193:	getMediaTypeForBid	80.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:206:	convertIntToBoolean	80.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:217:	buildBidMeta		100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:233:	splitRequests		81.8%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:276:	getRequestExt		60.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:288:	getNativeryExt		71.4%
total:									(statements)		77.3%

@bsardo bsardo added the adapter label Apr 28, 2025
@bsardo
Copy link
Collaborator

bsardo commented Apr 28, 2025

@pm-shriprasad-marathe can you please review?

Copy link
Contributor

@ShriprasadM ShriprasadM left a comment

Choose a reason for hiding this comment

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

@bsardo added my comments

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, e28766d

nativery

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:18:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:30:	MakeRequests		83.3%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:88:	buildNativeryExt	85.7%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:103:	buildRequest		100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:123:	MakeBids		87.1%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:192:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:205:	convertIntToBoolean	80.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:216:	buildBidMeta		100.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:226:	splitRequests		79.2%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:290:	getRequestExt		60.0%
github.com/prebid/prebid-server/v3/adapters/nativery/nativery.go:302:	getNativeryExt		71.4%
total:									(statements)		83.5%

@andreafassina
Copy link
Author

@ShriprasadM I think we have addressed all comments from the review. Let me know if further adjustments are required.

@andreafassina andreafassina requested a review from ShriprasadM May 5, 2025 09:29
Copy link
Contributor

@ShriprasadM ShriprasadM left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants