-
Notifications
You must be signed in to change notification settings - Fork 753
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
Upgrade Bid Adjustments #2678
Merged
Merged
Upgrade Bid Adjustments #2678
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
1635031
Initial major implementation, no tests
AlexBVolcy b942b42
Move/add merge/validation to HoldAuction
AlexBVolcy 1302f86
Bid Adj Testing
AlexBVolcy 0449d99
Merge branch 'master' into upgrade_bid_adjustments
AlexBVolcy 14c79ec
Remove unused value from merge
AlexBVolcy eff488a
Merge branch 'master' into upgrade_bid_adjustments
AlexBVolcy d055f96
Fix failed tests post merge
AlexBVolcy 4ff5ede
Better function names
AlexBVolcy 9b2e525
Address feedback
AlexBVolcy fb2ab84
Tweak to validation
AlexBVolcy 4659a9a
Combine adjustment functions, round bid price
AlexBVolcy 0c688fd
Moved exchange adjustment functions/tests
AlexBVolcy 5306357
Merge branch 'master' into upgrade_bid_adjustments
AlexBVolcy 05a132f
Address module error
AlexBVolcy 3d4a341
Address half of feedback, remove ptrs,update tests
AlexBVolcy fdf5edc
Updates to adj array apply
AlexBVolcy b756794
Move bid adjustment logic to own package
AlexBVolcy 7d6b4fc
Big changes to GetAdjustmentArray, minor to merge
AlexBVolcy 1a99400
Merge branch 'master' into upgrade_bid_adjustments
AlexBVolcy 6e17639
Address variety of feedback
AlexBVolcy 816d3e2
Update to not return map unnecessarily
AlexBVolcy a4fcab8
Add more test cases for validation
AlexBVolcy 20cd02a
Renaming, updating bidadjustment package files
AlexBVolcy 7b8b5cb
Add nil checks to validation, update tests, rename
AlexBVolcy 3ee1931
Video instream/outstream support
AlexBVolcy 9708f82
Address all feedback
AlexBVolcy db1df54
Merge branch 'master' into upgrade_bid_adjustments
AlexBVolcy 39cfec9
Fix error after merge
AlexBVolcy 8c1e089
Address error handling, edge cases
AlexBVolcy 1ce1b43
Add invalid end to end test
AlexBVolcy 77b4dd0
Fatal error tweak
AlexBVolcy 4c55dea
Re-add comment, tweak error handling
AlexBVolcy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidadjustments-cpm.json
AlexBVolcy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
AlexBVolcy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"description": "Bid Adjustment Test with CPM, and WildCard Preference Testing", | ||
"config": { | ||
"mockBidders": [ | ||
{"bidderName": "appnexus", "currency": "USD", "price": 20.00} | ||
] | ||
}, | ||
"mockBidRequest": { | ||
"id": "some-request-id", | ||
"site": { | ||
"page": "prebid.org" | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
{ | ||
"w": 300, | ||
"h": 600 | ||
} | ||
] | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
], | ||
"tmax": 500, | ||
"ext": { | ||
"prebid": { | ||
"currency": { | ||
"rates": { | ||
"EUR": { | ||
"USD": 2.0 | ||
} | ||
}, | ||
"usepbsrates": false | ||
}, | ||
"bidadjustments": { | ||
"mediatype": { | ||
"banner": { | ||
"appnexus": { | ||
"*": [ | ||
{ | ||
"adjtype": "cpm", | ||
"value": 5.0, | ||
"currency": "EUR" | ||
} | ||
] | ||
}, | ||
"*": { | ||
"*": [ | ||
{ | ||
"adjtype": "multiplier", | ||
"value": 3.0 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"expectedBidResponse": { | ||
"id":"some-request-id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "appnexus-bid", | ||
"impid": "some-impression-id", | ||
"price": 17.5, | ||
"ext": {"origbidcpm": 20, "origbidcur": "USD", "prebid": {"meta": {"adaptercode": "appnexus"}, "type": "banner"}} | ||
} | ||
], | ||
"seat": "appnexus" | ||
} | ||
], | ||
"bidid":"test bid id", | ||
"cur":"USD", | ||
"nbr":0 | ||
}, | ||
"expectedReturnCode": 200 | ||
} |
75 changes: 75 additions & 0 deletions
75
endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidadjustments-simple.json
AlexBVolcy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"description": "Bid Adjustment Test With One Adjustment", | ||
"config": { | ||
"mockBidders": [ | ||
{"bidderName": "appnexus", "currency": "USD", "price": 2.00, "dealid": "some-deal-id"} | ||
] | ||
}, | ||
"mockBidRequest": { | ||
"id": "some-request-id", | ||
"site": { | ||
"page": "prebid.org" | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
{ | ||
"w": 300, | ||
"h": 600 | ||
} | ||
] | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
], | ||
"tmax": 500, | ||
"ext": { | ||
"prebid": { | ||
"bidadjustments": { | ||
"mediatype": { | ||
"banner": { | ||
"appnexus": { | ||
"some-deal-id": [ | ||
{ | ||
"adjtype": "multiplier", | ||
"value": 2.0 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"expectedBidResponse": { | ||
"id":"some-request-id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "appnexus-bid", | ||
"impid": "some-impression-id", | ||
"price": 4.0, | ||
"ext": {"origbidcpm": 2, "origbidcur": "USD", "prebid": {"meta": {"adaptercode": "appnexus"}, "type": "banner"}} | ||
} | ||
], | ||
"seat": "appnexus" | ||
} | ||
], | ||
"bidid":"test bid id", | ||
"cur":"USD", | ||
"nbr":0 | ||
}, | ||
"expectedReturnCode": 200 | ||
} |
92 changes: 92 additions & 0 deletions
92
endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidadjustments-static.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"description": "Bid Adjustment with Static and WildCard testing", | ||
"config": { | ||
"mockBidders": [ | ||
{"bidderName": "appnexus", "currency": "USD", "price": 2.00, "dealid": "some-deal-id"} | ||
] | ||
}, | ||
"mockBidRequest": { | ||
"id": "some-request-id", | ||
"site": { | ||
"page": "prebid.org" | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
{ | ||
"w": 300, | ||
"h": 600 | ||
} | ||
] | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
], | ||
"tmax": 500, | ||
"ext": { | ||
"prebid": { | ||
"currency": { | ||
"rates": { | ||
"EUR": { | ||
"USD": 2.0 | ||
} | ||
}, | ||
"usepbsrates": false | ||
}, | ||
"bidadjustments": { | ||
"mediatype": { | ||
"banner": { | ||
"*": { | ||
"some-deal-id": [ | ||
{ | ||
"adjtype": "static", | ||
"value": 5.0, | ||
"currency": "EUR" | ||
} | ||
] | ||
}, | ||
"some-bidder-name": { | ||
"*": [ | ||
{ | ||
"adjtype": "multiplier", | ||
"value": 2.0 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"expectedBidResponse": { | ||
"id":"some-request-id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "appnexus-bid", | ||
"impid": "some-impression-id", | ||
"price": 2.5, | ||
AlexBVolcy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"ext": {"origbidcpm": 2, "origbidcur": "USD", "prebid": {"meta": {"adaptercode": "appnexus"}, "type": "banner"}} | ||
} | ||
], | ||
"seat": "appnexus" | ||
} | ||
], | ||
"bidid":"test bid id", | ||
"cur":"USD", | ||
AlexBVolcy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"nbr":0 | ||
}, | ||
"expectedReturnCode": 200 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check that we don't need to call
RebuildRequest
after setting prebid on the wrapper.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action required here. We shouldn't need to call
RebuildRequest
at this point. The call toSetPrebid
is modifying the request ext object on the wrapper and marking it as dirty which is sufficient. The code that follows operates off of the request ext object and does not need access to a marshaled ext. InHoldAuction
, we rebuild the request prior to cleaning and splitting the request by bidder to ensure that each bidder uses a copy of the mutated request including any modifications made to the request ext through calls to methods likeSetPrebid
.