Skip to content

Commit

Permalink
merge master branch and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker committed Sep 5, 2018
2 parents e7fd5bb + 7945098 commit 624166c
Show file tree
Hide file tree
Showing 255 changed files with 8,944 additions and 5,353 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = {
// Violations of these styles should be fixed, and the exceptions removed over time.
//
// See Issue #1111.
"camelcase": "off",
"eqeqeq": "off",
"no-return-assign": "off",
"no-throw-literal": "off",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Code Climate](https://codeclimate.com/github/prebid/Prebid.js/badges/gpa.svg)](https://codeclimate.com/github/prebid/Prebid.js)
[![Coverage Status](https://coveralls.io/repos/github/prebid/Prebid.js/badge.svg)](https://coveralls.io/github/prebid/Prebid.js)
[![devDependencies Status](https://david-dm.org/prebid/Prebid.js/dev-status.svg)](https://david-dm.org/prebid/Prebid.js?type=dev)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/prebid/Prebid.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/prebid/Prebid.js/alerts/)

# Prebid.js

Expand Down
26 changes: 22 additions & 4 deletions RELEASE_SCHEDULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ Announcements regarding releases will be made to the #headerbidding-dev channel

## Release Process

1. Make Sure all browserstack tests are passing. On PR merge to master travis will run unit tests on browserstack. Checking the last travis build [here](https://travis-ci.org/prebid/Prebid.js/branches) for master branch will show you detailed results.
_Note: If `github.com/prebid/Prebid.js` is not configured as the git origin for your repo, all of the following git commands will have to be modified to reference the proper remote (e.g. `upstream`)_

1. Make Sure all browserstack tests are passing. On PR merge to master CircleCI will run unit tests on browserstack. Checking the last CircleCI build [here](https://circleci.com/gh/prebid) for master branch will show you detailed results.

In case of failure do following,
- Try to fix the failing tests.
- If you are not able to fix tests in time. Skip the test, create issue and tag contributor.

#### How to run tests in browserstack

_Note: the following browserstack information is only relevant for debugging purposes, if you will not be debugging then it can be skipped._

Set the environment variables. You may want to add these to your `~/.bashrc` for convenience.

Expand Down Expand Up @@ -59,11 +63,12 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
Pull these changes locally by running command
```
git pull
git fetch --tags
```

and verify the tag.

5. Update coveralls
5. Update coveralls _(skip for legacy)_

We use https://coveralls.io/ to show parts of code covered by unit tests.

Expand All @@ -75,22 +80,35 @@ Announcements regarding releases will be made to the #headerbidding-dev channel

Run `gulp coveralls` to update code coverage history.

6. Distribute the code
6. Distribute the code

_Note: do not go to step 7 until step 6 has been verified completed._

Reach out to any of the Appnexus folks to trigger the jenkins job.

// TODO
Jenkins job is moving files to appnexus cdn, pushing prebid.js to npm, purging cache and sending notification to slack.
Move all the files from Appnexus CDN to jsDelivr and create bash script to do above tasks.

7. Post Release Steps
7. Post Release Version

Update the version
Manually edit Prebid's package.json to become "1.x.x-pre" (using the values for the next release). Then commit your changes.
```
git commit -m "Increment pre version"
git push
```

8. Create new release draft

Go to [github releases](https://github.com/prebid/Prebid.js/releases) and add a new draft for the next version of Prebid.js with the following template:
```
## 🚀New Features
## 🛠Maintenance
## 🐛Bug Fixes
```

## Beta Releases

Expand Down
8 changes: 4 additions & 4 deletions governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This document describes the governance model for the Prebid project. The Prebid project’s stated mission is to facilitate fair, transparent, and effective header bidding across the industry, and is responsible for creating and maintaining such projects as [Prebid.js](https://github.com/prebid/Prebid.js).

1. A single Tech Lead oversees the technical direction of the project and appoints Core Team members
1. A single Tech Lead (PMC Chair) oversees the technical direction of the project and appoints Core Team members
2. The Core Team members maintain the project on an ongoing basis with direction from the Tech Lead.
3. In the event of any disagreements, the Tech Lead will make a final decision.
4. If there is no Tech Lead available to perform his/her duties, AppNexus Inc. will appoint one.
4. If there is no Tech Lead available to perform his/her duties, Prebid.org will appoint one.

### Roles and Responsibilities:
- **User:** Any individual who consumes / uses the Prebid.js library.
Expand All @@ -15,9 +15,9 @@ This document describes the governance model for the Prebid project. The Prebid

### Current Prebid.js Core Team
- @mkendall07 (Tech Lead)
- @protonate
- @jsnellbaker
- @matthewlane
- @jaiminpanchal27
- @snapwich
- @harpere
- @dbemiller
- @mike-chowla
21 changes: 20 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ function newKarmaCallback(done) {
// If --browserstack is given, it will run the full suite of currently supported browsers.
// If --browsers is given, browsers can be chosen explicitly. e.g. --browsers=chrome,firefox,ie9
// If --notest is given, it will immediately skip the test task (useful for developing changes with `gulp serve --notest`)

function test(done) {
if (argv.notest) {
done();
Expand Down Expand Up @@ -271,6 +270,26 @@ function coveralls() { // 2nd arg is a dependency: 'test' must be finished
.pipe(shell('cat build/coverage/lcov.info | node_modules/coveralls/bin/coveralls.js'));
}

// Watch Task with Live Reload
gulp.task('watch', function () {
gulp.watch([
'src/**/*.js',
'modules/**/*.js',
'test/spec/**/*.js',
'!test/spec/loaders/**/*.js'
], ['build-bundle-dev', 'test']);
gulp.watch([
'loaders/**/*.js',
'test/spec/loaders/**/*.js'
], ['lint']);
connect.server({
https: argv.https,
port: port,
root: './',
livereload: true
});
});

function e2eTest() {
var cmdQueue = [];
if (argv.browserstack) {
Expand Down
9 changes: 4 additions & 5 deletions integrationExamples/gpt/prebidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
var PREBID_TIMEOUT = 3000;

var googletag = googletag || {};
var sizes = [[728, 90],[300, 250], [300,600]];
googletag.cmd = googletag.cmd || [];

function initAdserver() {
Expand Down Expand Up @@ -37,12 +36,12 @@
pbjs.que.push(function() {
var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250], [300,600]],
sizes: [[300, 250]],
bids: [
{
bidder: 'appnexus',
params: {
placementId: '10433394'
placementId: '13144370'
}
}
]
Expand All @@ -56,7 +55,7 @@
bidders : ['appnexus'],
timeout : 1000, //default value is 1000
adapter : 'prebidServer', //if we have any other s2s adapter, default value is s2s
endpoint : 'https://prebid.adnxs.com/pbs/v1/auction?url_override=http%3A%2F%2Fwww.nytimes.com'
endpoint : 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction'
}
});

Expand All @@ -72,7 +71,7 @@

<script>
googletag.cmd.push(function() {
var rightSlot = googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());
var rightSlot = googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());

pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
Expand Down
14 changes: 13 additions & 1 deletion karma.conf.maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,19 @@ function setBrowsers(karmaConf, browserstack) {
karmaConf.customLaunchers = require('./browsers.json')
karmaConf.browsers = Object.keys(karmaConf.customLaunchers);
} else {
karmaConf.browsers = ['ChromeHeadless'];
var isDocker = require('is-docker')();
if (isDocker) {
karmaConf.customLaunchers = karmaConf.customLaunchers || {};
karmaConf.customLaunchers.ChromeCustom = {
base: 'ChromeHeadless',
// We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs
// more permissions than Docker allows by default)
flags: ['--no-sandbox']
}
karmaConf.browsers = ['ChromeCustom'];
} else {
karmaConf.browsers = ['ChromeHeadless'];
}
}
}

Expand Down
39 changes: 32 additions & 7 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function _createBidResponse(response) {
}
}

// infer the necessary data from valid bid for a minimal ttxRequest and create HTTP request
function _createServerRequest(bidRequest) {
// Infer the necessary data from valid bid for a minimal ttxRequest and create HTTP request
// NOTE: At this point, TTX only accepts request for a single impression
function _createServerRequest(bidRequest, gdprConsent) {
const ttxRequest = {};
const params = bidRequest.params;

Expand All @@ -48,6 +49,18 @@ function _createServerRequest(bidRequest) {
// therefore in ad targetting process
ttxRequest.id = bidRequest.bidId;

// Set GDPR related fields
ttxRequest.user = {
ext: {
consent: gdprConsent.consentString
}
}
ttxRequest.regs = {
ext: {
gdpr: (gdprConsent.gdprApplies === true) ? 1 : 0
}
}

// Finally, set the openRTB 'test' param if this is to be a test bid
if (params.test === 1) {
ttxRequest.test = 1;
Expand Down Expand Up @@ -104,11 +117,18 @@ function isBidRequestValid(bid) {
return true;
}

// NOTE: At this point, TTX only accepts request for a single impression
function buildRequests(bidRequests) {
// NOTE: With regards to gdrp consent data,
// - the server independently infers gdpr applicability therefore, setting the default value to false
// - the server, at this point, also doesn't need the consent string to handle gdpr compliance. So passing
// value whether set or not, for the sake of future dev.
function buildRequests(bidRequests, bidderRequest) {
const gdprConsent = Object.assign({ consentString: undefined, gdprApplies: false }, bidderRequest && bidderRequest.gdprConsent)

adapterState.uniqueSiteIds = bidRequests.map(req => req.params.siteId).filter(uniques);

return bidRequests.map(_createServerRequest);
return bidRequests.map((req) => {
return _createServerRequest(req, gdprConsent);
});
}

// NOTE: At this point, the response from 33exchange will only ever contain one bid i.e. the highest bid
Expand All @@ -124,8 +144,13 @@ function interpretResponse(serverResponse, bidRequest) {
}

// Register one sync per unique guid
function getUserSyncs(syncOptions) {
return (syncOptions.iframeEnabled) ? adapterState.uniqueSiteIds.map(_createSync) : ([]);
// NOTE: If gdpr applies do not sync
function getUserSyncs(syncOptions, responses, gdprConsent) {
if (gdprConsent && gdprConsent.gdprApplies === true) {
return []
} else {
return (syncOptions.iframeEnabled) ? adapterState.uniqueSiteIds.map(_createSync) : ([]);
}
}

const spec = {
Expand Down
3 changes: 2 additions & 1 deletion modules/adformBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const spec = {
var request = [];
var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ] ];
var bids = JSON.parse(JSON.stringify(validBidRequests));
var bidder = (bids[0] && bids[0].bidder) || BIDDER_CODE
for (i = 0, l = bids.length; i < l; i++) {
bid = bids[i];
if ((bid.params.priceType === 'net') || (bid.params.pt === 'net')) {
Expand Down Expand Up @@ -60,7 +61,7 @@ export const spec = {
url: request.join('&'),
bids: validBidRequests,
netRevenue: netRevenue,
bidder: 'adform',
bidder,
gdpr: gdprObject
};

Expand Down
2 changes: 1 addition & 1 deletion modules/adkernelAdnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const spec = {
return serverResponses.filter(rps => rps.body && rps.body.syncpages)
.map(rsp => rsp.body.syncpages)
.reduce((a, b) => a.concat(b), [])
.map(sync_url => ({type: 'iframe', url: sync_url}));
.map(syncUrl => ({type: 'iframe', url: syncUrl}));
}
};

Expand Down
2 changes: 1 addition & 1 deletion modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const spec = {
return serverResponses.filter(rsp => rsp.body && rsp.body.ext && rsp.body.ext.adk_usersync)
.map(rsp => rsp.body.ext.adk_usersync)
.reduce((a, b) => a.concat(b), [])
.map(sync_url => ({type: 'iframe', url: sync_url}));
.map(syncUrl => ({type: 'iframe', url: syncUrl}));
}
};

Expand Down
16 changes: 10 additions & 6 deletions modules/adoceanBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ function buildEndpointUrl(emiter, payload) {
return 'https://' + emiter + '/ad.json?' + payloadString;
}

function buildRequest(masterBidRequests, masterId) {
function buildRequest(masterBidRequests, masterId, gdprConsent) {
const firstBid = masterBidRequests[0];
const payload = {
id: masterId,
};
if (gdprConsent) {
payload.gdpr_consent = gdprConsent.consentString || undefined;
payload.gdpr = gdprConsent.gdprApplies ? 1 : 0;
}

const bidIdMap = {};

Expand Down Expand Up @@ -72,15 +76,15 @@ export const spec = {
return !!(bid.params.slaveId && bid.params.masterId && bid.params.emiter);
},

buildRequests: function(validBidRequests) {
buildRequests: function(validBidRequests, bidderRequest) {
const bidRequestsByMaster = {};
let requests = [];

utils._each(validBidRequests, function(v) {
assignToMaster(v, bidRequestsByMaster);
utils._each(validBidRequests, function(bidRequest) {
assignToMaster(bidRequest, bidRequestsByMaster);
});
requests = utils._map(bidRequestsByMaster, function(v, k) {
return buildRequest(v, k);
requests = utils._map(bidRequestsByMaster, function(requests, masterId) {
return buildRequest(requests, masterId, bidderRequest.gdprConsent);
});

return requests;
Expand Down
Loading

0 comments on commit 624166c

Please sign in to comment.