-
Notifications
You must be signed in to change notification settings - Fork 854
Sparteo: Add required query params to adapter endpoint #4556
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
base: master
Are you sure you want to change the base?
Sparteo: Add required query params to adapter endpoint #4556
Conversation
f9e0dd1 to
ce7066f
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
ce7066f to
81ad9b9
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
c11cc87 to
3b4f311
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
465128b to
8fc2270
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
4993d1e to
ff8b127
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
ff8b127 to
cc709f3
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
static/bidder-info/sparteo.yaml
Outdated
| - video | ||
| - native | ||
| endpoint: "https://bid.sparteo.com/s2s-auction" | ||
| endpoint: "https://bid.sparteo.com/s2s-auction?network_id={{.NetworkId}}&{{if .SiteDomain}}&site_domain={{.SiteDomain}}{{end}}{{if .AppDomain}}&app_domain={{.AppDomain}}{{end}}{{if .Bundle}}&bundle={{.Bundle}}{{end}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this result in an extra '&' after network id, also could you just pass the params if they're present or not and they will come thorugh as empty params instead of using the condtionals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, i have removed the extra &.
Concerning the params we really prefers to do not have the query param instead of an empty one. But i'm open to do not use conditional templating. The java adapter just append the query param if present. Would this be more acceptable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsardo whats the guidance around conditional templating in the endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked to @bsardo - can you please handle conditionally building the endpoint URL in the adapter itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if i had to stick with replacement macro building the conditional template dynamically or i could just use query param to mirror my Prebid Java adapter logic.
I chose to mirror my java logic but if i have misunderstood, please let me know, i'll adjust the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah you want to use the endpoint template to build your endpoint url with macros
Example here: https://github.com/prebid/prebid-server/blob/master/adapters/adview/adview.go#L163
30a22ca to
383691e
Compare
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
|
@t-sormonte can you try merging with master please? For some reason it is saying you have conflicts that must be resolved but it is not showing what they are. |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
|
Hi @bsardo , @ccorbo and @pm-isha-bharti , When you have a moment, could we please continue the review on the Go version so it can stay aligned with the other implementations? |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
|
Hey @ccorbo , |
|
hi @ccorbo , Thank you in advance for your time. |
Code coverage summaryNote:
sparteoRefer here for heat map coverage report |
|
Thanks @ccorbo for the review, time spent and approval. Hi @pm-isha-bharti, Theses changes are urgently expected as it already has been released in Prebid.js 10.17.0 and 9.53.4 and in Prebid Server Java 3.36.0 |
|
Hi @bsardo , Theses changes are urgently expected as it already has been released in Prebid.js 10.17.0 and 9.53.4 and in Prebid Server Java 3.36.0 |
|
Hi @bsardo @pm-isha-bharti , We’d love to get this aligned as soon as possible. |
bsardo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t-sormonte please see my last two comments.
| params, ok := pubExt["params"].(map[string]interface{}) | ||
| if !ok { | ||
| params = make(map[string]interface{}) | ||
| pubExt["params"] = params | ||
| } | ||
| params["networkId"] = networkID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? You're not doing anything with params after modifying it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that since maps are reference types, extracting params here points to the same underlying data structure as pubExt['params']. So, modifying params update pubExt without needing a reassignment.
It seems to be working as expected in my tests, but if you find this flow unclear, please suggest me a clearer way i'll be happy to implement it.
| if appDomain == "" { | ||
| appDomain = unknownValue | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? I see that when req.Site is set and domain is empty an error is recorded on lines 121-123 but no error is recorded here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the app_domain is helpful yet optional (a 'nice-to-have'). The critical mandatory field for Apps is actually the bundle, which we do validate and return an error for a few lines further down (lines 148-152). If you are ok with it, I'd prefer to keep the logic as is.
|
Hi @bsardo , |
🔧 Type of changes
✨ What's the context?
We want to support new required query params when calling our SSP
The Java PR: prebid/prebid-server-java#4225