Skip to content

New Adapter: Adagio#4300

Merged
bsardo merged 8 commits into
prebid:masterfrom
onfocusio:new-adapter-adagio
Jun 5, 2025
Merged

New Adapter: Adagio#4300
bsardo merged 8 commits into
prebid:masterfrom
onfocusio:new-adapter-adagio

Conversation

@GodefroiRoussel
Copy link
Copy Markdown
Contributor

@GodefroiRoussel GodefroiRoussel commented Apr 14, 2025

Here is the documentation: prebid/prebid.github.io#5993

Comment thread adapters/adagio/adagio.go
}

typedBid := &adapters.TypedBid{
Bid: &bid,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below

  for _, seatBid := range response.SeatBid {
    for i := range seatBids.Bid {
      ...
      responseBid := &adapters.TypedBid{
        Bid: &seatBids.Bid[i],
        ...
      }
      ...
      ...
    }
  }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 960575d

@github-actions
Copy link
Copy Markdown

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, 5ea96c2

adagio

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:22:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:29:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:54:	MakeBids	93.9%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:119:	checkNBRCode	83.3%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:138:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:154:	getBidExt	100.0%
total:									(statements)	91.8%

@github-actions
Copy link
Copy Markdown

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, 960575d

adagio

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:22:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:29:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:54:	MakeBids	94.1%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:121:	checkNBRCode	83.3%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:140:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:156:	getBidExt	100.0%
total:									(statements)	91.9%

endpointCompression: gzip
maintainer:
email: dev@adagio.io
gvlVendorID: 617
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

image
confirm

endpoint: "https://mp-REGION.4dex.io/pbserver"
endpointCompression: gzip
maintainer:
email: dev@adagio.io
Copy link
Copy Markdown
Collaborator

@przemkaczmarek przemkaczmarek Apr 30, 2025

Choose a reason for hiding this comment

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

image
verified

# - For AMER: las => (https://mp-las.4dex.io/pbserver)
# - For EMEA: ams => (https://mp-ams.4dex.io/pbserver)
# - For APAC: tyo => (https://mp-tyo.4dex.io/pbserver)
endpoint: "https://mp-REGION.4dex.io/pbserver"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have tried all 3 endpoints and always got error:
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's weird, when I make the same request that you do, I got another response:
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Our server is expecting our POST requests to have at least a Content-length header set (even if this value is 0).
You can update your command by using :

  • -H "Content-Length: 0"
  • or by using --data '' (curl will set by default a content-length by default to 0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it would become:
curl -i --location -H "Content-Length: 0" --request POST https://mp-ams.4dex.io/pbserver

or

curl -i --location --data '' --request POST https://mp-ams.4dex.io/pbserver

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

endpoint is reachable:
image

Comment thread openrtb_ext/imp_adagio.go Outdated
@@ -0,0 +1,9 @@
package openrtb_ext

// ExtImpAdagio defines the contract for bidrequest.imp[i].ext.prebid.bidder for Adagio
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unnecessary comment, please remove

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c55b565

Comment thread adapters/adagio/params_test.go Outdated
Comment on lines +10 to +14
// This file actually intends to test static/bidder-params/pubmatic.json
//
// These also validate the format of the external API: request.imp[i].ext.prebid.bidder.pubmatic

// TestValidParams makes sure that the adagio schema accepts all imp.ext fields which we intend to support.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please remove all unnecessary comments

Copy link
Copy Markdown
Contributor Author

@GodefroiRoussel GodefroiRoussel Apr 30, 2025

Choose a reason for hiding this comment

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

Fixed in c55b565

Comment thread adapters/adagio/params_test.go Outdated
`{"placement":"some-placement"}`,
`{"category":"some-category"}`,
`{"pagetype":"some-pagetype"}`,
`{"organizationId":"1000"}`,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same case as in line 58, maybe You wanted to use 1000 as int

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed that's what I wanted to test. Thanks for noticing it. Fixed in: c55b565

Comment thread adapters/adagio/adagio.go
return bidder, nil
}

func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the positive scenarios, you have tests for banner, video, and native. I don't see a multi-imp case.
Similarly, in the MakeRequests function, you are not iterating over the Imp array.
Why did you decide to do it this way? Was this intentional?
https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html#makerequests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the positive scenarios, you have tests for banner, video, and native. I don't see a multi-imp case.

You are right, the multi-imp & multi-format case in now available in commit: e79c185 .

Similarly, in the MakeRequests function, you are not iterating over the Imp array.
Why did you decide to do it this way? Was this intentional?

For now, we want the adapter to act solely as a pass-through, so we don't need to perform any operations on the request (and iterate over the imp array) and this was intentional.

@przemkaczmarek przemkaczmarek self-assigned this Apr 30, 2025
@github-actions
Copy link
Copy Markdown

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

adagio

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:22:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:29:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:54:	MakeBids	94.1%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:121:	checkNBRCode	83.3%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:140:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:156:	getBidExt	100.0%
total:									(statements)	91.9%

Comment thread adapters/adagio/adagio.go Outdated
}

func getBidType(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
// determinate media type by bid response field mtype
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

unnecessary comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 476a17c

Comment thread adapters/adagio/params_test.go Outdated
t.Errorf("Schema allowed unexpected params: %s", invalidParam)
}
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. TestValidParams
  2. TestInvalidParams
  3. validParams
  4. invalidParams
    this is the right order

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 476a17c

Comment thread adapters/adagio/adagio.go Outdated
Comment on lines +68 to +70
if err := checkNBRCode(bidResponse.NBR); err != nil {
return nil, []error{err}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is unnecessary because in the buildBidResponse function we check the NBR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 00915d8

@przemkaczmarek
Copy link
Copy Markdown
Collaborator

@bsardo except endpoint in yaml LGTH. For rest I left comments

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2025

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, 00915d8

adagio

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:21:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:28:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:52:	MakeBids	93.8%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:115:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:130:	getBidExt	100.0%
total:									(statements)	92.6%

przemkaczmarek
przemkaczmarek previously approved these changes May 6, 2025
ccorbo
ccorbo previously approved these changes May 7, 2025
# - For AMER: las => (https://mp-las.4dex.io/pbserver)
# - For EMEA: ams => (https://mp-ams.4dex.io/pbserver)
# - For APAC: tyo => (https://mp-tyo.4dex.io/pbserver)
endpoint: "https://mp-REGION.4dex.io/pbserver"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @GodefroiRoussel. Your adapter looks good. I have just one change that needs to be made. Your adapter needs to work out-of-the-box and since you haven't set endpoint to a working URL, you either need to disable your adapter by adding a disabled: true annotation here similar to what Rubicon and mgidx have done, or you can keep it enabled and set endpoint to a valid URL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment @bsardo , we've made the decision to add the disabled: true, you'll find it in 12feaf4

@GodefroiRoussel GodefroiRoussel dismissed stale reviews from ccorbo and przemkaczmarek via 12feaf4 June 3, 2025 15:31
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

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, 12feaf4

adagio

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:21:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:28:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:52:	MakeBids	93.8%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:115:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:130:	getBidExt	100.0%
total:									(statements)	92.6%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

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

adagio

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:21:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:28:	MakeRequests	80.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:52:	MakeBids	93.8%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:115:	getBidType	100.0%
github.com/prebid/prebid-server/v3/adapters/adagio/adagio.go:130:	getBidExt	100.0%
total:									(statements)	92.6%

@bsardo bsardo merged commit 9397524 into prebid:master Jun 5, 2025
6 checks passed
shunj-nb pushed a commit to ParticleMedia/prebid-server that referenced this pull request Jun 13, 2025
prnvgupta pushed a commit to automatad/prebid-server that referenced this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants