-
Notifications
You must be signed in to change notification settings - Fork 744
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: Zentotem #3866
New Adapter: Zentotem #3866
Conversation
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
adapters/zentotem/zentotem.go
Outdated
var bidExt openrtb_ext.ExtBid | ||
err := json.Unmarshal(bid.Ext, &bidExt) | ||
if err == nil && bidExt.Prebid != nil { | ||
return openrtb_ext.ParseBidType(string(bidExt.Prebid.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.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
zentotemRefer here for heat map coverage report
|
add adapter for zentotem
adapters/zentotem/zentotem.go
Outdated
} | ||
|
||
func getMediaTypeForBid(imp openrtb2.Imp) (openrtb_ext.BidType, error) { | ||
if imp.Native != 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.
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, nil. 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.
adapters/zentotem/zentotem.go
Outdated
return openrtb_ext.BidTypeNative, nil | ||
} | ||
|
||
if imp.Banner != 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.
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.BidTypeBanner, nil. 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.
adapters/zentotem/zentotem.go
Outdated
return openrtb_ext.BidTypeBanner, nil | ||
} | ||
|
||
if imp.Video != 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.
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, nil. 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.
Code coverage summaryNote:
zentotemRefer here for heat map coverage report
|
add adapter for zentotem
adapters/zentotem/zentotem.go
Outdated
} | ||
|
||
func getMediaTypeForBid(imp openrtb2.Imp) (openrtb_ext.BidType, error) { | ||
if imp.Native != 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.
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, nil. 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.
adapters/zentotem/zentotem.go
Outdated
return openrtb_ext.BidTypeNative, nil | ||
} | ||
|
||
if imp.Banner != 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.
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.BidTypeBanner, nil. 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.
adapters/zentotem/zentotem.go
Outdated
return openrtb_ext.BidTypeBanner, nil | ||
} | ||
|
||
if imp.Video != 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.
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, nil. 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.
Code coverage summaryNote:
zentotemRefer here for heat map coverage report
|
Hello! Apologies for making some changes during the review process, but I had to change “getMediaTypeForBid” |
adapters/zentotem/zentotem.go
Outdated
if request == nil { | ||
return nil, []error{&errortypes.BadInput{Message: "empty request"}} | ||
} | ||
if len(request.Imp) == 0 { | ||
return nil, []error{&errortypes.BadInput{Message: "empty request.Imp"}} | ||
} |
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.
No need to perform these checks. These are covered by the core predid server 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.
fixed
adapters/zentotem/zentotem.go
Outdated
return requests, errors | ||
} | ||
|
||
func getMediaTypeForBid(imp 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.
Requesting you to please re-write this function to use MType 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.
fixed
adapters/zentotem/zentotem.go
Outdated
if responseData.StatusCode == http.StatusNoContent { | ||
return nil, nil | ||
} | ||
|
||
if responseData.StatusCode == http.StatusBadRequest { | ||
err := &errortypes.BadInput{ | ||
Message: "Unexpected status code: 400. Bad request from publisher. Run with request.debug = 1 for more info.", | ||
} | ||
return nil, []error{err} | ||
} | ||
|
||
if responseData.StatusCode != http.StatusOK { | ||
err := &errortypes.BadServerResponse{ | ||
Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info.", responseData.StatusCode), | ||
} | ||
return nil, []error{err} | ||
} |
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.
Please reuse -
if adapters.IsResponseStatusCodeNoContent(responseData) {
return nil, nil
}
if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil {
return nil, []error{err}
}
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.
fixed
adapters/zentotem/zentotem.go
Outdated
impMap := map[string]openrtb2.Imp{} | ||
for _, imp := range request.Imp { | ||
impMap[imp.ID] = imp | ||
} |
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.
You should not be creating the impMap if you use Mtype field set in the bid response.
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.
fixed
@@ -0,0 +1,16 @@ | |||
endpoint: "https://rtb.zentotem.net/bid?sspuid=cqlnvfk00bhs0b6rci6g" | |||
maintainer: | |||
email: [email protected] |
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.
sent email for verification.
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.
we sent a response letter for verification
Co-authored-by: hhhjort <[email protected]> Co-authored-by: Veronika Solovei <[email protected]>
Co-authored-by: VeronikaSolovei9 <[email protected]>
Hi @zentotem, we recently released PBS 3.0, more specifically v3.1.0, which updates Prebid Server package import references throughout the project from
As a result, please merge with master (no rebase) and then ensure all Prebid Server package import references in the files you’ve changed are |
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
add adapter for zentotem
fix after review
fix after review
replace v2 to v3
# Conflicts: # adapters/zentotem/params_test.go # adapters/zentotem/zentotem.go # adapters/zentotem/zentotem_test.go # exchange/adapter_builders.go
Docs: prebid/prebid.github.io#5553