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: RoundhouseAds #4037

Conversation

juliansalinas121
Copy link

New Adapter: RoundhouseAds with v3 compatibility

Copy link

github-actions bot commented Nov 5, 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, c3c68cc

roundhouseads

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/roundhouseads/roundhouseads.go:29:	MakeRequests	100.0%
github.com/prebid/prebid-server/v3/adapters/roundhouseads/roundhouseads.go:102:	getPublisherId	90.0%
github.com/prebid/prebid-server/v3/adapters/roundhouseads/roundhouseads.go:122:	MakeBids	100.0%
github.com/prebid/prebid-server/v3/adapters/roundhouseads/roundhouseads.go:160:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/roundhouseads/roundhouseads.go:173:	Builder		91.7%
total:										(statements)	97.7%


maintainer:
email: "[email protected]"
#gvlVendorID: 42 #need assigned ID
Copy link
Contributor

Choose a reason for hiding this comment

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

Please resolve this todo item.

userSync:
# Roundhouseads supports user syncing, but requires configuration by the host. Contact a technical account manager
# or this bidder directly at the email address in this file to ask about enabling user sync.
endpointCompression: gzip
Copy link
Contributor

Choose a reason for hiding this comment

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

endpointCompression is not a member of userSync Please move this out of the userSync section.

"properties": {
"publisherId": {
"type": "string",
"description": "An ID which identifies the publisher"
Copy link
Contributor

Choose a reason for hiding this comment

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

It's common to specify a minimum length of 1 to filter out empty strings.

@@ -5,6 +5,7 @@ go 1.21
retract v3.0.0 // Forgot to update major version in import path and module name

require (
github.com/51Degrees/device-detection-go/v4 v4.4.35
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious what caused these changes. I don't expect go.mod / go.sum changes in an adapter PR.

`{}`,
`{"publisherId": 123456}`,
`{"publisherId": 0}`,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a {"publisherId": null} case as well.

modifiedImps = append(modifiedImps, imp)
}

request.Imp = modifiedImps
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: You're making a new imp slice and then setting that back to the request. You can edit the imps directly instead to avoid the extra allocations.

if err != nil {
errs = append(errs, err)
return nil, errs
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not preallocate an errors slice. It's only used on line 86, which can be converted to:

return nil, []error{err}

Body: reqJSON,
Headers: headers,
ImpIDs: openrtb_ext.GetImpIDs(request.Imp),
}}, errs
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not possible in this code for there to be an error at this point. Please hardcode a nil return.

}

if roundhouseadsExt.PublisherId != "" {
return roundhouseadsExt.PublisherId, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Please clearly indicate in your accompanying prebid.github.io PR that only the first impression publisher is used and the rest are ignored.

if !isValidEndpoint || err != nil {
return nil, errors.New("ExtraAdapterInfo must be a simple string provided by Roundhouseads")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can your adapter run successfully if there is no extra adapter info provided?

@bsardo bsardo changed the title New Adapter: RoundhouseAds with v3 compatibility New Adapter: RoundhouseAds Dec 11, 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.

2 participants