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

IX: add privacy sandbox support #3252

Merged
merged 4 commits into from
Nov 23, 2023
Merged

Conversation

ccorbo
Copy link
Contributor

@ccorbo ccorbo commented Oct 24, 2023

This MR adds privacy sandbox support to the IX Bid Adapter

@github-actions
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, b9d0090

ix

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/ix/ix.go:47:	MakeRequests			89.2%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:114:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:156:	unmarshalToIxExt		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:170:	parseSiteId			80.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:180:	createRequestData		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:190:	MakeBids			94.9%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:306:	getMediaTypeForBid		80.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:337:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:351:	mergeNativeImpTrackers		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:375:	marshalJsonWithoutUnicode	83.3%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:392:	setIxDiagIntoExtRequest		90.5%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:429:	moveSid				75.0%
total:								(statements)			91.5%

@bsardo bsardo changed the title IX Bid Adapter: add privacy sandbox support for ix bidder [PB-1925] IX: add privacy sandbox support Oct 24, 2023
@@ -19,7 +19,8 @@ import (
)

type IxAdapter struct {
URI string
URI string
bidderName string
Copy link
Contributor

Choose a reason for hiding this comment

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

@ccorbo could you help to understand how adding bidderName facilates privacy sandbox support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed bidderName - not needed

Copy link
Contributor

Choose a reason for hiding this comment

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

Removed bidderName - not needed

@ccorbo could you link commit where bidderName is removed. PR diff still has bidderName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops sorry - updated now

@@ -273,6 +283,23 @@ func (a *IxAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalReque
}
}

if bidResponse.Ext != nil {
var bidRespExt ixRespExt
if err := json.Unmarshal(bidResponse.Ext, &bidRespExt); err == nil && bidRespExt.AuctionConfig != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

should not ignore unMarshal error. This could be a potential bad bidder server issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added error check

@Sonali-More-Xandr
Copy link
Contributor

@ccorbo Please take a look at the above comments/questions.

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, 17256e4

ix

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/ix/ix.go:47:	MakeRequests			89.2%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:114:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:156:	unmarshalToIxExt		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:170:	parseSiteId			80.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:180:	createRequestData		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:190:	MakeBids			95.1%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:309:	getMediaTypeForBid		80.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:340:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:354:	mergeNativeImpTrackers		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:378:	marshalJsonWithoutUnicode	83.3%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:395:	setIxDiagIntoExtRequest		90.5%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:432:	moveSid				75.0%
total:								(statements)			91.6%

Comment on lines 288 to 303
if err := json.Unmarshal(bidResponse.Ext, &bidRespExt); err == nil && bidRespExt.AuctionConfig != nil {
bidderResponse.FledgeAuctionConfigs = make([]*openrtb_ext.FledgeAuctionConfig, 0, len(bidRespExt.AuctionConfig))
for _, config := range bidRespExt.AuctionConfig {
if config.Config != nil {
fledgeAuctionConfig := &openrtb_ext.FledgeAuctionConfig{
ImpId: config.BidId,
Config: config.Config,
}
bidderResponse.FledgeAuctionConfigs = append(bidderResponse.FledgeAuctionConfigs, fledgeAuctionConfig)
}
}
} else {
if err != nil {
errs = append(errs, err)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

above block can be rewritten as below for better readability

	if bidResponse.Ext != nil {
		var bidRespExt ixRespExt
		if err := json.Unmarshal(bidResponse.Ext, &bidRespExt); err != nil {
			return nil, append(errs, err)
		}

		if bidRespExt.AuctionConfig != nil {
			bidderResponse.FledgeAuctionConfigs = make([]*openrtb_ext.FledgeAuctionConfig, 0, len(bidRespExt.AuctionConfig))
			for _, config := range bidRespExt.AuctionConfig {
				if config.Config != nil {
					fledgeAuctionConfig := &openrtb_ext.FledgeAuctionConfig{
						ImpId:  config.BidId,
						Config: config.Config,
					}
					bidderResponse.FledgeAuctionConfigs = append(bidderResponse.FledgeAuctionConfigs, fledgeAuctionConfig)
				}
			}
		}
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks updated

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

ix

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/ix/ix.go:46:	MakeRequests			89.2%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:113:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:155:	unmarshalToIxExt		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:169:	parseSiteId			80.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:179:	createRequestData		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:189:	MakeBids			95.1%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:308:	getMediaTypeForBid		80.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:339:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:352:	mergeNativeImpTrackers		100.0%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:376:	marshalJsonWithoutUnicode	83.3%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:393:	setIxDiagIntoExtRequest		90.5%
github.com/prebid/prebid-server/v2/adapters/ix/ix.go:430:	moveSid				75.0%
total:								(statements)			91.6%

@Sonali-More-Xandr Sonali-More-Xandr merged commit 4cc2faa into prebid:master Nov 23, 2023
5 checks passed
SuprPhatAnon pushed a commit to GiftConnect/prebid-server that referenced this pull request Dec 7, 2023
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.

3 participants