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: MeloZen #3784

Merged
merged 8 commits into from
Aug 12, 2024
Merged

Conversation

benben2001
Copy link
Contributor

@benben2001 benben2001 commented Jul 1, 2024

This pull request introduces a new bidder adapter called "MeloZen" for Prebid Server.
Hi @onkarvhanumante Documentation for this adapter can be found in PR #5467.

Copy link

github-actions bot commented Jul 1, 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, d2cddf8

melozen

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:23:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:36:	MakeRequests			64.1%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:103:	buildEndpointURL		100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:108:	MakeBids			82.6%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:153:	splitImpressionsByMediaType	87.5%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:181:	getMediaTypeForBid		83.3%
total:									(statements)			76.9%

Copy link

github-actions bot commented Jul 9, 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, 1f345e9

melozen

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:23:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:36:	MakeRequests			64.1%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:103:	buildEndpointURL		100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:108:	MakeBids			82.6%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:153:	splitImpressionsByMediaType	90.5%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:188:	getMediaTypeForBid		83.3%
total:									(statements)			78.1%

@gargcreation1992 gargcreation1992 changed the title Add MeloZen Bidder Adapter for Prebid Server New Adapter: MeloZen Jul 25, 2024
Comment on lines 7 to 8
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.

Prebid team has sent email to verify above maintainers email. Requesting to responding back on email thread

Copy link
Contributor

Choose a reason for hiding this comment

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

@benben2001, email bounced back. Requesting to confirm maintainer email

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing out the error with the email address. Indeed, there was a typo in the email provided. The correct email should be [email protected]. I have updated the static/bidder-info/melozen.yaml file with the correct information and pushed the changes to the PR. Please review the updated changes at your convenience. Thank you for your patience and assistance.

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 again to the correct address.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @gargcreation1992 ,

I have sent the "received" confirmation to the specified email address as requested. Please let me know if there's anything else needed from my side.

Thank you for your assistance.

Best,
MeloZen

Copy link
Contributor

Choose a reason for hiding this comment

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

received response from [email protected]

@@ -0,0 +1,137 @@
{
Copy link
Contributor

@onkarvhanumante onkarvhanumante Aug 1, 2024

Choose a reason for hiding this comment

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

as per static/bidder-info/melozen.yaml video media type is not supported for app.

should update bidder info yaml to support video media type

else can remove this json test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing out the omission of video media type support in the yaml configuration for both site and app. I have updated the bidder info in the yaml file to include video as a supported media type and have also added corresponding JSON tests (app-video.json and web-video.json) to ensure coverage. The PR has been updated accordingly. Please review the changes at your convenience. Thanks again for your guidance!


requestCopy := *request
for _, imp := range request.Imp {
// Extract Sharethrough Params
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: should be // Extract Melozen Params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback on the comment line. I've updated the comment to correctly reflect // Extract Melozen Params as suggested. The change is included in the latest commit.

Comment on lines 56 to 59
if strImpParams.PubId == "" {
return nil, []error{&errortypes.BadInput{
Message: "The publisher ID must not be empty",
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

PubId is mentioned as required ext param in bidder info yaml

Prebid core framework will ensure that PubId is present before invoking MakeRequests function

Therefore this check can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your suggestion. I've removed the check for PubId as it's already ensured by the Prebid core framework, as you pointed out. The code is now updated and simplified. The changes are included in the latest commit. Please review the updates when you have a moment.

Comment on lines 61 to 64
url, err := a.buildEndpointURL(strImpParams.PubId)
if err != nil {
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.

@benben2001 we are discarding entire request if PubId is not present for any single imp.

you could collect this error and continue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback. I have revised the code to not exit immediately on errors when building the endpoint URL, but instead to log these errors and continue with processing other imps. This should enhance the robustness of our adapter's error handling. I appreciate your guidance and please let me know if there are any further improvements needed.

Comment on lines +154 to +156
if impression.Banner == nil && impression.Native == nil && impression.Video == nil {
return nil, &errortypes.BadInput{Message: "Invalid MediaType. MeloZen only supports Banner, Video and Native."}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

as per static/bidder-info/melozen.yaml video media type is not supported for app.

should update bidder info yaml to support video media type or remove video check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback. I have updated the bidder-info/melozen.yaml file to reflect the correct media type support as suggested. The changes ensure that the video media type is appropriately handled. The updated configuration has been pushed to the PR. Please review the changes at your convenience. Thank you for guiding the improvements.

Comment on lines +171 to +176
if impression.Video != nil {
impCopy := *impression
impCopy.Banner = nil
impCopy.Native = nil
impressions = append(impressions, impCopy)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

as per static/bidder-info/melozen.yaml video media type is not supported for app.

should update bidder info yaml to support video media type or remove video check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing out the need to align our code with the supported media types defined in bidder-info/melozen.yaml. I have updated the handling of media types within our adapter to ensure consistency with our declared capabilities. The changes have been made in the latest commit. Please review the updates and let me know if further adjustments are required.

Copy link
Contributor

@onkarvhanumante onkarvhanumante left a comment

Choose a reason for hiding this comment

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

@benben2001 requesting to address open comments

Also should link the Bidder docs PR in PR description

1. Removed unnecessary code sections as per review suggestions.

2. Added JSON tests for better coverage.

3. Corrected errors in static/bidder-info/melozen.yaml.
Copy link

github-actions bot commented Aug 7, 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, aaf0f8f

melozen

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:23:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:36:	MakeRequests			64.1%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:102:	MakeBids			90.5%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:141:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:172:	getMediaTypeForBid		100.0%
total:									(statements)			82.2%

@benben2001
Copy link
Contributor Author

@onkarvhanumante Thank you for your guidance throughout the review process. I have addressed all open comments and made the necessary changes to the code as suggested. Additionally, I have updated the PR description to include a link to the Bidder documentation PR here for better context and completeness. Please let me know if there's anything else that needs to be revised or if further information is required.

endpointTemplate *template.Template
}

// Builder builds a new instance of the {bidder} adapter for the given bidder with the given config.
Copy link
Contributor

Choose a reason for hiding this comment

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

replace {bidder} with melozen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your helpful suggestion! I have updated the comment to specify "MeloZen" instead of "{bidder}" to clarify that this section is specifically designed for the MeloZen adapter. I appreciate your attention to detail and your patience as we refine the code. The updated comment has been pushed to the PR.

Copy link
Contributor

@onkarvhanumante onkarvhanumante left a comment

Choose a reason for hiding this comment

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

@benben2001 just one comment #3784 (comment). Good to merge after addressing it

Copy link

github-actions bot commented Aug 8, 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, 29cb5f7

melozen

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:23:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:36:	MakeRequests			64.1%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:102:	MakeBids			90.5%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:141:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/melozen/melozen.go:172:	getMediaTypeForBid		100.0%
total:									(statements)			82.2%

@gargcreation1992 gargcreation1992 merged commit 4f177ca into prebid:master Aug 12, 2024
5 checks passed
bevenio pushed a commit to tamedia-adtec/prebid-server that referenced this pull request Aug 22, 2024
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.

3 participants