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

Merge master into prebid-7 #8336

Merged
merged 80 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
15f7ec1
only map one slotrender to one adunit (#8211)
robertrmartinez Mar 28, 2022
7bd0098
DFP Ad Server Video: respect original url (#8168)
karimMourra Mar 29, 2022
4a9ccb8
Admaru adapter : add new bid adapter (#8149)
supadm Mar 29, 2022
972ead0
Missena Bid Adapter - allow custom endpoint. (#8222)
pdamoc Mar 30, 2022
35e46cd
Next Millenium Bid Adapter: Added new parameter group_id (#8200)
mhlm Mar 30, 2022
3015515
add timeout value to timeout pixel (#8224)
ybootin Mar 30, 2022
ca0c0f1
Outbrain bid adapter: added floor module and privacy link support (#8…
markkuhar Mar 30, 2022
d1a816b
Improve Digital Bid adapter: use the oRTB server endpoint (#8138)
jbartek25 Mar 30, 2022
8a7ebfd
NativoBidAdapter - Bid data mapping refactor and added QS params on r…
jsfledd Mar 30, 2022
f79b5b4
Floor price : allow having a 0$ floor (#8239)
JulieLorin Mar 30, 2022
001dcfa
Prebid 6.18.0 release
prebidjs-release Mar 30, 2022
82987c6
Increment version to 6.19.0-pre
prebidjs-release Mar 30, 2022
e87ac61
IAS RTD Module: Custom key values (#8214)
rbarbini-ias Mar 31, 2022
76d29fd
Yieldlab Bid Adapter: Add Support for User Matching (#8148)
nkloeber Mar 31, 2022
f3ce25d
Build system: add option to generate source maps for production build…
dgirardi Mar 31, 2022
cbb9ee4
Gamoshi Bid Adapter: Handle gdpr applies correctly (#8245)
Apr 1, 2022
70cd775
Prebid core: make GDPR/USP consent data available without requiring a…
dgirardi Apr 2, 2022
dfac4ee
add image userSync and change default currency (#8244)
ignat-one Apr 2, 2022
2cf1896
Colossus Bid Adapter: fix buildRequests (#8236)
Apr 2, 2022
02ea759
Yandex Bid Adapter: initial release (#8183)
Saveliev Apr 2, 2022
4a83fff
LiveIntent Id Submodule: Update live-connect build dependency to 2.3.…
3link Apr 2, 2022
f66e347
Adman Bid Adapter: update sync url (#8250)
SmartyAdman Apr 4, 2022
28b4c69
Glimpse: update api and request shape, optimize and refactor (#8237)
eddyu0 Apr 4, 2022
1153c70
Revert "Glimpse: update api and request shape, optimize and refactor …
msm0504 Apr 4, 2022
14cdd2a
Seeding alliance Adapter: multiple replacement of auction price bugfi…
Apr 5, 2022
e2c4086
Biddo Bid Adapter: add new bid adapter (#8206)
llays Apr 5, 2022
147ee96
consumableBidAdapter - add bidResponse fields (#8252)
jpiros Apr 6, 2022
301c0aa
Adtelligent Bid Adapter: add JANet adapter alias (#8102)
GeneGenie Apr 7, 2022
5406273
Add DistroScale Bid Adapter (#8221)
duancg Apr 7, 2022
90b37c1
Prebid 6.19.0 release
prebidjs-release Apr 7, 2022
5530dc1
Increment version to 6.20.0-pre
prebidjs-release Apr 7, 2022
b85ec2e
PulsePoint Bid Adapter: Support for first party eid data (#8215)
anand-venkatraman Apr 7, 2022
30d5cae
video added to nexx360 (#8259)
gchicoye Apr 7, 2022
741538f
justPremium Bid Adapter : support for user sync pixels (#8249)
marcin15g Apr 7, 2022
5b391c0
bump ajv (#8268)
robertrmartinez Apr 8, 2022
fdfa7a2
Glimpse: update api, request shape, GDPR and CCPA, optimize and refac…
eddyu0 Apr 8, 2022
7d42e11
Loglylift Bid Adapter: add support for banners (#8270)
HashimotoLogly Apr 8, 2022
f2ab346
Documentation: PR-reviewer update (#8267)
bretg Apr 11, 2022
930b94d
Permutive RTD module: support IAB Audience taxonomy (#8242)
desbo Apr 11, 2022
81bf1a9
Triplelift Bid Adapter: deprecate getLegacyFpd (#8273)
nllerandi3lift Apr 11, 2022
498e760
appnexus bid adapter - add support for setConfig pageUrl (#8266)
jsnellbaker Apr 11, 2022
c9d7e87
appnexus bid adapter - support mediaTypes pos field (#8275)
jsnellbaker Apr 12, 2022
837105d
Mediasniper bidder adapter (#8199)
OlegRomanenko Apr 12, 2022
a6496f5
JustPremium: documentation update (#8277)
gsroka Apr 12, 2022
2d14b7d
Prebid Core: add documentResolver callback and allow the user to supp…
olafbuitelaar Apr 12, 2022
60cfe79
Build system: fix basic e2e tests (#8207)
dgirardi Apr 13, 2022
c6b10ec
Vibrant Media Bid Adapter: onBidWon pixel trigger (#8191)
sardusmatt Apr 13, 2022
8035272
UserID module: better initialization logic (#8201)
dgirardi Apr 14, 2022
2d5be3f
AdYouLike Bidder - Add size in video bid (#8282)
guiann Apr 14, 2022
d2fc7e9
Prebid 6.20.0 release
prebidjs-release Apr 14, 2022
5f9e40d
Increment version to 6.21.0-pre
prebidjs-release Apr 14, 2022
998e934
test endpoint was added (#8286)
mifanich Apr 15, 2022
f359b08
fix malltv adapter name (#8280)
puhiza-d Apr 18, 2022
c96722d
[:art:] fix: set minduration and maxduration to optional (#3) (#8290)
ramyferjaniadot Apr 18, 2022
d9465ed
AudienceRun Bid Adapter: Add Support for User Matching, Referer, … (#…
audiencerun Apr 18, 2022
b34e5f7
BetweenBidAdaper: jst fix (#8296)
anastasya123 Apr 19, 2022
2c0518f
Seeding Alliance Bid Adapter: change bidder URL and add versioning (#…
Apr 19, 2022
a2fc0b5
Colossus Bid Adapter: update buildRequests (#8272)
Apr 20, 2022
9104427
Prebid 6.21.0 release
prebidjs-release Apr 20, 2022
19aba79
Increment version to 6.22.0-pre
prebidjs-release Apr 20, 2022
f40d1d6
PubMatic: add "acat" parameter (#8246)
kapil-tuptewar Apr 20, 2022
12b8e9f
CI: disable e2e tests (#8306)
dgirardi Apr 20, 2022
0af369d
Consent management: fix bug with adUnits without a size causing excep…
dgirardi Apr 20, 2022
88e10a3
Consent management: fix https://github.com/prebid/Prebid.js/issues/83…
dgirardi Apr 20, 2022
73707a6
Prebid 6.21.1 release
prebidjs-release Apr 20, 2022
d4c057a
Increment version to 6.22.0-pre
prebidjs-release Apr 20, 2022
b56b3bc
adomik Analytics Adapter: sampling revamp, add AB test info, enhance …
liabas-b Apr 20, 2022
d1a0f09
update apacdex bid adapter (#8247)
thuyhq Apr 20, 2022
6e78043
send all bid info within the timeout event (#8288)
JulieLorin Apr 22, 2022
18612ab
OTM bid adapter: use top origin as default domain (#8004)
regulyarniy Apr 22, 2022
d8b0509
PBS adapter: fix bug with priceFloors sometimes not being set in requ…
dgirardi Apr 22, 2022
23297f0
FTRACK USER ID MODULE: making the IDS selected via the config (#8265)
ftxmoJason Apr 25, 2022
f395eac
Prebid Core: Support for multiple bidder codes from a single adapter …
pm-azhar-mulla Apr 25, 2022
876172b
domain change (#8318)
stsepelin Apr 26, 2022
801c2d7
nexx360 Bid Adapter : gvlid added and params updated with bidfloor an…
gchicoye Apr 26, 2022
d953eaa
Evolution Bid Adapter: add id5id (#8324)
e-volution-tech Apr 26, 2022
5504cda
MobfoxPB Adapter: update adapter to comply with Prebid 5 changes (#8297)
mobfxoHB Apr 28, 2022
e1f3239
Prebid 6.22.0 release
prebidjs-release Apr 28, 2022
061eb3c
Increment version to 6.23.0-pre
prebidjs-release Apr 28, 2022
fa20923
Merge branch 'master' into prebid-7
dgirardi Apr 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ aliases:

- &run_endtoend_test
name: BrowserStack End to end testing
command: echo "127.0.0.1 test.localhost" | sudo tee -a /etc/hosts && gulp e2e-test --host=test.localhost
command: gulp e2e-test

# Download and run BrowserStack local
- &setup_browserstack
Expand Down Expand Up @@ -82,16 +82,6 @@ workflows:
commit:
jobs:
- build
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- e2etest

experimental:
pipelines: true
123 changes: 52 additions & 71 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var prebid = require('./package.json');
var dateString = 'Updated : ' + (new Date()).toISOString().substring(0, 10);
var banner = '/* <%= prebid.name %> v<%= prebid.version %>\n' + dateString + '*/\n';
var port = 9999;
const FAKE_SERVER_HOST = argv.host ? argv.host : 'localhost';
const FAKE_SERVER_PORT = 4444;
const INTEG_SERVER_HOST = argv.host ? argv.host : 'localhost';
const INTEG_SERVER_PORT = 4444;
const { spawn } = require('child_process');

// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
Expand Down Expand Up @@ -167,9 +167,9 @@ function gulpBundle(dev) {
return bundle(dev).pipe(gulp.dest('build/' + (dev ? 'dev' : 'dist')));
}

function nodeBundle(modules) {
function nodeBundle(modules, dev = false) {
return new Promise((resolve, reject) => {
bundle(false, modules)
bundle(dev, modules)
.on('error', (err) => {
reject(err);
})
Expand Down Expand Up @@ -243,41 +243,18 @@ function testTaskMaker(options = {}) {
if (options.notest) {
done();
} else if (options.e2e) {
let wdioCmd = path.join(__dirname, 'node_modules/.bin/wdio');
let wdioConf = path.join(__dirname, 'wdio.conf.js');
let wdioOpts;

if (options.file) {
wdioOpts = [
wdioConf,
`--spec`,
`${options.file}`
]
} else {
wdioOpts = [
wdioConf
];
}

// run fake-server
const fakeServer = spawn('node', ['./test/fake-server/index.js', `--port=${FAKE_SERVER_PORT}`]);
fakeServer.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
fakeServer.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});

execa(wdioCmd, wdioOpts, { stdio: 'inherit' })
const integ = startIntegServer();
startLocalServer();
runWebdriver(options)
.then(stdout => {
// kill fake server
fakeServer.kill('SIGINT');
integ.kill('SIGINT');
done();
process.exit(0);
})
.catch(err => {
// kill fake server
fakeServer.kill('SIGINT');
integ.kill('SIGINT');
done(new Error(`Tests failed with error: ${err}`));
process.exit(1);
});
Expand All @@ -296,6 +273,26 @@ function testTaskMaker(options = {}) {

const test = testTaskMaker();

function runWebdriver({file}) {
process.env.TEST_SERVER_HOST = argv.host || 'localhost';
let wdioCmd = path.join(__dirname, 'node_modules/.bin/wdio');
let wdioConf = path.join(__dirname, 'wdio.conf.js');
let wdioOpts;

if (file) {
wdioOpts = [
wdioConf,
`--spec`,
`${file}`
]
} else {
wdioOpts = [
wdioConf
];
}
return execa(wdioCmd, wdioOpts, { stdio: 'inherit' });
}

function newKarmaCallback(done) {
return function (exitCode) {
if (exitCode) {
Expand Down Expand Up @@ -335,41 +332,29 @@ function buildPostbid() {
.pipe(gulp.dest('build/postbid/'));
}

function setupE2e(done) {
if (!argv.host) {
throw new gutil.PluginError({
plugin: 'E2E test',
message: gutil.colors.red('Host should be defined e.g. ap.localhost, anlocalhost. localhost cannot be used as safari browserstack is not able to connect to localhost')
});
function startIntegServer(dev = false) {
const args = ['./test/fake-server/index.js', `--port=${INTEG_SERVER_PORT}`, `--host=${INTEG_SERVER_HOST}`];
if (dev) {
args.push('--dev=true')
}
process.env.TEST_SERVER_HOST = argv.host;
if (argv.https) {
process.env.TEST_SERVER_PROTOCOL = argv.https;
}
argv.e2e = true;
done();
}

function injectFakeServerEndpoint() {
return gulp.src(['build/dist/*.js'])
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', `http://${FAKE_SERVER_HOST}:${FAKE_SERVER_PORT}`))
.pipe(gulp.dest('build/dist'));
}

function injectFakeServerEndpointDev() {
return gulp.src(['build/dev/*.js'])
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', `http://${FAKE_SERVER_HOST}:${FAKE_SERVER_PORT}`))
.pipe(gulp.dest('build/dev'));
}

function startFakeServer() {
const fakeServer = spawn('node', ['./test/fake-server/index.js', `--port=${FAKE_SERVER_PORT}`]);
fakeServer.stdout.on('data', (data) => {
const srv = spawn('node', args);
srv.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
fakeServer.stderr.on('data', (data) => {
srv.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
return srv;
}

function startLocalServer(options = {}) {
connect.server({
https: argv.https,
port: port,
host: INTEG_SERVER_HOST,
root: './',
livereload: options.livereload
});
}

// Watch Task with Live Reload
Expand All @@ -385,13 +370,7 @@ function watchTaskMaker(options = {}) {
'modules/**/*.js',
].concat(options.alsoWatch));

connect.server({
https: argv.https,
port: port,
host: FAKE_SERVER_HOST,
root: './',
livereload: options.livereload
});
startLocalServer(options);

mainWatcher.on('all', options.task());
done();
Expand Down Expand Up @@ -427,11 +406,13 @@ gulp.task('build-postbid', gulp.series(escapePostbidConfig, buildPostbid));
gulp.task('serve', gulp.series(clean, lint, gulp.parallel('build-bundle-dev', watch, test)));
gulp.task('serve-fast', gulp.series(clean, gulp.parallel('build-bundle-dev', watchFast)));
gulp.task('serve-and-test', gulp.series(clean, gulp.parallel('build-bundle-dev', watchFast, testTaskMaker({watch: true}))));
gulp.task('serve-fake', gulp.series(clean, gulp.parallel('build-bundle-dev', watch), injectFakeServerEndpointDev, test, startFakeServer));
gulp.task('serve-e2e', gulp.series(clean, 'build-bundle-prod', gulp.parallel(() => startIntegServer(), startLocalServer)))
gulp.task('serve-e2e-dev', gulp.series(clean, 'build-bundle-dev', gulp.parallel(() => startIntegServer(true), startLocalServer)))

gulp.task('default', gulp.series(clean, 'build-bundle-prod'));

gulp.task('e2e-test', gulp.series(clean, setupE2e, gulp.parallel('build-bundle-prod', watch), injectFakeServerEndpoint, test));
gulp.task('e2e-test-only', () => runWebdriver({file: argv.file}))
gulp.task('e2e-test', gulp.series(clean, 'build-bundle-prod', testTaskMaker({e2e: true})));
// other tasks
gulp.task(bundleToStdout);
gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step
Expand Down
110 changes: 67 additions & 43 deletions modules/adomikAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import adapterManager from '../src/adapterManager.js';
import {logInfo} from '../src/utils.js';
import {find, findIndex} from '../src/polyfill.js';

// Events used in adomik analytics adapter
// Events used in adomik analytics adapter.
const auctionInit = CONSTANTS.EVENTS.AUCTION_INIT;
const auctionEnd = CONSTANTS.EVENTS.AUCTION_END;
const bidRequested = CONSTANTS.EVENTS.BID_REQUESTED;
Expand All @@ -30,17 +30,13 @@ let adomikAdapter = Object.assign(adapter({}),
break;

case bidResponse:
adomikAdapter.bucketEvents.push({
type: 'response',
event: adomikAdapter.buildBidResponse(args)
});
adomikAdapter.saveBidResponse(args);
break;

case bidWon:
adomikAdapter.sendWonEvent({
id: args.adId,
placementCode: args.adUnitCode
});
args.id = args.adId;
args.placementCode = args.adUnitCode;
adomikAdapter.sendWonEvent(args);
break;

case bidRequested:
Expand Down Expand Up @@ -69,16 +65,28 @@ adomikAdapter.initializeBucketEvents = function() {
adomikAdapter.bucketEvents = [];
}

adomikAdapter.saveBidResponse = function(args) {
let responseSaved = adomikAdapter.bucketEvents.find((bucketEvent) =>
bucketEvent.type == 'response' && bucketEvent.event.id == args.id
);
if (responseSaved) { return true; }
adomikAdapter.bucketEvents.push({
type: 'response',
event: adomikAdapter.buildBidResponse(args)
});
}

adomikAdapter.maxPartLength = function () {
return (ua.includes(' MSIE ')) ? 1600 : 60000;
};

adomikAdapter.sendTypedEvent = function() {
let [testId, testValue] = adomikAdapter.getKeyValues();
const groupedTypedEvents = adomikAdapter.buildTypedEvents();

const bulkEvents = {
testId: adomikAdapter.currentContext.testId,
testValue: adomikAdapter.currentContext.testValue,
testId: testId,
testValue: testValue,
uid: adomikAdapter.currentContext.uid,
ahbaid: adomikAdapter.currentContext.id,
hostname: window.location.hostname,
Expand Down Expand Up @@ -114,10 +122,8 @@ adomikAdapter.sendTypedEvent = function() {
const stringBulkEvents = JSON.stringify(bulkEvents)
logInfo('Events sent to adomik prebid analytic ' + stringBulkEvents);

// Encode object in base64
const encodedBuf = window.btoa(stringBulkEvents);

// Create final url and split it (+endpoint length)
const encodedUri = encodeURIComponent(encodedBuf);
const maxLength = adomikAdapter.maxPartLength();
const splittedUrl = encodedUri.match(new RegExp(`.{1,${maxLength}}`, 'g'));
Expand All @@ -130,16 +136,18 @@ adomikAdapter.sendTypedEvent = function() {
};

adomikAdapter.sendWonEvent = function (wonEvent) {
let keyValues = { testId: adomikAdapter.currentContext.testId, testValue: adomikAdapter.currentContext.testValue }
wonEvent = {...wonEvent, ...keyValues}
const stringWonEvent = JSON.stringify(wonEvent)
let [testId, testValue] = adomikAdapter.getKeyValues();
let keyValues = { testId: testId, testValue: testValue };
let samplingInfo = { sampling: adomikAdapter.currentContext.sampling };
wonEvent = { ...adomikAdapter.buildBidResponse(wonEvent), ...keyValues, ...samplingInfo };

const stringWonEvent = JSON.stringify(wonEvent);
logInfo('Won event sent to adomik prebid analytic ' + stringWonEvent);

// Encode object in base64
const encodedBuf = window.btoa(stringWonEvent);
const encodedUri = encodeURIComponent(encodedBuf);
const img = new Image(1, 1);
img.src = `https://${adomikAdapter.currentContext.url}/?q=${encodedUri}&id=${adomikAdapter.currentContext.id}&won=true`
img.src = `https://${adomikAdapter.currentContext.url}/?q=${encodedUri}&id=${adomikAdapter.currentContext.id}&won=true`;
}

adomikAdapter.buildBidResponse = function (bid) {
Expand Down Expand Up @@ -201,33 +209,49 @@ adomikAdapter.buildTypedEvents = function () {
return groupedTypedEvents;
}

adomikAdapter.adapterEnableAnalytics = adomikAdapter.enableAnalytics;
adomikAdapter.getKeyValues = function () {
let preventTest = sessionStorage.getItem(window.location.hostname + '_NoAdomikTest')
let inScope = sessionStorage.getItem(window.location.hostname + '_AdomikTestInScope')
let keyValues = JSON.parse(sessionStorage.getItem(window.location.hostname + '_AdomikTest'))
let testId;
let testValue;
if (typeof (keyValues) === 'object' && keyValues != undefined && !preventTest && inScope) {
testId = keyValues.testId
testValue = keyValues.testOptionLabel
}
return [testId, testValue]
}

adomikAdapter.enableAnalytics = function (config) {
adomikAdapter.currentContext = {};
const initOptions = config.options;

_sampled = typeof config === 'undefined' ||
typeof config.sampling === 'undefined' ||
Math.random() < parseFloat(config.sampling);

if (_sampled) {
if (initOptions) {
adomikAdapter.currentContext = {
uid: initOptions.id,
url: initOptions.url,
testId: initOptions.testId,
testValue: initOptions.testValue,
id: '',
timeouted: false,
sampling: config.sampling
}
logInfo('Adomik Analytics enabled with config', initOptions);
adomikAdapter.adapterEnableAnalytics(config);
}
} else {
logInfo('Adomik Analytics ignored for sampling', config.sampling);
adomikAdapter.enable = function(options) {
adomikAdapter.currentContext = {
uid: options.id,
url: options.url,
id: '',
timeouted: false,
sampling: options.sampling
}
logInfo('Adomik Analytics enabled with config', options);
adomikAdapter.adapterEnableAnalytics(options);
};

adomikAdapter.checkOptions = function(options) {
if (typeof options !== 'undefined') {
if (options.id && options.url) { adomikAdapter.enable(options); } else { logInfo('Adomik Analytics disabled because id and/or url is missing from config', options); }
} else { logInfo('Adomik Analytics disabled because config is missing'); }
};

adomikAdapter.checkSampling = function(options) {
_sampled = typeof options === 'undefined' ||
typeof options.sampling === 'undefined' ||
(options.sampling > 0 && Math.random() < parseFloat(options.sampling));
if (_sampled) { adomikAdapter.checkOptions(options) } else { logInfo('Adomik Analytics ignored for sampling', options.sampling); }
};

adomikAdapter.adapterEnableAnalytics = adomikAdapter.enableAnalytics;

adomikAdapter.enableAnalytics = function ({ provider, options }) {
logInfo('Adomik Analytics enableAnalytics', provider);
adomikAdapter.checkSampling(options);
};

adapterManager.registerAnalyticsAdapter({
Expand Down
2 changes: 1 addition & 1 deletion modules/adotBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const BIDDER_CODE = 'adot';
const ADAPTER_VERSION = 'v2.0.0';
const BID_METHOD = 'POST';
const BIDDER_URL = 'https://dsp.adotmob.com/headerbidding{PUBLISHER_PATH}/bidrequest';
const REQUIRED_VIDEO_PARAMS = ['mimes', 'minduration', 'maxduration', 'protocols'];
const REQUIRED_VIDEO_PARAMS = ['mimes', 'protocols'];
const DOMAIN_REGEX = new RegExp('//([^/]*)');
const FIRST_PRICE = 1;
const IMP_BUILDER = { banner: buildBanner, video: buildVideo, native: buildNative };
Expand Down
Loading