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: Bidtheatre #4069

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

andreasgreen
Copy link

var bidExt openrtb_ext.ExtBid
err := jsonutil.Unmarshal(bid.Ext, &bidExt)
if err == nil && bidExt.Prebid != nil {
return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type))

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. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends 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

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

bidtheatre

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:29:	MakeRequests		80.0%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:46:	getMediaTypeForBid	83.3%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:60:	MakeBids		69.6%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:105:	resolveMacros		80.0%
total:										(statements)		75.6%

@przemkaczmarek przemkaczmarek self-assigned this Nov 26, 2024
@bsardo bsardo added the adapter label Jan 6, 2025
@bsardo
Copy link
Collaborator

bsardo commented Jan 6, 2025

@Rothalack can you please review?

@bsardo
Copy link
Collaborator

bsardo commented Jan 7, 2025

@pm-nikhil-vaidya can you please review?

@pm-nikhil-vaidya
Copy link
Contributor

Sure @bsardo

@Rothalack
Copy link
Contributor

I have no additional feedback for this PR. Looks good to me. You'll probably want to flip pbs support to true on the docs whenever this goes out.

adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre_test.go Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Show resolved Hide resolved
@andreasgreen
Copy link
Author

Thank you all for your feedback, we will review your comments in detail and address them shortly.

adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Show resolved Hide resolved
static/bidder-info/bidtheatre.yaml Outdated Show resolved Hide resolved
static/bidder-params/bidtheatre.json Outdated Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Show resolved Hide resolved
adapters/bidtheatre/bidtheatre.go Show resolved Hide resolved
Comment on lines 55 to 53
return "", &errortypes.BadServerResponse{
Message: fmt.Sprintf("Failed to parse impression \"%s\" mediatype", bid.ImpID),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add test coverage for these lines by adding a supplemental JSON test that contains a malformed bid.ext.

Copy link
Author

Choose a reason for hiding this comment

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

Not sure if this were your polite way of saying these lines can't be reached or not.. because I seem to be unable to create a test that triggers them =)

The code comes from your references implementation but would you prefer I remove them?

adapters/bidtheatre/bidtheatre_test.go Show resolved Hide resolved
func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
var bidExt openrtb_ext.ExtBid
if err := jsonutil.Unmarshal(bid.Ext, &bidExt); err == nil && bidExt.Prebid != nil {
return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type))

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. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends 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

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, 9613e42

bidtheatre

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:29:	MakeRequests		80.0%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:45:	getMediaTypeForBid	75.0%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:56:	MakeBids		94.1%
github.com/prebid/prebid-server/v3/adapters/bidtheatre/bidtheatre.go:88:	resolveMacros		80.0%
total:										(statements)		87.9%

]
}
]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what happend if we add muli-format, multi-imps ?
please add multi-format and multi-imp

Copy link
Author

Choose a reason for hiding this comment

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

The mock impression already is multi-format, you want me to add mock impression requests that's multi-imp?

@bsardo
Copy link
Collaborator

bsardo commented Jan 22, 2025

Hi @andreasgreen, since the review process is underway, instead of rebasing and force pushing, please push new commits when making changes or merge with master to resolve conflicts if they arise. This will expedite the process as it makes it much easier and less time consuming for reviewers since we can just check the delta. When your PR is merged, all commits will be squashed. Thanks!

@andreasgreen
Copy link
Author

@bsardo , sorry, I thought you required the PR to be one-commit at all times, I will push the individual commits going forward.

@bsardo
Copy link
Collaborator

bsardo commented Jan 22, 2025

@bsardo , sorry, I thought you required the PR to be one-commit at all times, I will push the individual commits going forward.

👍 No worries!

@bsardo
Copy link
Collaborator

bsardo commented Jan 22, 2025

@andreasgreen just want to point out that you'll need to run go fmt; that is why the test suite is currently failing.

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.

6 participants