Skip to content

Commit

Permalink
Merge pull request #95 from freestarcapital/ENG-4157
Browse files Browse the repository at this point in the history
Eng 4157
  • Loading branch information
aecook authored May 27, 2020
2 parents 63cd38d + 12a78ef commit d1b4bff
Show file tree
Hide file tree
Showing 175 changed files with 10,253 additions and 3,513 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ workflows:
- master
jobs:
- e2etest

experimental:
pipelines: true
13 changes: 9 additions & 4 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ For modules and core platform updates, the initial reviewer should request an ad

## Ticket Coordinator

Each week, Prebid Org assigns one person to keep an eye on incoming issues and PRs. That person should:
Each week, Prebid Org assigns one person to keep an eye on incoming issues and PRs. Every Monday morning a reminder is
sent to the prebid-js slack channel with a link to the spreadsheet. If you're on rotation, please check that list each
Monday to see if you're on-duty.

When on-duty:
- Review issues and PRs at least once per weekday for new items. Encourage a 48 "SLA" on PRs/issues assigned. Aim for touchpoint once every 48/hours.
- For PRs: assign PRs to individuals on the PR review list. Try to be equitable -- not all PRs are created equally. Use the "Assigned" field and add the "Needs Review" label.
- For PRs: assign PRs to individuals on the **PR review list**. Try to be equitable -- not all PRs are created equally. Use the "Assigned" field and add the "Needs Review" label.
- For Issues: try to address questions and troubleshooting requests on your own, assigning them to others as needed. Please add labels as appropriate (I.E. bug, question, backlog etc).
- Issues that are questions or troubleshooting requests may be closed if the originator doesn't respond within a week to requests for confirmation or details.
- Issues that are bug reports should be left open and assigned to someone in PR rotation to confirm or deny the bug status.
- It's polite to check with others before assigning them large tasks.
- If possible, check in on older items and see if they can be unstuck.
- It's polite to check with others before assigning them extra-large tasks.
- If possible, check in on older PRs and Issues and see if they can be unstuck.
- Perform the weekly Prebid.js release per instructions at https://github.com/prebid/Prebid.js/blob/master/RELEASE_SCHEDULE.md . This generally takes place on Tues or Weds.
12 changes: 6 additions & 6 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

const sharedWhiteList = [
'core-js/library/fn/array/find', // no ie11
'core-js/library/fn/array/includes', // no ie11
'core-js/library/fn/set', // ie11 supports Set but not Set#values
'core-js/library/fn/string/includes', // no ie11
'core-js/library/fn/number/is-integer', // no ie11,
'core-js/library/fn/array/from' // no ie11
'core-js-pure/features/array/find', // no ie11
'core-js-pure/features/array/includes', // no ie11
'core-js-pure/features/set', // ie11 supports Set but not Set#values
'core-js-pure/features/string/includes', // no ie11
'core-js-pure/features/number/is-integer', // no ie11,
'core-js-pure/features/array/from' // no ie11
];

module.exports = {
Expand Down
4 changes: 3 additions & 1 deletion gulpHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ module.exports = {
if (fs.lstatSync(modulePath).isDirectory()) {
modulePath = path.join(modulePath, 'index.js')
}
memo[modulePath] = moduleName;
if (fs.existsSync(modulePath)) {
memo[modulePath] = moduleName;
}
return memo;
}, {});
} catch (err) {
Expand Down
83 changes: 0 additions & 83 deletions integrationExamples/gpt/audienceNetwork_dfp.html

This file was deleted.

4 changes: 2 additions & 2 deletions modules/1ad4goodBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as utils from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import find from 'core-js/library/fn/array/find.js';
import includes from 'core-js/library/fn/array/includes.js';
import find from 'core-js-pure/features/array/find.js';
import includes from 'core-js-pure/features/array/includes.js';

const BIDDER_CODE = '1ad4good';
const URL = 'https://hb.1ad4good.org/prebid';
Expand Down
2 changes: 1 addition & 1 deletion modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import find from 'core-js/library/fn/array/find.js';
import find from 'core-js-pure/features/array/find.js';
import * as utils from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { loadExternalScript } from '../src/adloader.js'
Expand Down
6 changes: 5 additions & 1 deletion modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,15 @@ function getAdDetails(ad) {
if (isAdheseAd(ad)) {
creativeId = ad.id;
dealId = ad.orderId;
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter };
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter, slotId: ad.slotID, slotName: ad.slotName, advertiserId: ad.advertiserId, adId: ad.id };
} else {
creativeId = ad.origin + (ad.originInstance ? '-' + ad.originInstance : '');
if (ad.originData) {
originData = ad.originData;
originData.slotId = ad.slotID;
originData.slotName = ad.slotName;
originData.adType = ad.adType;
if (ad.adFormat) originData.adFormat = ad.adFormat;
if (ad.originData.seatbid && ad.originData.seatbid.length) {
const seatbid = ad.originData.seatbid[0];
if (seatbid.bid && seatbid.bid.length) {
Expand Down
4 changes: 2 additions & 2 deletions modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as utils from '../src/utils.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import find from 'core-js/library/fn/array/find.js';
import includes from 'core-js/library/fn/array/includes.js';
import find from 'core-js-pure/features/array/find.js';
import includes from 'core-js-pure/features/array/includes.js';

/*
* In case you're AdKernel whitelable platform's client who needs branded adapter to
Expand Down
16 changes: 15 additions & 1 deletion modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ export const spec = {
buildRequests: function (validRequest, bidderRequest) {
const payload = {
imps: [],
referrer: encodeURIComponent(bidderRequest.refererInfo.referer),
};
if (bidderRequest) {
if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
payload.referrer = encodeURIComponent(bidderRequest.refererInfo.referer);
}
if (bidderRequest.gdprConsent) {
payload.gdprConsent = {
consentString: bidderRequest.gdprConsent.consentString,
// will check if the gdprApplies field was populated with a boolean value (ie from page config). If it's undefined, then default to true
gdprApplies: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
}
}
if (bidderRequest.uspConsent) {
payload.uspConsent = bidderRequest.uspConsent;
}
}
validRequest.forEach((bid) => {
payload.imps.push(bid);
});
Expand Down
4 changes: 2 additions & 2 deletions modules/adomikAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import adapter from '../src/AnalyticsAdapter.js';
import CONSTANTS from '../src/constants.json';
import adapterManager from '../src/adapterManager.js';
import { logInfo } from '../src/utils.js';
import find from 'core-js/library/fn/array/find.js';
import findIndex from 'core-js/library/fn/array/find-index.js';
import find from 'core-js-pure/features/array/find.js';
import findIndex from 'core-js-pure/features/array/find-index.js';

// Events used in adomik analytics adapter
const auctionInit = CONSTANTS.EVENTS.AUCTION_INIT;
Expand Down
2 changes: 1 addition & 1 deletion modules/adotBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Renderer} from '../src/Renderer.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {isStr, isArray, isNumber, isPlainObject, isBoolean, logError} from '../src/utils.js';
import find from 'core-js/library/fn/array/find.js';
import find from 'core-js-pure/features/array/find.js';

const ADAPTER_VERSION = 'v1.0.0';
const BID_METHOD = 'POST';
Expand Down
6 changes: 3 additions & 3 deletions modules/adpod.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import { setupBeforeHookFnOnce, module } from '../src/hook.js';
import { store } from '../src/videoCache.js';
import { config } from '../src/config.js';
import { ADPOD } from '../src/mediaTypes.js';
import Set from 'core-js/library/fn/set.js';
import find from 'core-js/library/fn/array/find.js';
import Set from 'core-js-pure/features/set';
import find from 'core-js-pure/features/array/find.js';
import { auctionManager } from '../src/auctionManager.js';
import CONSTANTS from '../src/constants.json';

const from = require('core-js/library/fn/array/from.js');
const from = require('core-js-pure/features/array/from.js');

const TARGETING_KEY_PB_CAT_DUR = 'hb_pb_cat_dur';
const TARGETING_KEY_CACHE_ID = 'hb_cache_id';
Expand Down
102 changes: 102 additions & 0 deletions modules/adprimeBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import * as utils from '../src/utils.js';

const BIDDER_CODE = 'adprime';
const AD_URL = 'https://delta.adprime.com/?c=o&m=multi';

function isBidResponseValid(bid) {
if (!bid.requestId || !bid.cpm || !bid.creativeId ||
!bid.ttl || !bid.currency) {
return false;
}
switch (bid.mediaType) {
case BANNER:
return Boolean(bid.width && bid.height && bid.ad);
case VIDEO:
return Boolean(bid.vastUrl);
case NATIVE:
return Boolean(bid.native && bid.native.title && bid.native.image && bid.native.impressionTrackers);
default:
return false;
}
}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

isBidRequestValid: (bid) => {
return Boolean(bid.bidId && bid.params && !isNaN(parseInt(bid.params.placementId)));
},

buildRequests: (validBidRequests = [], bidderRequest) => {
let winTop = window;
let location;
try {
location = new URL(bidderRequest.refererInfo.referer)
winTop = window.top;
} catch (e) {
location = winTop.location;
utils.logMessage(e);
};
let placements = [];
let request = {
'deviceWidth': winTop.screen.width,
'deviceHeight': winTop.screen.height,
'language': (navigator && navigator.language) ? navigator.language.split('-')[0] : '',
'secure': 1,
'host': location.host,
'page': location.pathname,
'placements': placements
};
if (bidderRequest) {
if (bidderRequest.uspConsent) {
request.ccpa = bidderRequest.uspConsent;
}
if (bidderRequest.gdprConsent) {
request.gdpr = bidderRequest.gdprConsent
}
}
const len = validBidRequests.length;

for (let i = 0; i < len; i++) {
let bid = validBidRequests[i];
let sizes
if (bid.mediaTypes) {
if (bid.mediaTypes[BANNER] && bid.mediaTypes[BANNER].sizes) {
sizes = bid.mediaTypes[BANNER].sizes
} else if (bid.mediaTypes[VIDEO] && bid.mediaTypes[VIDEO].playerSize) {
sizes = bid.mediaTypes[VIDEO].playerSize
}
}
placements.push({
placementId: bid.params.placementId,
bidId: bid.bidId,
sizes: sizes || [],
wPlayer: sizes ? sizes[0] : 0,
hPlayer: sizes ? sizes[1] : 0,
traffic: bid.params.traffic || BANNER,
schain: bid.schain || {}
});
}
return {
method: 'POST',
url: AD_URL,
data: request
};
},

interpretResponse: (serverResponse) => {
let response = [];
for (let i = 0; i < serverResponse.body.length; i++) {
let resItem = serverResponse.body[i];
if (isBidResponseValid(resItem)) {
response.push(resItem);
}
}
return response;
},
};

registerBidder(spec);
Loading

0 comments on commit d1b4bff

Please sign in to comment.