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 #3452

Closed
wants to merge 17 commits into from
Closed

Conversation

bruno-siira
Copy link

New adapter for ResetDigital on Go

Copy link

github-actions bot commented Feb 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, 70de190

resetdigital

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:56:	Builder			0.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:68:	getHeaders		100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:85:	addNonEmptyHeaders	100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:93:	getReferer		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:101:	getCurrency		100.0%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:109:	MakeRequests		72.2%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:150:	processDataFromRequest	90.9%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:171:	MakeBids		72.2%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:207:	getBidFromResponse	93.8%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:243:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:250:	getBidType		28.6%
total:										(statements)		73.6%

Copy link

github-actions bot commented Feb 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, dd48470

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		100.0%
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.8%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:258:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:265:	getBidType		28.6%
total:										(statements)		75.5%

Copy link

github-actions bot commented Feb 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, 32551fc

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		100.0%
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.8%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:258:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:265:	getBidType		28.6%
total:										(statements)		75.5%

@onkarvhanumante
Copy link
Contributor

onkarvhanumante commented Feb 8, 2024

@bruno-siira

PR tests are failing. Should push change to fix

server/v2/exchange.TestExtraBidWithMultiCurrencies.func1 (bidder_test.go:2990)
--- FAIL: TestNewExchange (0.01s)
    exchange_test.go:89: NewExchange produced an Exchange without bidder resetdigital
E0207 18:20:15.140596   34687 exchange.go:817] OpenRTB auction recovered panic from Bidder appnexus: panic!. Account id: test1, All Bidders: bidder1,bidder2, Stack trace is: goroutine 978 [running]:

Additionally, bidder-params and bidder-info files are missing. These are required files.

Refer

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Appnexus Adapter Params",
"description": "A schema which validates params accepted by the AppNexus adapter",
"type": "object",
"properties": {
"placement_id": {
"type": ["integer", "string"],
"description": "An ID which identifies this placement of the impression"
},
"placementId": {
"type": ["integer", "string"],
"description": "Deprecated, use placement_id instead."
},
"inv_code": {
"type": "string",
"description": "A code identifying the inventory of this placement."
},
"invCode": {
"type": "string",
"description": "Deprecated, use inv_code instead."
},
"member": {
"type": "string",
"description": "An ID which identifies the member selling the impression."
},
"keywords": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "A key with one or more values associated with it. These are used in buy-side segment targeting.",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
},
"required": ["key"]
}
},
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
]
},
"traffic_source_code": {
"type": "string",
"description": "Specifies the third-party source of this impression."
},
"trafficSourceCode": {
"type": "string",
"description": "Deprecated, use traffic_source_code instead."
},
"reserve": {
"type": "number",
"description": "The minimium acceptable bid, in CPM, using US Dollars"
},
"position": {
"type": "string",
"enum": ["above", "below"],
"description": "Specifies the ad unit as above or below the fold"
},
"use_pmt_rule": {
"type": "boolean",
"description": "Boolean to signal AppNexus to apply the relevant payment rule"
},
"use_payment_rule": {
"type": "boolean",
"description": "Deprecated, Boolean to signal AppNexus to apply the relevant payment rule. use_pmt_rule will get precedence over usePaymentRule."
},
"generate_ad_pod_id": {
"type": "boolean",
"description": "Boolean to signal AppNexus to add ad pod id to each request"
},
"private_sizes" :{
"type": "array",
"items": {
"type": "object",
"properties": {
"w": { "type": "integer" },
"h": { "type": "integer" }
},
"required": [ "w", "h"]
},
"description": "Private sizes (ex: [{\"w\": 300, \"h\": 250},{...}]), experimental, may not be supported."
},
"ext_inv_code" : {
"type": "string",
"description": "Specifies predefined value passed on the query string that can be used in reporting"
},
"external_imp_id" : {
"type": "string",
"description": "Unique identifier of an externally generated auction"
}
},
"oneOf": [{
"oneOf": [{
"required": ["placementId"]
}, {
"required": ["placement_id"]
}]
}, {
"oneOf": [{
"required": ["invCode", "member"]
}, {
"required": ["inv_code", "member"]
}]
}],
"not": {
"required": ["placementId", "invCode", "member"]
}
}
and
endpoint: "http://ib.adnxs.com/openrtb2"
platform_id: "5"
maintainer:
email: "[email protected]"
gvlVendorID: 32
capabilities:
app:
mediaTypes:
- banner
- video
- native
site:
mediaTypes:
- banner
- video
- native
userSync:
key: "adnxs"
redirect:
url: "https://ib.adnxs.com/getuid?{{.RedirectURL}}"
userMacro: "$UID"
as examples

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

Choose a reason for hiding this comment

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

adapters/resetdigital/resetdigitaltest/examplary/simple-banner.json is not being referred by unit tests added in resetdigital_test.go

Additionally, should add supplemental tests as well. Refer appnexus adapter as example - https://github.com/prebid/prebid-server/blob/dd07431ef54c38a2617c04e76b3e7bda9c21f569/adapters/appnexus

"github.com/stretchr/testify/assert"
)

func TestMakeRequests(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommended to use JSON test framework to test MakeRequest

assert.Equal(t, 1, len(reqs), "Unexpected number of HTTP requests. Got %d. Expected %d", len(reqs), 1)
}

func TestMakeBids(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommended to use JSON test framework to test MakeBids

Comment on lines 3 to 7
type ExtResetDigital struct {
cid string `json:"bid_id"`
crid string `json:"imp_id"`
adid string `json:"adid"`
}
Copy link
Contributor

@onkarvhanumante onkarvhanumante Feb 8, 2024

Choose a reason for hiding this comment

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

should add corresponding bidder-params.json file for ExtResetDigital

@onkarvhanumante
Copy link
Contributor

onkarvhanumante commented Feb 8, 2024

@bruno-siira should create docs PR in https://github.com/prebid/prebid.github.io repo. This PR is needed for include ResetDigital on prebid server docs - https://prebid.org/product-suite/prebid-server/

Additionally, refer https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html#prebid-server---new-bid-adapter-go for guidelines to add new adapter in PBS-GO repo

Copy link

github-actions bot commented Feb 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, 125124b

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		100.0%
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.8%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:258:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:265:	getBidType		28.6%
total:										(statements)		75.5%

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

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		100.0%
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.8%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:258:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:265:	getBidType		28.6%
total:										(statements)		75.5%

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, 0b44384

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		100.0%
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.8%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:258:	getBidPrice		66.7%
github.com/prebid/prebid-server/v2/adapters/resetdigital/resetdigital.go:265:	getBidType		28.6%
total:										(statements)		75.5%

@Sonali-More-Xandr
Copy link
Contributor

@bruno-siira

PR tests are failing. Should push change to fix

server/v2/exchange.TestExtraBidWithMultiCurrencies.func1 (bidder_test.go:2990)
--- FAIL: TestNewExchange (0.01s)
    exchange_test.go:89: NewExchange produced an Exchange without bidder resetdigital
E0207 18:20:15.140596   34687 exchange.go:817] OpenRTB auction recovered panic from Bidder appnexus: panic!. Account id: test1, All Bidders: bidder1,bidder2, Stack trace is: goroutine 978 [running]:

Additionally, bidder-params and bidder-info files are missing. These are required files.

Refer

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Appnexus Adapter Params",
"description": "A schema which validates params accepted by the AppNexus adapter",
"type": "object",
"properties": {
"placement_id": {
"type": ["integer", "string"],
"description": "An ID which identifies this placement of the impression"
},
"placementId": {
"type": ["integer", "string"],
"description": "Deprecated, use placement_id instead."
},
"inv_code": {
"type": "string",
"description": "A code identifying the inventory of this placement."
},
"invCode": {
"type": "string",
"description": "Deprecated, use inv_code instead."
},
"member": {
"type": "string",
"description": "An ID which identifies the member selling the impression."
},
"keywords": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "A key with one or more values associated with it. These are used in buy-side segment targeting.",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
},
"required": ["key"]
}
},
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
]
},
"traffic_source_code": {
"type": "string",
"description": "Specifies the third-party source of this impression."
},
"trafficSourceCode": {
"type": "string",
"description": "Deprecated, use traffic_source_code instead."
},
"reserve": {
"type": "number",
"description": "The minimium acceptable bid, in CPM, using US Dollars"
},
"position": {
"type": "string",
"enum": ["above", "below"],
"description": "Specifies the ad unit as above or below the fold"
},
"use_pmt_rule": {
"type": "boolean",
"description": "Boolean to signal AppNexus to apply the relevant payment rule"
},
"use_payment_rule": {
"type": "boolean",
"description": "Deprecated, Boolean to signal AppNexus to apply the relevant payment rule. use_pmt_rule will get precedence over usePaymentRule."
},
"generate_ad_pod_id": {
"type": "boolean",
"description": "Boolean to signal AppNexus to add ad pod id to each request"
},
"private_sizes" :{
"type": "array",
"items": {
"type": "object",
"properties": {
"w": { "type": "integer" },
"h": { "type": "integer" }
},
"required": [ "w", "h"]
},
"description": "Private sizes (ex: [{\"w\": 300, \"h\": 250},{...}]), experimental, may not be supported."
},
"ext_inv_code" : {
"type": "string",
"description": "Specifies predefined value passed on the query string that can be used in reporting"
},
"external_imp_id" : {
"type": "string",
"description": "Unique identifier of an externally generated auction"
}
},
"oneOf": [{
"oneOf": [{
"required": ["placementId"]
}, {
"required": ["placement_id"]
}]
}, {
"oneOf": [{
"required": ["invCode", "member"]
}, {
"required": ["inv_code", "member"]
}]
}],
"not": {
"required": ["placementId", "invCode", "member"]
}
}

and

endpoint: "http://ib.adnxs.com/openrtb2"
platform_id: "5"
maintainer:
email: "[email protected]"
gvlVendorID: 32
capabilities:
app:
mediaTypes:
- banner
- video
- native
site:
mediaTypes:
- banner
- video
- native
userSync:
key: "adnxs"
redirect:
url: "https://ib.adnxs.com/getuid?{{.RedirectURL}}"
userMacro: "$UID"

as examples

@bruno-siira Please add bidder-params and bidder-info files. Refer examples provided above.

@onkarvhanumante
Copy link
Contributor

@bruno-siira ple

@bruno-siira

PR tests are failing. Should push change to fix

server/v2/exchange.TestExtraBidWithMultiCurrencies.func1 (bidder_test.go:2990)
--- FAIL: TestNewExchange (0.01s)
    exchange_test.go:89: NewExchange produced an Exchange without bidder resetdigital
E0207 18:20:15.140596   34687 exchange.go:817] OpenRTB auction recovered panic from Bidder appnexus: panic!. Account id: test1, All Bidders: bidder1,bidder2, Stack trace is: goroutine 978 [running]:

Additionally, bidder-params and bidder-info files are missing. These are required files.

Refer

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Appnexus Adapter Params",
"description": "A schema which validates params accepted by the AppNexus adapter",
"type": "object",
"properties": {
"placement_id": {
"type": ["integer", "string"],
"description": "An ID which identifies this placement of the impression"
},
"placementId": {
"type": ["integer", "string"],
"description": "Deprecated, use placement_id instead."
},
"inv_code": {
"type": "string",
"description": "A code identifying the inventory of this placement."
},
"invCode": {
"type": "string",
"description": "Deprecated, use inv_code instead."
},
"member": {
"type": "string",
"description": "An ID which identifies the member selling the impression."
},
"keywords": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "A key with one or more values associated with it. These are used in buy-side segment targeting.",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
},
"required": ["key"]
}
},
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
]
},
"traffic_source_code": {
"type": "string",
"description": "Specifies the third-party source of this impression."
},
"trafficSourceCode": {
"type": "string",
"description": "Deprecated, use traffic_source_code instead."
},
"reserve": {
"type": "number",
"description": "The minimium acceptable bid, in CPM, using US Dollars"
},
"position": {
"type": "string",
"enum": ["above", "below"],
"description": "Specifies the ad unit as above or below the fold"
},
"use_pmt_rule": {
"type": "boolean",
"description": "Boolean to signal AppNexus to apply the relevant payment rule"
},
"use_payment_rule": {
"type": "boolean",
"description": "Deprecated, Boolean to signal AppNexus to apply the relevant payment rule. use_pmt_rule will get precedence over usePaymentRule."
},
"generate_ad_pod_id": {
"type": "boolean",
"description": "Boolean to signal AppNexus to add ad pod id to each request"
},
"private_sizes" :{
"type": "array",
"items": {
"type": "object",
"properties": {
"w": { "type": "integer" },
"h": { "type": "integer" }
},
"required": [ "w", "h"]
},
"description": "Private sizes (ex: [{\"w\": 300, \"h\": 250},{...}]), experimental, may not be supported."
},
"ext_inv_code" : {
"type": "string",
"description": "Specifies predefined value passed on the query string that can be used in reporting"
},
"external_imp_id" : {
"type": "string",
"description": "Unique identifier of an externally generated auction"
}
},
"oneOf": [{
"oneOf": [{
"required": ["placementId"]
}, {
"required": ["placement_id"]
}]
}, {
"oneOf": [{
"required": ["invCode", "member"]
}, {
"required": ["inv_code", "member"]
}]
}],
"not": {
"required": ["placementId", "invCode", "member"]
}
}

and

endpoint: "http://ib.adnxs.com/openrtb2"
platform_id: "5"
maintainer:
email: "[email protected]"
gvlVendorID: 32
capabilities:
app:
mediaTypes:
- banner
- video
- native
site:
mediaTypes:
- banner
- video
- native
userSync:
key: "adnxs"
redirect:
url: "https://ib.adnxs.com/getuid?{{.RedirectURL}}"
userMacro: "$UID"

as examples

@bruno-siira PTAL at above comment to fix failing test case

@bruno-siira
Copy link
Author

@bruno-siira ple

@bruno-siira
PR tests are failing. Should push change to fix

server/v2/exchange.TestExtraBidWithMultiCurrencies.func1 (bidder_test.go:2990)
--- FAIL: TestNewExchange (0.01s)
    exchange_test.go:89: NewExchange produced an Exchange without bidder resetdigital
E0207 18:20:15.140596   34687 exchange.go:817] OpenRTB auction recovered panic from Bidder appnexus: panic!. Account id: test1, All Bidders: bidder1,bidder2, Stack trace is: goroutine 978 [running]:

Additionally, bidder-params and bidder-info files are missing. These are required files.
Refer

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Appnexus Adapter Params",
"description": "A schema which validates params accepted by the AppNexus adapter",
"type": "object",
"properties": {
"placement_id": {
"type": ["integer", "string"],
"description": "An ID which identifies this placement of the impression"
},
"placementId": {
"type": ["integer", "string"],
"description": "Deprecated, use placement_id instead."
},
"inv_code": {
"type": "string",
"description": "A code identifying the inventory of this placement."
},
"invCode": {
"type": "string",
"description": "Deprecated, use inv_code instead."
},
"member": {
"type": "string",
"description": "An ID which identifies the member selling the impression."
},
"keywords": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"description": "A key with one or more values associated with it. These are used in buy-side segment targeting.",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
},
"required": ["key"]
}
},
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
]
},
"traffic_source_code": {
"type": "string",
"description": "Specifies the third-party source of this impression."
},
"trafficSourceCode": {
"type": "string",
"description": "Deprecated, use traffic_source_code instead."
},
"reserve": {
"type": "number",
"description": "The minimium acceptable bid, in CPM, using US Dollars"
},
"position": {
"type": "string",
"enum": ["above", "below"],
"description": "Specifies the ad unit as above or below the fold"
},
"use_pmt_rule": {
"type": "boolean",
"description": "Boolean to signal AppNexus to apply the relevant payment rule"
},
"use_payment_rule": {
"type": "boolean",
"description": "Deprecated, Boolean to signal AppNexus to apply the relevant payment rule. use_pmt_rule will get precedence over usePaymentRule."
},
"generate_ad_pod_id": {
"type": "boolean",
"description": "Boolean to signal AppNexus to add ad pod id to each request"
},
"private_sizes" :{
"type": "array",
"items": {
"type": "object",
"properties": {
"w": { "type": "integer" },
"h": { "type": "integer" }
},
"required": [ "w", "h"]
},
"description": "Private sizes (ex: [{\"w\": 300, \"h\": 250},{...}]), experimental, may not be supported."
},
"ext_inv_code" : {
"type": "string",
"description": "Specifies predefined value passed on the query string that can be used in reporting"
},
"external_imp_id" : {
"type": "string",
"description": "Unique identifier of an externally generated auction"
}
},
"oneOf": [{
"oneOf": [{
"required": ["placementId"]
}, {
"required": ["placement_id"]
}]
}, {
"oneOf": [{
"required": ["invCode", "member"]
}, {
"required": ["inv_code", "member"]
}]
}],
"not": {
"required": ["placementId", "invCode", "member"]
}
}

and

endpoint: "http://ib.adnxs.com/openrtb2"
platform_id: "5"
maintainer:
email: "[email protected]"
gvlVendorID: 32
capabilities:
app:
mediaTypes:
- banner
- video
- native
site:
mediaTypes:
- banner
- video
- native
userSync:
key: "adnxs"
redirect:
url: "https://ib.adnxs.com/getuid?{{.RedirectURL}}"
userMacro: "$UID"

as examples

@bruno-siira PTAL at above comment to fix failing test case

Hello,

Were trying to push today a new fix, this is blocked on the auto test from the main, I'll check that link you sent.

Comment on lines +187 to +195
if response.StatusCode == http.StatusNoContent {
return nil, nil
}
if response.StatusCode == http.StatusBadRequest {
return nil, nil
}
if response.StatusCode != http.StatusOK {
return nil, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

could make use of response util here

func CheckResponseStatusCodeForErrors(response *ResponseData) error {
if response.StatusCode == http.StatusBadRequest {
return &errortypes.BadInput{
Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info", response.StatusCode),
}
}
if response.StatusCode != http.StatusOK {
return &errortypes.BadServerResponse{
Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info", response.StatusCode),
}
}
return nil
}
func IsResponseStatusCodeNoContent(response *ResponseData) bool {
return response.StatusCode == http.StatusNoContent
}

Comment on lines +201 to +204
//check no bids
jsonData := make(map[string]interface{})

json.Unmarshal([]byte(response.Body), &jsonData)
Copy link
Contributor

Choose a reason for hiding this comment

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

missing error check for json.Unmarshal

{
"mockBidRequest": {
"id": "12345",
"imp": [
Copy link
Contributor

Choose a reason for hiding this comment

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

should update or add json test:

  • to have request with multiple imps
  • to have multi-format imp request

Copy link
Author

Choose a reason for hiding this comment

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

By standard our solution works with single impressions. Should we adapt this? Or add a test to it to do it that way?

Copy link
Contributor

@onkarvhanumante onkarvhanumante Apr 15, 2024

Choose a reason for hiding this comment

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

By standard our solution works with single impressions. Should we adapt this? Or add a test to it to do it that way?

If solution works with single impressions then should explicitly mention this behaviour in bidder docs. So that request inclues only one impression.

@bruno-siira additionally lets us know your thoughts on adding json test for multi-format imp request

Copy link
Author

Choose a reason for hiding this comment

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

So the solution here is to make it explicit on the docs that is single impression on docs? What should be the doc to use @onkarvhanumante ?

Copy link
Contributor

Choose a reason for hiding this comment

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

So the solution here is to make it explicit on the docs that is single impression on docs? What should be the doc to use @onkarvhanumante ?

Raise docs PR. Refer prebid/prebid.github.io#5331 as example

@@ -0,0 +1,21 @@
adapters:
resetdigital:
endpoint: http://b-us-east14.resetdigital.co:9001
Copy link
Contributor

Choose a reason for hiding this comment

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

@bruno-siira is it possible to use standard http or https port i.e http(s)://b-us-east14.resetdigital.co instead of 9001

Copy link
Author

Choose a reason for hiding this comment

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

If necessary yes, but its a practice for this kind of our servers. It's needed for the approval?

Copy link
Contributor

Choose a reason for hiding this comment

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

if possible then should use standard http or https port

Copy link
Author

Choose a reason for hiding this comment

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

We have a situation where the only server that we have that supports the Forced Bid is not with the standard port. We have now server with that standard port but doesn't allow the forced bidder so it can't pass the auto test. Any idea to solve this @onkarvhanumante ?

Copy link
Contributor

@onkarvhanumante onkarvhanumante May 24, 2024

Choose a reason for hiding this comment

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

We have a situation where the only server that we have that supports the Forced Bid is not with the standard port. We have now server with that standard port but doesn't allow the forced bidder so it can't pass the auto test. Any idea to solve this @onkarvhanumante ?

I am not sure how to resolve it.

@Sonali-More-Xandr @gargcreation1992 any suggestions

              no need to include `required` if its empty

_Originally posted by @onkarvhanumante in prebid#3452 (comment)
@onkarvhanumante
Copy link
Contributor

@bruno-siira PR has few unaddressed comments. PTAL

Copy link

github-actions bot commented May 6, 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, 86206d7

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%

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, 3fc5455

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%

@onkarvhanumante
Copy link
Contributor

@bruno-siira closing this PR. You can open PR after addressing the open comments

bruno-siira added a commit to bruno-siira/prebid-server that referenced this pull request Nov 4, 2024
              no need to include `required` if its empty

_Originally posted by @onkarvhanumante in prebid#3452 (comment)
bruno-siira pushed a commit to bruno-siira/prebid-server that referenced this pull request Nov 4, 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.

5 participants