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 : MediaGo #3705

Merged
merged 13 commits into from
Jun 24, 2024
Merged

New Adapter : MediaGo #3705

merged 13 commits into from
Jun 24, 2024

Conversation

SylviaF
Copy link
Contributor

@SylviaF SylviaF commented May 24, 2024

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, 34517f7

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:38:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:51:	makeRequest		86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getImpMediaGoExt	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:98:	getRegionInfo		80.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:111:	getEndPoint		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:119:	preProcess		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	MakeBids		83.3%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:175:	getBidType		69.6%
total:									(statements)		85.9%

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, 409161e

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:38:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:51:	makeRequest		86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getImpMediaGoExt	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:98:	getRegionInfo		80.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:111:	getEndPoint		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:119:	preProcess		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	MakeBids		83.3%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:175:	getBidType		60.7%
total:									(statements)		82.5%

Comment on lines 185 to 189
default:
var bidExt mediagoResponseBidExt
err := json.Unmarshal(bid.Ext, &bidExt)
if err == nil {
switch bidExt.MediaType {
Copy link
Contributor

Choose a reason for hiding this comment

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

@SylviaF any particular reason to fall back to bid.Ext? are there any scenarios where MType is not being set

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, I will remove the logic related to bid.ext, but I will keep the code that retrieves the corresponding bid type through imp because our bidder has not yet fully returned mtype.

Choose a reason for hiding this comment

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

@nicgallardo this is the PR, not sure if helpful

- native
userSync:
redirect:
url: https://trace.mediago.io/ju/cs/prebid?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}
Copy link
Contributor

Choose a reason for hiding this comment

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

https://trace.mediago.io/ju/cs/prebid?gdpr=&gdpr_consent=&us_privacy=&redirect=https%3A%2F%2Fprebid.adnxs.com%2Fpbs%2Fv1%2Fsetuid%3Fbidder%3Dmediago%26gdpr%3D%26gdpr_consent%3D%26f%3Di%26uid%3D%24UID

redirect url is working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, if there's anything we need to change?

Comment on lines 137 to 147

if response.StatusCode == http.StatusBadRequest {
return nil, []error{&errortypes.BadInput{
Message: fmt.Sprintf("Unexpected status code: %d.", response.StatusCode),
}}
}

if response.StatusCode != http.StatusOK {
return nil, []error{&errortypes.BadServerResponse{
Message: fmt.Sprintf("Unexpected status code: %d.", response.StatusCode),
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

above code path is not covered. should add json tests for better coverage

Comment on lines 177 to 184
case openrtb2.MarkupBanner:
return openrtb_ext.BidTypeBanner, nil
case openrtb2.MarkupAudio:
return openrtb_ext.BidTypeAudio, nil
case openrtb2.MarkupNative:
return openrtb_ext.BidTypeNative, nil
case openrtb2.MarkupVideo:
return openrtb_ext.BidTypeVideo, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

above code path is not covered. should add json tests for better coverage

Comment on lines 219 to 220
return mediaType, fmt.Errorf("unable to fetch mediaType in multi-format: %s", bid.ImpID)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

above code path is not covered. should add json tests for better coverage

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

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:27:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:38:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:51:	makeRequest		86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getImpMediaGoExt	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:98:	getRegionInfo		80.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:111:	getEndPoint		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:119:	preProcess		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	MakeBids		83.3%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:175:	getBidType		60.7%
total:									(statements)		82.5%

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, 930ecf8

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:28:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:39:	MakeRequests	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:52:	makeRequest	86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getMediaGoExt	90.5%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:120:	getRegionInfo	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	getEndPoint	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:141:	preProcess	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:155:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:188:	getBidType	100.0%
total:									(statements)	95.5%

@SylviaF SylviaF requested a review from onkarvhanumante May 29, 2024 00:54
@SylviaF SylviaF requested a review from onkarvhanumante June 3, 2024 09:40
Copy link

github-actions bot commented Jun 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, b682e0b

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:28:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:39:	MakeRequests	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:52:	makeRequest	86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getMediaGoExt	95.2%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:120:	getRegionInfo	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	getEndPoint	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:141:	preProcess	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:155:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:188:	getBidType	100.0%
total:									(statements)	96.6%

Copy link

github-actions bot commented Jun 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, d776f1b

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:28:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:39:	MakeRequests	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:52:	makeRequest	86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getMediaGoExt	95.2%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:120:	getRegionInfo	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	getEndPoint	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:141:	preProcess	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:155:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:188:	getBidType	100.0%
total:									(statements)	96.6%

Comment on lines +198 to +208
default:
for _, imp := range imps {
if imp.ID == bid.ImpID {
if imp.Banner != nil {
return openrtb_ext.BidTypeBanner, nil
}
if imp.Native != nil {
return openrtb_ext.BidTypeNative, nil
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

any particular reason to fallback to this logic when no case for MType matches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@onkarvhanumante We retrieves the corresponding bid type through imp because our bidder api may has not yet fully returned mtype.
Since this is not an OpenRTB standard, we will implement special adaptation. However, to be safe, we would like to keep the fallback code.

Choose a reason for hiding this comment

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

any particular reason to fallback to this logic when no case for MType matches?

Hi @onkarvhanumante chiming in here for my colleague @SylviaF . She replied to this question last week but somehow the reply was not seen. Essentially she's saying the reason why we map the MType field according to the bid type in imp is that we follow the standard OpenRTB specs, and MType is not included in oRTB specs. We will make modifications based on Prebid's requirements, however just in case, we want to keep this fallback code to make sure we can bid properly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@onkarvhanumante the Prebid Server committee discussed this thread the other day. We're ok with this fallback logic. Using the MType is preferable and there's no harm in having the fallback code. As I'm sure you're aware, a lot of other adapters only have the imp-based approach. I imagine you were just asking out of curiosity, but just in case, I want you to know that the committee is ok with this.

@SylviaF SylviaF requested a review from onkarvhanumante June 5, 2024 09:20
@SylviaF
Copy link
Contributor Author

SylviaF commented Jun 11, 2024

@onkarvhanumante @Sonali-More-Xandr @ChrisHuie Sorry to bother you all, but could you please let me know who will be able to review my code next? My boss keeps asking me why the code hasn't been merged yet.
Thank you so much if anyone give me some advice!!!

@ChrisHuie
Copy link
Contributor

ChrisHuie commented Jun 11, 2024

@onkarvhanumante @Sonali-More-Xandr @ChrisHuie Sorry to bother you all, but could you please let me know who will be able to review my code next? My boss keeps asking me why the code hasn't been merged yet. Thank you so much if anyone give me some advice!!!

Yeah. @SylviaF trying to move this along. Can you please respond to Onkar's above question though about the fallback with no case matches. Think he is waiting on a response there for the review

@SylviaF
Copy link
Contributor Author

SylviaF commented Jun 11, 2024

@onkarvhanumante @Sonali-More-Xandr @ChrisHuie Sorry to bother you all, but could you please let me know who will be able to review my code next? My boss keeps asking me why the code hasn't been merged yet. Thank you so much if anyone give me some advice!!!

Yeah. @SylviaF trying to move this along. Can you please respond to Onkar's above question though about the fallback with no case matches. Think he is waiting on a response there for the review

Hi @ChrisHuie , I have responded last week. But I found that even my colleage can't see my review. Very strange.
image

@JimmyLuoJW
Copy link

Hi @onkarvhanumante @ChrisHuie, I think we may have some misunderstanding here. My colleague @SylviaF has been replying to all your questions but failed to submit so you never see her replying. Apologies for this as we're not familiar with the UI, and it's now addressed on our side and you can see her previous replies. Appreciate your support here.

@BradT-MediaGo
Copy link

Hi @onkarvhanumante I work on the MediaGo team and wanted to check in to see what the status was for our review. Realize we had some miscommunication with the github UI but I think that's all been taken care of now. Is there any update on your end in regards to timing or do you need anything from us to proceed? Also, after your review, is the next step to get it reviewed by @Sonali-More-Xandr?

I see 'All Checks have passed' so hoping that's good news!

ChrisHuie
ChrisHuie previously approved these changes Jun 21, 2024
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.

Looks good to me. I have left two small nitpicks if you're able to address. Please also look out for an email to [email protected] to verify it's reachable.

adapters/mediago/mediago.go Show resolved Hide resolved
adapters/mediago/mediago.go Outdated Show resolved Hide resolved
@SyntaxNode
Copy link
Contributor

Looking at the docs PR, I see that the test and bidfloor parameters from PBJS are not included in the PBS adapter. Are the region parameter also available in PBJS?

@bretg for input on PBJS and PBS parameters.

@bretg
Copy link
Contributor

bretg commented Jun 21, 2024

Good catch @SyntaxNode - I've asked for the relevant changes in the docs PR prebid/prebid.github.io#5395

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

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:28:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:39:	MakeRequests	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:52:	makeRequest	86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getMediaGoExt	95.2%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:120:	getRegionInfo	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	getEndPoint	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:141:	preProcess	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:155:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:188:	getBidType	100.0%
total:									(statements)	96.6%

SylviaF added 2 commits June 24, 2024 09:57
2. remove the unsupported formats instead of leaving them as 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, d750484

mediago

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:28:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:39:	MakeRequests	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:52:	makeRequest	86.7%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:84:	getMediaGoExt	95.2%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:120:	getRegionInfo	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:133:	getEndPoint	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:141:	preProcess	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:155:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/mediago/mediago.go:188:	getBidType	100.0%
total:									(statements)	96.6%

@SylviaF
Copy link
Contributor Author

SylviaF commented Jun 24, 2024

Looking at the docs PR, I see that the test and bidfloor parameters from PBJS are not included in the PBS adapter. Are the region parameter also available in PBJS?

@bretg for input on PBJS and PBS parameters.

@SyntaxNode @bretg Thank you for your suggestions. I have made all the corrections, including updating the parameter validity explanations in the GitHub.io documentation.

@ChrisHuie ChrisHuie merged commit 8500d56 into prebid:master Jun 24, 2024
5 checks passed
mefjush pushed a commit to adhese/prebid-server that referenced this pull request Jul 19, 2024
* Add MediaGo bidder adapter

* update getBidType

* MediaGo bidder add test covarage and update some logic

* Change the EP's domain macro replacement to let the Publisher modify the config.

* change mediago docs

* change mediago docs

* 1. follow Go's comment convention
2. remove the unsupported formats instead of leaving them as comments
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.

10 participants