From 42bde7825b59f877844e76c63d32c7711610d76b Mon Sep 17 00:00:00 2001 From: Sonali-More-Xandr <87759626+Sonali-More-Xandr@users.noreply.github.com> Date: Mon, 30 Oct 2023 18:37:30 +0530 Subject: [PATCH] Revert "Rubicon: Add `imp[].ext.rp.rtb.formats` logic (#3255)" This reverts commit 8e9f3f359416289a8b988f5d2403daf68edc4593. --- adapters/rubicon/rubicon.go | 30 +- .../bidonmultiformat-with-formats-param.json | 323 ------------------ .../exemplary/bidonmultiformat.json | 12 - ...n-bidonmultiformat-with-formats-param.json | 187 ---------- openrtb_ext/imp_rubicon.go | 1 - 5 files changed, 3 insertions(+), 550 deletions(-) delete mode 100644 adapters/rubicon/rubicontest/exemplary/bidonmultiformat-with-formats-param.json delete mode 100644 adapters/rubicon/rubicontest/exemplary/non-bidonmultiformat-with-formats-param.json diff --git a/adapters/rubicon/rubicon.go b/adapters/rubicon/rubicon.go index 431359c0b33..7d09224e8b4 100644 --- a/adapters/rubicon/rubicon.go +++ b/adapters/rubicon/rubicon.go @@ -87,11 +87,6 @@ type rubiconImpExtRP struct { ZoneID int `json:"zone_id"` Target json.RawMessage `json:"target,omitempty"` Track rubiconImpExtRPTrack `json:"track"` - RTB *rubiconImpExtRpRtb `json:"rtb,omitempty"` -} - -type rubiconImpExtRpRtb struct { - Formats []openrtb_ext.BidType `json:"formats,omitempty"` } type rubiconUserExtRP struct { @@ -304,10 +299,6 @@ func (a *RubiconAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *ada Skadn: bidderExt.Skadn, } - if len(bidderExt.Bidder.Formats) > 0 { - impExt.RP.RTB = &rubiconImpExtRpRtb{bidderExt.Bidder.Formats} - } - imp.Ext, err = json.Marshal(&impExt) if err != nil { errs = append(errs, err) @@ -601,19 +592,9 @@ func prepareImpsToExtMap(impsToExtMap map[*openrtb2.Imp]rubiconExtImpBidder) map continue } - splitImps, formats := splitMultiFormatImp(imp) + splitImps := splitMultiFormatImp(imp) for _, imp := range splitImps { impCopy := imp - - existingFormats := bidderExt.Bidder.Formats - var resolvedFormats []openrtb_ext.BidType - if len(existingFormats) > 0 { - resolvedFormats = existingFormats - } else { - resolvedFormats = formats - } - bidderExt.Bidder.Formats = resolvedFormats - preparedImpsToExtMap[impCopy] = bidderExt } } @@ -621,11 +602,9 @@ func prepareImpsToExtMap(impsToExtMap map[*openrtb2.Imp]rubiconExtImpBidder) map return preparedImpsToExtMap } -func splitMultiFormatImp(imp *openrtb2.Imp) ([]*openrtb2.Imp, []openrtb_ext.BidType) { +func splitMultiFormatImp(imp *openrtb2.Imp) []*openrtb2.Imp { splitImps := make([]*openrtb2.Imp, 0) - mediaTypes := make([]openrtb_ext.BidType, 0) if imp.Banner != nil { - mediaTypes = append(mediaTypes, openrtb_ext.BidTypeBanner) impCopy := *imp impCopy.Video = nil impCopy.Native = nil @@ -634,7 +613,6 @@ func splitMultiFormatImp(imp *openrtb2.Imp) ([]*openrtb2.Imp, []openrtb_ext.BidT } if imp.Video != nil { - mediaTypes = append(mediaTypes, openrtb_ext.BidTypeVideo) impCopy := *imp impCopy.Banner = nil impCopy.Native = nil @@ -643,7 +621,6 @@ func splitMultiFormatImp(imp *openrtb2.Imp) ([]*openrtb2.Imp, []openrtb_ext.BidT } if imp.Native != nil { - mediaTypes = append(mediaTypes, openrtb_ext.BidTypeNative) impCopy := *imp impCopy.Banner = nil impCopy.Video = nil @@ -652,7 +629,6 @@ func splitMultiFormatImp(imp *openrtb2.Imp) ([]*openrtb2.Imp, []openrtb_ext.BidT } if imp.Audio != nil { - mediaTypes = append(mediaTypes, openrtb_ext.BidTypeAudio) impCopy := *imp impCopy.Banner = nil impCopy.Video = nil @@ -660,7 +636,7 @@ func splitMultiFormatImp(imp *openrtb2.Imp) ([]*openrtb2.Imp, []openrtb_ext.BidT splitImps = append(splitImps, &impCopy) } - return splitImps, mediaTypes + return splitImps } func resolveBidFloor(bidFloor float64, bidFloorCur string, reqInfo *adapters.ExtraRequestInfo) (float64, error) { diff --git a/adapters/rubicon/rubicontest/exemplary/bidonmultiformat-with-formats-param.json b/adapters/rubicon/rubicontest/exemplary/bidonmultiformat-with-formats-param.json deleted file mode 100644 index 72efd23e298..00000000000 --- a/adapters/rubicon/rubicontest/exemplary/bidonmultiformat-with-formats-param.json +++ /dev/null @@ -1,323 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "device": { - "ip": "123.123.123.123", - "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx" - }, - "site": { - "page": "somePage", - "ref": "someRef", - "search": "someSearch" - }, - "imp": [ - { - "id": "test-imp-id", - "instl": 1, - "banner": { - "format": [ - { - "w": 300, - "h": 400 - } - ] - }, - "video": { - "placement": 3, - "mimes": [ - "video/mp4" - ], - "protocols": [ - 2, - 5 - ], - "w": 1024, - "h": 576 - }, - "ext": { - "bidder": { - "bidonmultiformat": true, - "accountId": 1001, - "siteId": 113932, - "zoneId": 535510, - "formats": [ - "banner", - "video", - "native" - ] - } - } - } - ] - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "uri?tk_xint=pbs-test-tracker", - "body": { - "id": "test-request-id", - "device": { - "ext": { - "rp": { - "pixelratio": 0 - } - }, - "ip": "123.123.123.123", - "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx" - }, - "site": { - "page": "somePage", - "ref": "someRef", - "search": "someSearch", - "ext": { - "rp": { - "site_id": 113932 - } - }, - "publisher": { - "ext": { - "rp": { - "account_id": 1001 - } - } - } - }, - "imp": [ - { - "id": "test-imp-id", - "instl": 1, - "secure": 1, - "banner": { - "format": [ - { - "w": 300, - "h": 400 - } - ], - "ext": { - "rp": { - "mime": "text/html" - } - } - }, - "ext": { - "rp": { - "rtb": { - "formats": [ - "banner", - "video", - "native" - ] - }, - "target": { - "page": [ - "somePage" - ], - "ref": [ - "someRef" - ], - "search": [ - "someSearch" - ] - }, - "track": { - "mint": "", - "mint_version": "" - }, - "zone_id": 535510 - } - } - } - ] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "bid": [ - { - "id": "test_bid_id", - "impid": "test-imp-id", - "price": 0.27543, - "adm": "some-test-ad", - "cid": "test_cid", - "crid": "test_crid", - "dealid": "test_dealid", - "ext": { - "prebid": { - "type": "banner" - } - } - } - ], - "seat": "adman" - } - ], - "cur": "USD" - } - } - }, - { - "expectedRequest": { - "uri": "uri?tk_xint=pbs-test-tracker", - "body": { - "id": "test-request-id", - "device": { - "ext": { - "rp": { - "pixelratio": 0 - } - }, - "ip": "123.123.123.123", - "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx" - }, - "site": { - "page": "somePage", - "ref": "someRef", - "search": "someSearch", - "ext": { - "rp": { - "site_id": 113932 - } - }, - "publisher": { - "ext": { - "rp": { - "account_id": 1001 - } - } - } - }, - "imp": [ - { - "id": "test-imp-id", - "instl": 1, - "secure": 1, - "video": { - "placement": 3, - "ext": { - "rp": { - "size_id": 203 - } - }, - "mimes": [ - "video/mp4" - ], - "protocols": [ - 2, - 5 - ], - "w": 1024, - "h": 576 - }, - "ext": { - "rp": { - "rtb": { - "formats": [ - "banner", - "video", - "native" - ] - }, - "target": { - "page": [ - "somePage" - ], - "ref": [ - "someRef" - ], - "search": [ - "someSearch" - ] - }, - "track": { - "mint": "", - "mint_version": "" - }, - "zone_id": 535510 - } - } - } - ] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "bid": [ - { - "id": "test_bid_id-2", - "impid": "test-imp-id", - "price": 0.9, - "adm": "some-test-ad", - "cid": "test_cid", - "crid": "test_crid", - "dealid": "test_dealid", - "ext": { - "prebid": { - "type": "video" - } - } - } - ], - "seat": "adman" - } - ], - "cur": "USD" - } - } - } - ], - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "test_bid_id", - "impid": "test-imp-id", - "price": 0.27543, - "adm": "some-test-ad", - "cid": "test_cid", - "crid": "test_crid", - "dealid": "test_dealid", - "ext": { - "prebid": { - "type": "banner" - } - } - }, - "type": "banner" - } - ] - }, - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "test_bid_id-2", - "impid": "test-imp-id", - "price": 0.9, - "adm": "some-test-ad", - "cid": "test_cid", - "crid": "test_crid", - "dealid": "test_dealid", - "ext": { - "prebid": { - "type": "video" - } - } - }, - "type": "video" - } - ] - } - ] -} diff --git a/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json b/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json index 28b901bdb01..71043771d1d 100644 --- a/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json +++ b/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json @@ -97,12 +97,6 @@ }, "ext": { "rp": { - "rtb": { - "formats": [ - "banner", - "video" - ] - }, "target": { "page": [ "somePage" @@ -209,12 +203,6 @@ }, "ext": { "rp": { - "rtb": { - "formats": [ - "banner", - "video" - ] - }, "target": { "page": [ "somePage" diff --git a/adapters/rubicon/rubicontest/exemplary/non-bidonmultiformat-with-formats-param.json b/adapters/rubicon/rubicontest/exemplary/non-bidonmultiformat-with-formats-param.json deleted file mode 100644 index a7d10421757..00000000000 --- a/adapters/rubicon/rubicontest/exemplary/non-bidonmultiformat-with-formats-param.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "device": { - "ip": "123.123.123.123", - "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx" - }, - "site": { - "page": "somePage", - "ref": "someRef", - "search": "someSearch" - }, - "imp": [ - { - "id": "test-imp-id", - "instl": 1, - "banner": { - "format": [ - { - "w": 300, - "h": 400 - } - ] - }, - "video": { - "placement": 3, - "mimes": [ - "video/mp4" - ], - "protocols": [ - 2, - 5 - ], - "w": 1024, - "h": 576 - }, - "ext": { - "bidder": { - "accountId": 1001, - "siteId": 113932, - "zoneId": 535510, - "formats": [ - "banner", - "video", - "native" - ] - } - } - } - ] - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "uri?tk_xint=pbs-test-tracker", - "body": { - "id": "test-request-id", - "device": { - "ext": { - "rp": { - "pixelratio": 0 - } - }, - "ip": "123.123.123.123", - "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx" - }, - "site": { - "page": "somePage", - "ref": "someRef", - "search": "someSearch", - "ext": { - "rp": { - "site_id": 113932 - } - }, - "publisher": { - "ext": { - "rp": { - "account_id": 1001 - } - } - } - }, - "imp": [ - { - "id": "test-imp-id", - "instl": 1, - "secure": 1, - "banner": { - "format": [ - { - "w": 300, - "h": 400 - } - ], - "ext": { - "rp": { - "mime": "text/html" - } - } - }, - "ext": { - "rp": { - "rtb": { - "formats": [ - "banner", - "video", - "native" - ] - }, - "target": { - "page": [ - "somePage" - ], - "ref": [ - "someRef" - ], - "search": [ - "someSearch" - ] - }, - "track": { - "mint": "", - "mint_version": "" - }, - "zone_id": 535510 - } - } - } - ] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "bid": [ - { - "id": "test_bid_id", - "impid": "test-imp-id", - "price": 0.27543, - "adm": "some-test-ad", - "cid": "test_cid", - "crid": "test_crid", - "dealid": "test_dealid", - "ext": { - "prebid": { - "type": "banner" - } - } - } - ], - "seat": "adman" - } - ], - "cur": "USD" - } - } - } - ], - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "test_bid_id", - "impid": "test-imp-id", - "price": 0.27543, - "adm": "some-test-ad", - "cid": "test_cid", - "crid": "test_crid", - "dealid": "test_dealid", - "ext": { - "prebid": { - "type": "banner" - } - } - }, - "type": "banner" - } - ] - } - ] -} diff --git a/openrtb_ext/imp_rubicon.go b/openrtb_ext/imp_rubicon.go index 7075b101637..7264be1374c 100644 --- a/openrtb_ext/imp_rubicon.go +++ b/openrtb_ext/imp_rubicon.go @@ -16,7 +16,6 @@ type ExtImpRubicon struct { Video rubiconVideoParams `json:"video"` Debug impExtRubiconDebug `json:"debug,omitempty"` PChain string `json:"pchain,omitempty"` - Formats []BidType `json:"formats"` } // rubiconVideoParams defines the contract for bidrequest.imp[i].ext.prebid.bidder.rubicon.video