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

Sonobi: add native support to sonobi adapter #3802

Closed
wants to merge 4 commits into from

Conversation

bansawbanchee
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Jul 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, 2ba0100

sonobi

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:29:	MakeRequests		80.0%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:68:	makeRequest		77.8%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:92:	MakeBids		73.7%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:136:	getMediaTypeForImp	66.7%
total:									(statements)		76.3%

userSync:
iframe:
url: "https://sync.go.sonobi.com/uc.html?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&loc={{.RedirectURL}}"
userMacro: "[UID]"
Copy link
Contributor

Choose a reason for hiding this comment

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

usersync works.

Comment on lines +143 to +144
if imp.Banner == nil && imp.Video == nil && imp.Native != nil {
mediaType = openrtb_ext.BidTypeNative
Copy link
Contributor

Choose a reason for hiding this comment

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

Code path is not covered. Should add json framework tests for Native media type.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bansawbanchee Suggesting you to please use Mtype field set by your adapter response. Here is an example -

func getBidType(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
	switch bid.MType {
	case openrtb2.MarkupBanner:
		return openrtb_ext.BidTypeBanner, nil
	case openrtb2.MarkupVideo:
		return openrtb_ext.BidTypeVideo, nil
	case openrtb2.MarkupNative:
		return openrtb_ext.BidTypeNative, nil
	}

	return "", &errortypes.BadInput{
		Message: fmt.Sprintf("Could not define media type for impression: %s", bid.ImpID),
	}
}

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, 5933f60

sonobi

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:29:	MakeRequests		80.0%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:68:	makeRequest		77.8%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:92:	MakeBids		73.7%
github.com/prebid/prebid-server/v2/adapters/sonobi/sonobi.go:136:	getMediaTypeForImp	77.8%
total:									(statements)		78.0%

@bansawbanchee
Copy link
Contributor Author

Went ahead and closed this on and combined it into our newest pull request: #3889

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.

3 participants