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: BoldwinX #3430

Merged
merged 7 commits into from
Feb 19, 2024
Merged

New adapter: BoldwinX #3430

merged 7 commits into from
Feb 19, 2024

Conversation

bold-win
Copy link
Contributor

@bold-win bold-win commented Jan 26, 2024

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

bwx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:29:	Builder				80.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:42:	buildEndpointFromRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:65:	MakeRequests			89.5%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:102:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:131:	prepareBidResponse		100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:153:	getMediaTypeForBid		100.0%
total:								(statements)			94.9%

adapters/bwx/bwx.go Outdated Show resolved Hide resolved
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, 2610848

bwx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:29:	Builder				80.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:42:	buildEndpointFromRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:65:	MakeRequests			89.5%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:102:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:131:	prepareBidResponse		100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:153:	getMediaTypeForBid		100.0%
total:								(statements)			94.9%

bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(seats))

for _, seatBid := range seats {
for bidId, bid := range seatBid.Bid {
Copy link
Contributor

Choose a reason for hiding this comment

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

bidId is actually index of loop iteration. Should consider renaming it to i or idx or index to avoid confusion between bidId and loop index

Comment on lines 161 to 163
default:
return "", fmt.Errorf("failed to parse bid mtype for impression id \"%s\"", bid.ImpID)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should also include received mtype in error message.

@@ -0,0 +1,19 @@
endpoint: "http://rtb.boldwin.live?pid={{.SourceId}}&host={{.Host}}&pbs=1"
Copy link
Contributor

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://rtb.boldwin.live?pid=12&host=1&pbs=1'
HTTP/1.1 400 Bad Request

@@ -0,0 +1,19 @@
endpoint: "http://rtb.boldwin.live?pid={{.SourceId}}&host={{.Host}}&pbs=1"
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 an email to verify specified maintainer's email address. Requesting to reply back on email with "received" message

Copy link
Contributor

Choose a reason for hiding this comment

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

email verified.

Copy link

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

bwx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:29:	Builder				80.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:42:	buildEndpointFromRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:65:	MakeRequests			89.5%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:102:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:131:	prepareBidResponse		100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:153:	getMediaTypeForBid		100.0%
total:								(statements)			94.9%

@bold-win
Copy link
Contributor Author

bold-win commented Feb 2, 2024

@onkarvhanumante done, thank you for review

Comment on lines 107 to 111
if bidderRawResponse.StatusCode == http.StatusServiceUnavailable {
return nil, []error{&errortypes.BadInput{
Message: "Bidder BoldwinX is unavailable. Please contact the bidder support.",
}}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This check should be covered by CheckResponseStatusCodeErrors func.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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, 9a7baae

bwx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:29:	Builder				80.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:42:	buildEndpointFromRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:65:	MakeRequests			89.5%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:102:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:125:	prepareBidResponse		100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:147:	getMediaTypeForBid		100.0%
total:								(statements)			94.7%

@bold-win
Copy link
Contributor Author

bold-win commented Feb 6, 2024

@SyntaxNode Hi Scott! Could you please submit requested changes? Thank you

onkarvhanumante
onkarvhanumante previously approved these changes Feb 7, 2024
@bold-win
Copy link
Contributor Author

bold-win commented Feb 7, 2024

Hi @onkarvhanumante,

Could you please let me know if there are any blockers to merge this PR? It would be great if bwx adapter could be included in the next release. Thank you!

Copy link
Contributor

@SyntaxNode SyntaxNode left a comment

Choose a reason for hiding this comment

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

Consider renaming "boldwinxtest" to "bwxtest" to follow the convention of using the adapter name.

Copy link
Contributor

Choose a reason for hiding this comment

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

The expected file name is bwx_test.go.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename this file to follow common design patterns.


assert.NoError(t, buildErr)
adapterstest.RunJSONBidderTest(t, "boldwinxtest", bidder)
}
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 builder test for the macro parsing error. Here's an example from aceex:

func TestEndpointTemplateMalformed(t *testing.T) {
	_, buildErr := Builder(openrtb_ext.BidderAceex, config.Adapter{
		Endpoint: "{{Malformed}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

	assert.Error(t, buildErr)
}

adapters/bwx/params_test.go Show resolved Hide resolved
static/bidder-params/bwx.json Show resolved Hide resolved
Copy link

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

bwx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:29:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:42:	buildEndpointFromRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:65:	MakeRequests			89.5%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:102:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:125:	prepareBidResponse		100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:147:	getMediaTypeForBid		100.0%
total:								(statements)			96.5%

@bold-win
Copy link
Contributor Author

bold-win commented Feb 8, 2024

@SyntaxNode hello, thank you for review, now its done + dev-docs commit: prebid/prebid.github.io@4b70bcf

Copy link
Contributor

@SyntaxNode SyntaxNode left a comment

Choose a reason for hiding this comment

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

Thank you for the updates. Just two minor nitpicks left.

adapters/bwx/bwx.go Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename this file to follow common design patterns.

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, 8da1280

bwx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:29:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:42:	buildEndpointFromRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:65:	MakeRequests			89.5%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:102:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:125:	prepareBidResponse		100.0%
github.com/prebid/prebid-server/v2/adapters/bwx/bwx.go:147:	getMediaTypeForBid		100.0%
total:								(statements)			96.5%

@bold-win
Copy link
Contributor Author

@SyntaxNode done

@gargcreation1992 gargcreation1992 merged commit 8e5a785 into prebid:master Feb 19, 2024
5 checks passed
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.

4 participants