-
Notifications
You must be signed in to change notification settings - Fork 0
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
RPRD-1638: Add support for Native media type and multi-format bid req… #42
Conversation
…uests in `index.js`, Populate the changes on `rise/minutemedia/openweb/shinez/stn/BidAdapter.js`, Update all relevant `***BidAdapter_spec.js`, Update all relevant `***BidAdapter.md`, Keep backwards compatibility, Move `mimes` and `api` determination to VIDEO media type as its only relevant to video.
Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:
Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀 |
As i see here the threshold is 20. This tool was created on 08/06/2024. We have 5 adapters to maintain which will for-sure have duplicate code. Do you guys have any suggestions how to proceed? @lasloche @innay @george14051 @Gershon-Brainin @Dedis23 |
…e across all maintained adapters via `makeBaseSpec` factory function, Move all rise related constants to `constants.js`.
libraries/riseUtils/index.js
Outdated
bidId: getBidIdParameter('bidId', bid), | ||
loop: bid.bidderRequestsCount || 0, | ||
bidderRequestId: getBidIdParameter('bidderRequestId', bid), | ||
transactionId: bid.ortb2Imp?.ext?.tid || '', | ||
coppa: 0, | ||
}; | ||
|
||
const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`); | ||
const pos = getPos(bid) |
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.
add the ; syntax on each end of line please.
libraries/riseUtils/index.js
Outdated
if (pos) { | ||
bidObject.pos = pos; | ||
bidObject.pos = pos |
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.
pos can be zero value, fix the if condition to pass also pos=0 (unknown position)
libraries/riseUtils/constants.js
Outdated
|
||
export const ALIASES = [ | ||
{ code: 'risexchange', gvlid: DEFAULT_GVLID }, | ||
{ code: 'openwebxchange', gvlid: 280 } |
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.
Could you set it as a constant variable like const OW_GVLID = 280;
?
libraries/riseUtils/index.js
Outdated
const mediaTypes = getBidRequestMediaTypes(bidRequest) | ||
const firstMediaType = mediaTypes[0] |
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.
Please add the ;
at the end of the lines.
libraries/riseUtils/index.js
Outdated
const mediaTypes = getBidRequestMediaTypes(bidRequest) | ||
const firstMediaType = mediaTypes[0] | ||
if (mediaTypes.length === 1) { | ||
return deepAccess(bidRequest, `mediaTypes.${firstMediaType}.name`) |
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.
Please add the ;
at the end of the line.
modules/minutemediaBidAdapter.js
Outdated
...makeBaseSpec(BASE_URL, MODES), | ||
code: BIDDER_CODE, | ||
gvlid: 918, |
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.
Could you set it as a constant variable like const MM_GVLID = 918;
?
libraries/riseUtils/index.js
Outdated
const mediaTypes = getBidRequestMediaTypes(bid) | ||
const firstMediaType = mediaTypes[0] |
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.
Please add the ;
at the end of the lines.
libraries/riseUtils/index.js
Outdated
const mediaTypes = getBidRequestMediaTypes(bid) | ||
const firstMediaType = mediaTypes[0] |
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.
Please add the ;
at the end of the lines.
libraries/riseUtils/index.js
Outdated
bidId: getBidIdParameter('bidId', bid), | ||
loop: bid.bidderRequestsCount || 0, | ||
bidderRequestId: getBidIdParameter('bidderRequestId', bid), | ||
transactionId: bid.ortb2Imp?.ext?.tid || '', | ||
coppa: 0, | ||
}; | ||
|
||
const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`); | ||
const pos = getPos(bid) |
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.
Please add the ;
at the end of the line.
libraries/riseUtils/index.js
Outdated
if (mediaTypes.includes(NATIVE)) { | ||
const nativeOrtbRequest = deepAccess(bid, `nativeOrtbRequest`); | ||
if (nativeOrtbRequest) { | ||
bidObject.nativeOrtbRequest = nativeOrtbRequest |
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.
Please add the ;
at the end of the line.
modules/openwebBidAdapter.js
Outdated
const BASE_URL = 'https://hb.openwebmp.com/'; | ||
const MODES = { | ||
PRODUCTION: 'hb-multi', | ||
TEST: 'hb-multi-test' | ||
}; | ||
|
||
export const spec = { | ||
...makeBaseSpec(BASE_URL, MODES), | ||
code: BIDDER_CODE, | ||
gvlid: 280, |
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.
Could you set it as a constant variable like const OW_GVLID = 280;
?
Prebid repo PR prebid#12653 |
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
index.js
,.rise/minutemedia/openweb/shinez/stn/BidAdapter.js
.***BidAdapter_spec.js
.***BidAdapter.md
.mimes
andapi
determination to VIDEO media type as its only relevant to video.spec
code duplication toindex.js
and populate across all maintained adapters viamakeBaseSpec
factory function.constants.js
.