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

Telaria: Add pod support #2171

Merged
merged 52 commits into from
Mar 14, 2022
Merged

Telaria: Add pod support #2171

merged 52 commits into from
Mar 14, 2022

Conversation

xxu-telaria
Copy link
Contributor

add ability to handle multiple bid responses

Vinay Prasad added 30 commits February 21, 2020 09:59
Keeping the fork up to date with master
@xxu-telaria xxu-telaria changed the base branch from master to 0.69.0 March 3, 2022 00:06
@xxu-telaria xxu-telaria changed the base branch from 0.69.0 to master March 3, 2022 00:06
@@ -205,6 +205,9 @@ func (a *TelariaAdapter) MakeRequests(requestIn *openrtb2.BidRequest, reqInfo *a
// Swap the tagID with adCode
request.Imp[i].TagID = telariaImpExt.AdCode
}
if len(request.Imp) > 1 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you are going to drop all but the first imp, do we need to loop over all the imps above?

Also, if there is only 1 imp that goes to the bidder, you know all your bids are for that imp, and don't need to loop over all the imps in MakeBids()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the input. That's a good point; there's no need to loop over all the imps above. I will make changes to that right away.

It's still necessary to loop over all the imps inmakeBids() because not all responses from the bidder is for the 1 imp that's sent. Our bidder takes in ext information such as pod duration to calculate the number of imps that's most suitable for the pod and return multiple bids for each slot in the pod. Therefore, I need to loop over them and make sure they are for different imp.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like you only send the first imp to your bidder. How does your bidder know what the imp IDs for the other imps are in order to bid on them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar to the RTB 2.6 spec, our bidder calculates the appropriate pod size based on poddur and maxseq parameters in addition to the configured parameters in the ad unit. Since we cannot really get the poddur information from what's passed to our adapter, we ask it to be present in the video ext. And In the end, we match the bid responses with the imp ids.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you only support long format pods, or should you verify that the request is such a request before throwing the rest of the imps away? I just want to make sure you can still support the old general video case unless you explicitly are not supporting it. :) Otherwise the PR looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much for the review and inputs. And this is all we support at the moment :)

@bsardo bsardo self-requested a review March 7, 2022 18:19
@bsardo bsardo assigned bsardo and unassigned VeronikaSolovei9 Mar 7, 2022
hhhjort
hhhjort previously approved these changes Mar 7, 2022
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

@bsardo bsardo requested review from guscarreon and removed request for bsardo March 8, 2022 18:21
@bsardo bsardo assigned guscarreon and unassigned bsardo Mar 8, 2022
Copy link
Contributor

@guscarreon guscarreon left a comment

Choose a reason for hiding this comment

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

Looks pretty good. I see the exemplary directory comes with a couple of tests where the incoming request holds only one imp. Given that the current version of adapters/telaria/telaria.go dealt with more than one imp, should we include a test case with multiple imps too? Is a multi-imp scenario feasible or worth considering anymore?

})
for i := range sb.Bid {
bid := sb.Bid[i]
if i < len(internalRequest.Imp) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If len(internalRequest.Imp) is less than len(sb.Bid) should we break the for loop to optimize a bit?

278  
279       for i := range sb.Bid {
280           bid := sb.Bid[i]
281 -         if i < len(internalRequest.Imp) {
    +         if i >= len(internalRequest.Imp) {
    +             break
    +         }
282               bid.ImpID = internalRequest.Imp[i].ID
283               bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
284                   Bid:     &bid,
285                   BidType: openrtb_ext.BidTypeVideo,
286               })
287 -         }
288       }
289       return bidResponse, nil
290   }
291  
adapters/telaria/telaria.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much for your inputs. They are really good points. I made the suggested changes and added the test cases as well.

also break response loop early to optimize performance further
Copy link
Contributor

@guscarreon guscarreon left a comment

Choose a reason for hiding this comment

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

@xxu-telaria thank you for addressing our feedback. Your changes look good to me

@bsardo bsardo merged commit 54c996c into prebid:master Mar 14, 2022
pm-nilesh-chate pushed a commit to PubMatic-OpenWrap/prebid-server that referenced this pull request Mar 30, 2022
jorgeluisrocha pushed a commit to jwplayer/prebid-server that referenced this pull request Sep 28, 2022
VeronikaSolovei9 pushed a commit that referenced this pull request Oct 12, 2022
…to-0.203.0 to master

* commit '33633841dc2be25c323a28f315fbbc2c8f055cf0':
  Telaria: Add pod support (#2171)
  New GitHub Action: Trivy Security Scan (#2177)
shunj-nb pushed a commit to ParticleMedia/prebid-server that referenced this pull request Nov 8, 2022
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.

6 participants