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: Zentotem #3866

Closed
wants to merge 89 commits into from
Closed

New Adapter: Zentotem #3866

wants to merge 89 commits into from

Conversation

zentotem
Copy link

GermanBogatov and others added 8 commits July 2, 2024 12:42
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
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))

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.

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

zentotem

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:26:	MakeRequests		75.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:58:	getMediaTypeForBid	33.3%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:72:	MakeBids		86.4%
total:									(statements)		76.1%

}

func getMediaTypeForBid(imp openrtb2.Imp) (openrtb_ext.BidType, error) {
if imp.Native != nil {

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.

return openrtb_ext.BidTypeNative, nil
}

if imp.Banner != nil {

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.

return openrtb_ext.BidTypeBanner, nil
}

if imp.Video != nil {

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.

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

zentotem

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:26:	MakeRequests		75.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:58:	getMediaTypeForBid	0.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:76:	MakeBids		75.9%
total:									(statements)		66.7%

add adapter for zentotem
}

func getMediaTypeForBid(imp openrtb2.Imp) (openrtb_ext.BidType, error) {
if imp.Native != nil {

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.

return openrtb_ext.BidTypeNative, nil
}

if imp.Banner != nil {

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.

return openrtb_ext.BidTypeBanner, nil
}

if imp.Video != nil {

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.

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, 6f3f47c

zentotem

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:19:	Builder			100.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:26:	MakeRequests		75.0%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:58:	getMediaTypeForBid	85.7%
github.com/prebid/prebid-server/v2/adapters/zentotem/zentotem.go:76:	MakeBids		75.9%
total:									(statements)		77.8%

@zentotem
Copy link
Author

Hello! Apologies for making some changes during the review process, but I had to change “getMediaTypeForBid”

Comment on lines 27 to 32
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"}}
}
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

return requests, errors
}

func getMediaTypeForBid(imp openrtb2.Imp) (openrtb_ext.BidType, error) {
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 77 to 93
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}
}
Copy link
Contributor

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}
	}

Copy link
Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 95 to 98
impMap := map[string]openrtb2.Imp{}
for _, imp := range request.Imp {
impMap[imp.ID] = imp
}
Copy link
Contributor

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.

Copy link
Author

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]
Copy link
Contributor

Choose a reason for hiding this comment

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

sent email for verification.

Copy link
Author

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

@bsardo
Copy link
Collaborator

bsardo commented Nov 4, 2024

Hi @zentotem, we recently released PBS 3.0, more specifically v3.1.0, which updates Prebid Server package import references throughout the project from v2 to v3.
For example:

import (
    "github.com/prebid/prebid-server/v3/adapters"
)

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 v3 such that the test suite passes so we can resume reviewing. Thanks!

MartinGumGum and others added 19 commits November 4, 2024 14:14
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
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.