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: ResetDigital #3766

Open
wants to merge 82 commits into
base: master
Choose a base branch
from
Open

Conversation

bruno-siira
Copy link

This PR adds a new adapter for Reset Digital to the Prebid Server (Go version). The adapter enables Prebid Server to communicate with Reset Digital for real-time advertising auctions.

Changes:

Added the Reset Digital adapter in adapters/resetdigital/.
Implemented necessary methods for the adapter.
Added unit tests for the adapter in adapters/resetdigital/resetdigital_test.go.
Updated the documentation to include the configuration for the Reset Digital adapter.
Testing:

Unit tests have been written and verified to ensure the adapter works correctly.
Manual testing has been performed to verify the integration with Reset Digital.

Notes:

This system is based on single bid, so it's based on that premise.

Related Issues:

}

func getBidType(imp openrtb2.Imp) (openrtb_ext.BidType, error) {
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.

Copy link
Author

Choose a reason for hiding this comment

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

Implemented as suggested

Copy link
Contributor

Choose a reason for hiding this comment

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

Implemented as suggested

could you point out or link where MType changes are implemented?

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, it was addressed on the point that we support only single format bids, so we could assume the anti pattern. Anyway, it would be more advisable to change to the normal pattern?

Copy link
Contributor

Choose a reason for hiding this comment

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

Anyway, it would be more advisable to change to the normal pattern?

Prebid team recommends using MType field. But if it's not doable then current change suffices single format bid. @bruno-siira should mention in Bidder docs that adapter expects only single format bids in the incoming request

Copy link
Author

Choose a reason for hiding this comment

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

When we're talking about the Bidder Docs what is this file exacly @onkarvhanumante

Copy link
Contributor

Choose a reason for hiding this comment

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

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

resetdigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:57:	Builder			0.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:69:	getHeaders		100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:86:	addNonEmptyHeaders	100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:94:	getReferer		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:102:	getCurrency		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:110:	MakeRequests		72.2%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:151:	processDataFromRequest	94.4%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:186:	MakeBids		72.2%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:222:	getBidFromResponse	93.3%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:257:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:264:	getBidType		28.6%
total:										(statements)		74.2%

Implementation of suggestions
Copy link

github-actions bot commented Jul 3, 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, 989c565

resetdigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:57:	Builder			0.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:69:	getHeaders		100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:86:	addNonEmptyHeaders	100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:94:	getReferer		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:102:	getCurrency		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:110:	MakeRequests		72.2%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:151:	processDataFromRequest	94.4%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:186:	MakeBids		78.9%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:222:	getBidFromResponse	92.3%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:255:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:262:	getBidType		28.6%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:274:	getBidTypes		70.0%
total:										(statements)		74.5%

Copy link
Author

@bruno-siira bruno-siira left a comment

Choose a reason for hiding this comment

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

We have now a Builder

Copy link
Author

@bruno-siira bruno-siira left a comment

Choose a reason for hiding this comment

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

There is a schema now

Copy link

github-actions bot commented Jul 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, 4482bc9

resetdigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:55:	Builder			0.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:67:	getHeaders		100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:84:	addNonEmptyHeaders	100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:92:	getReferer		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:100:	getCurrency		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:108:	MakeRequests		72.2%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:149:	processDataFromRequest	94.4%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:184:	MakeBids		78.9%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:220:	getBidFromResponse	92.3%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:253:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:260:	getBidType		28.6%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:272:	getBidTypes		70.0%
total:										(statements)		74.5%

@onkarvhanumante onkarvhanumante self-assigned this Jul 9, 2024
@bsardo
Copy link
Collaborator

bsardo commented Nov 5, 2024

I'm not sure what happened here but something went awry when you merged with master as nearly every file is showing as modified. Please fix and resubmit.

@bruno-siira bruno-siira changed the base branch from master to new-Addapter-Generic November 8, 2024 18:17
@bruno-siira bruno-siira changed the base branch from new-Addapter-Generic to master November 8, 2024 18:19
@dirk-rd
Copy link

dirk-rd commented Nov 12, 2024

@bsardo , I think that this PR is ready for review again. But, please let me know if you have additional requests before you can review it again.

Comment on lines 12 to 13
key: resetdigital
supportCors: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can delete key and supportCors.

key: resetdigital
supportCors: false
redirect:
url: https://sync.resetdigital.co/csync?pid=rubicon&redir={{redirect_url}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your redirect macro is incorrect. I also see pid=rubicon in your URL which I assume is a typo. Perhaps your url should look like this?
https://sync.resetdigital.co/csync?redir={{.RedirectURL}}

@@ -0,0 +1,16 @@
endpoint: http://b-us-east14.resetdigital.co:9001
Copy link
Collaborator

Choose a reason for hiding this comment

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

Endpoint is reachable.

curl -i --location --request POST http://b-us-east14.resetdigital.co:9001
HTTP/1.1 400 Bad Request
Content-Length: 0
Content-Type: text/html
Date: Wed, 13 Nov 2024 17:48:14 GMT
Server: Kestrel
Accept-Ranges: bytes
Cache-Control: no-cache, no-store, must-revalidate

@@ -0,0 +1,16 @@
endpoint: http://b-us-east14.resetdigital.co:9001
maintainer:
email: [email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We've sent an email to this email address. Please respond to the email with "Confirmed".

- banner
- video
- audio
gvlVendorID: 1162
Copy link
Collaborator

Choose a reason for hiding this comment

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

Verified GVL ID:

curl https://vendor-list.consensu.org/v3/vendor-list.json | jq '.vendors."1162"'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  640k  100  640k    0     0  1314k      0 --:--:-- --:--:-- --:--:-- 1311k
{
  "id": 1162,
  "name": "Reset Digital Europe Ltd",
  "purposes": [
    1,
    3,
    4,
    5,
    6
  ],
  "legIntPurposes": [
    2,
    7,
    8,
    9,
    10
  ],
  "flexiblePurposes": [
    2,
    7,
    8,
    9,
    10
  ],
  "specialPurposes": [
    1,
    2
  ],
  "features": [
    2,
    3
  ],
  "specialFeatures": [
    1,
    2
  ],
  "cookieMaxAgeSeconds": 31536000,
  "usesCookies": true,
  "cookieRefresh": true,
  "urls": [
    {
      "langId": "en",
      "privacy": "https://resetdigital.co/policies.html",
      "legIntClaim": "https://resetdigital.co/policies.html"
    }
  ],
  "usesNonCookieAccess": false,
  "dataRetention": {
    "stdRetention": 365,
    "purposes": {},
    "specialPurposes": {}
  },
  "dataDeclaration": [
    1,
    3,
    8
  ],
  "deviceStorageDisclosureUrl": "https://resetdigital.co/GDPR-TCF.json"
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update your file name from invalid_media_def.json to invalid-media-def.json.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update your file name from invalid_placement_id.json to invalid-placement-id.json.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update your file name from invalid_video_dim.json to invalid-video-dim.json.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update your file name from multi_format.json to multi-format.json.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update your file name from unknown_media.json to unknown-media.json.

Copy link

github-actions bot commented Dec 2, 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, ef65f7b

resetdigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:67:	Builder			80.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:78:	getHeaders		100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:103:	addNonEmptyHeaders	100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:111:	MakeRequests		87.5%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:148:	processDataFromRequest	97.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:219:	MakeBids		81.5%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:273:	getBidFromResponse	80.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:298:	getBidType		100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:310:	GetMediaTypeForImp	87.5%
total:										(statements)		89.7%


func GetMediaTypeForImp(reqImp openrtb2.Imp) (openrtb_ext.BidType, error) {

if reqImp.Video != nil {
Copy link

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

github-actions bot commented Dec 4, 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, 6bac6cd

resetdigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:67:	Builder			80.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:78:	getHeaders		100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:103:	addNonEmptyHeaders	100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:111:	MakeRequests		87.5%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:149:	processDataFromRequest	97.1%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:209:	MakeBids		88.9%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:261:	getBidFromResponse	100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:286:	getBidType		100.0%
github.com/prebid/prebid-server/v3/adapters/resetdigital/resetdigital.go:298:	GetMediaTypeForImp	100.0%
total:										(statements)		93.9%

if reqImp.Video != nil {
return openrtb_ext.BidTypeVideo, nil
}
if reqImp.Audio != nil {
Copy link

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.BidTypeAudio, 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.

@dirk-rd
Copy link

dirk-rd commented Dec 7, 2024

@BrunoJacinto, I think this PR is ready for another review, please.

@bruno-siira
Copy link
Author

@BrunoJacinto, I think this PR is ready for another review, please.

Ok Dirk, I'll review it from my part.

@dirk-rd
Copy link

dirk-rd commented Dec 10, 2024

Ugh, I tagged Bruno instead of Brian. I meant to let @bsardo know that the PR is ready for another review.

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.

7 participants