-
Notifications
You must be signed in to change notification settings - Fork 757
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: Trustedstack #3618
New Adapter: Trustedstack #3618
Conversation
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
|
||
// Builder builds a new instance of the Trustedstack adapter for the given bidder with the given config. | ||
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { | ||
url := buildEndpoint(config.Endpoint, config.ExtraAdapterInfo) |
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.
Why not use server.ExternalUrl
instead of using the extra info field?
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.
Done.
b4a6ab3
to
a8844e6
Compare
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
a8844e6
to
b239786
Compare
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
f34f503
to
5c3111b
Compare
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
mediaType, err := getBidMediaTypeFromMtype(bid) | ||
if err == nil { | ||
return mediaType, nil | ||
} | ||
mediaType = openrtb_ext.BidTypeBanner | ||
for _, imp := range imps { | ||
if imp.ID == bid.ImpID { | ||
switch { |
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.
@product-trustedstack any particular reason to fall back to imp.ID
comparission when getBidMediaTypeFromMtype
Additionally,
- err != nil case is being ignored for
getBidMediaTypeFromMtype
- By default setting media type to
banner
on line 90 seems incorrect. Better to add a switch case for banner type as well. This ensuresbanner
media type is used only whenimp.Banner
is not nil
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 fall back was for mtype not correctly present in the response. That is the case for if err != nil, if mtype is wrong in the response, then impID can be used to fetch the correct mediaType.
Removed the fallbak to Impression Id. Updated the changes for default handling to banner and added it to the switch case.
switch bid.MType { | ||
case openrtb2.MarkupBanner: | ||
return openrtb_ext.BidTypeBanner, nil | ||
case openrtb2.MarkupVideo: | ||
return openrtb_ext.BidTypeVideo, nil | ||
case openrtb2.MarkupAudio: | ||
return openrtb_ext.BidTypeAudio, nil | ||
case openrtb2.MarkupNative: | ||
return openrtb_ext.BidTypeNative, nil | ||
default: | ||
return "", fmt.Errorf("unable to fetch mediaType for imp: %s", bid.ImpID) |
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.
static/bidder-info/trustedstack.yaml
doesnot define audio
as supported media type.
Should make changes in adapter code to only support media types defined in bidder info yaml or update bidder info yaml to define audio
as supported media type as well.
capabilities:
app:
mediaTypes:
- banner
- video
- native
site:
mediaTypes:
- banner
- video
- native
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.
According to the implementation of request to adapter, mediaType which adapters are not supported, request is not made for that impression and thus not sent to the bidder.
Shall bidder response parsing however can support all the media types and that can be utilised when the capabilities are updated?
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.
Shall bidder response parsing however can support all the media types and that can be utilised when the capabilities are updated?
@product-trustedstack for now adapter code should only check for media types supported. Code can be updated when capabilities includes new media type
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.
Done.
case imp.Banner == nil && imp.Video == nil && imp.Audio != nil && imp.Native == nil: | ||
mediaType = openrtb_ext.BidTypeAudio |
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.
refer https://github.com/prebid/prebid-server/pull/3618/files#r1570529242
static/bidder-info/trustedstack.yaml
doesnot define audio
as supported media type.
Should make changes in adapter code to only support media types defined in bidder info yaml or update bidder info yaml to define audio
as supported media type as well.
capabilities:
app:
mediaTypes:
- banner
- video
- native
site:
mediaTypes:
- banner
- video
- native
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.
According to the implementation of request to adapter, mediaType which adapters are not supported, request is not made for that impression and thus not sent to the bidder.
Shall bidder response parsing however can support all the media types and that can be utilised when the capabilities are updated?
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.
Shall bidder response parsing however can support all the media types and that can be utilised when the capabilities are updated?
@product-trustedstack for now adapter code should only check for media types supported. Code can be updated when capabilities includes new media type
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.
This was the fallback logic as discussed in the comment #3618 (comment).
This has been removed. The core logic to get the mtype from the field above has been updated to only support media types currently mentioned in the config.
@product-trustedstack requesting to merge prebid-server/adapters/pubmatic/pubmatic.go Lines 175 to 182 in 7635519
|
@onkarvhanumante this is done. |
…ent of banner mediaType.
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
}, nil | ||
} | ||
|
||
func getMediaTypeForImp(bid *openrtb2.Bid, imps []openrtb2.Imp) (openrtb_ext.BidType, error) { |
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.
imps
are not used in the function. We can keep the definition clean by removing the unused parameters.
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.
Also, this function is not required. getBidMediaTypeFromMtype
can be called directly from MakeBids
function as follow:-
bidType, err := getBidMediaTypeFromMtype(&sb.Bid[i])
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.
Done.
Code coverage summaryNote:
trustedstackRefer here for heat map coverage report
|
Trustedstack server adapter added.
Docs - https://github.com/prebid/prebid.github.io/blob/master/dev-docs/bidders/trustedstack.md