Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/prebid/Prebid.js
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/prebid/Prebid.js: (51 commits)
  Update maintainer email (prebid#2132)
  Replace event string with constant (prebid#2128)
  Add adapter for IAS (prebid#2056)
  Fix sovrn dealid (prebid#2119)
  Added support for NURL and ADM as backup (prebid#2112)
  fix bug where hooked functions w/ no hooks weren't ran immediately (prebid#2115)
  Increment pre version
  Prebid 1.3.1 Release
  Omit app and device if not present rather than send false (prebid#2116)
  Increment pre version
  Prebid.js 1.3.0 Release
  Unit test fixes (prebid#2111)
  must explicitly list pre1api for it to be included in build (prebid#2097)
  adkernel adapter additional bid parameters (prebid#2105)
  removing userSync (prebid#2032)
  33across Bid Adapter: Bugfix + Refactor (prebid#2024)
  Port calling order fix to 1.x  (prebid#2067)
  Update adform adapter request (prebid#2107)
  Serverbid Bid Adapter: getUserSyncs and new adsizes (prebid#2106)
  Add hfa and pv parameter to request payload (prebid#2109)
  ...
  • Loading branch information
m.sorochuk committed Feb 12, 2018
2 parents 580f670 + c31cc52 commit 511e124
Show file tree
Hide file tree
Showing 77 changed files with 5,073 additions and 519 deletions.
25 changes: 23 additions & 2 deletions pr_review.md → PR_REVIEW.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Summary
We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-better-code-reviews-16109e0fdd36#.xa8lc4i23 to understand how a PR review should be conducted. Be rational and strict in your review, make sure you understand exactly what the submitter's intent is. Overall 1 person should take ownership of a particular PR. When they are satisfied it's in good condition to merge, they should request 1 additional team member to review as a sanity check. Only when the PR has 2 `LGTM` from the core team should it be merged.
We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-better-code-reviews-16109e0fdd36#.xa8lc4i23 to understand how a PR review should be conducted. Be rational and strict in your review, make sure you understand exactly what the submitter's intent is. Anyone in the community can review a PR, but a Prebid Org member is also required. A Prebid Org member should take ownership of a PR and do the initial review.

If the PR is for a standard bid adapter or a standard analytics adapter, just the one review from a core member is sufficient. The reviewer will check against [required conventions](http://prebid.org/dev-docs/bidder-adaptor.html#required-adapter-conventions) and may merge the PR after approving and confirming that the documentation PR against prebid.org is open and linked to the issue.

For modules and core platform updates, the initial reviewer should request an additional team member to review as a sanity check. Merge should only happen when the PR has 2 `LGTM` from the core team and a documentation PR if required.

### General PR review Process
- Checkout the branch (these instructions are available on the github PR page as well).
Expand All @@ -13,7 +17,7 @@ We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-b
- If all above is good, add a `LGTM` comment and request 1 additional core member to review.
- Once there is 2 `LGTM` on the PR, merge to master
- Ask the submitter to add a PR for documentation if applicable.
- Add a line into the `draft release` notes for this submission. If no draft release is available, create one using this template https://gist.github.com/mkendall07/c3af6f4691bed8a46738b3675cb5a479
- Add a line into the `draft release` notes for this submission. If no draft release is available, create one using [this template]( https://gist.github.com/mkendall07/c3af6f4691bed8a46738b3675cb5a479)

### New Adapter or updates to adapter process
- Follow steps above for general review process. In addition, please verify the following:
Expand All @@ -23,3 +27,20 @@ We take PR review seriously. Please read https://medium.com/@mrjoelkemp/giving-b
- Verify that code re-use is being done properly and that changes introduced by a bidder don't impact other bidders.
- If the adapter being submitted is an alias type, check with the bidder contact that is being aliased to make sure it's allowed.
- If the adapter is triggering any user syncs make sure they are using the user sync module in the Prebid.js core.
- Requests to the bidder should support HTTPS
- Responses from the bidder should be compressed (such as gzip, compress, deflate)
- Bid responses may not use JSONP: All requests must be AJAX with JSON responses
- All user-sync (aka pixel) activity must be registered via the provided functions
- Adapters may not use the $$PREBID_GLOBAL$$ variable
- All adapters must support the creation of multiple concurrent instances. This means, for example, that adapters cannot rely on mutable global variables.

## Ticket Coordinator

Each week, Prebid Org assigns one person to keep an eye on incoming issues and PRs. That person should:
- Review issues and PRs at least once per weekday for new items.
- 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.
- 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.
7 changes: 6 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,17 @@ function nodeBundle(modules) {
});
}

// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
var explicitModules = [
'pre1api'
];

function bundle(dev, moduleArr) {
var modules = moduleArr || helpers.getArgModules(),
allModules = helpers.getModuleNames(modules);

if(modules.length === 0) {
modules = allModules;
modules = allModules.filter(module => !explicitModules.includes(module));
} else {
var diff = _.difference(modules, allModules);
if(diff.length !== 0) {
Expand Down
103 changes: 103 additions & 0 deletions integrationExamples/gpt/serverbidServer_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<html>
<head>
<script>
var PREBID_TIMEOUT = 3000;

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

function initAdserver() {
if (pbjs.initAdserverSet) return;
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
pbjs.initAdserverSet = true;
};
setTimeout(initAdserver, PREBID_TIMEOUT);

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
(function() {
var pbjsEl = document.createElement("script");
pbjsEl.type = "text/javascript";
pbjsEl.async = true;
pbjsEl.src = '/build/dev/prebid.js';
var pbjsTargetEl = document.getElementsByTagName("head")[0];
pbjsTargetEl.insertBefore(pbjsEl, pbjsTargetEl.firstChild);
})();

pbjs.que.push(function() {
var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250], [300,600]],
bids: [
{
bidder: 'appnexus',
params: {
placementId: '12224129'
}
},
]
}];

pbjs.setConfig({
bidderTimeout: 3000,
s2sConfig : {
enabled : true,
bidders : ['appnexus'],
timeout : 1000,
networkId: '9969',
siteId: '985041',
adapter: 'serverbidServer',
//The accountId and endpoint are required by Prebid for validation
//but are not used by ServerBid. They can either be filled in with
//nonsense values, or left out entirely. If left out you will see
//errors in the browser console, but nothing will actually be wrong.
accountId: 9000,
endpoint: "unused"
}
});

pbjs.addAdUnits(adUnits);

pbjs.requestBids({
bidsBackHandler: function(bidResponses) {
initAdserver();
}
})
});
</script>

<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());

pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
});

googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Prebid.js S2S Example</h2>

<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
</body>
</html>
23 changes: 13 additions & 10 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function _createBidResponse(response) {
height: response.seatbid[0].bid[0].h,
ad: response.seatbid[0].bid[0].adm,
ttl: response.seatbid[0].bid[0].ttl || 60,
creativeId: response.seatbid[0].bid[0].ext.rp.advid,
creativeId: response.seatbid[0].bid[0].crid,
currency: response.cur,
netRevenue: true
}
Expand All @@ -27,6 +27,9 @@ function _createServerRequest(bidRequest) {
const ttxRequest = {};
const params = bidRequest.params;

/*
* Infer data for the request payload
*/
ttxRequest.imp = [];
ttxRequest.imp[0] = {
banner: {
Expand All @@ -38,22 +41,27 @@ function _createServerRequest(bidRequest) {
}
}
}

ttxRequest.site = { id: params.siteId };

// Go ahead send the bidId in request to 33exchange so it's kept track of in the bid response and
// therefore in ad targetting process
ttxRequest.id = bidRequest.bidId;
// Finally, set the openRTB 'test' param if this is to be a test bid
if (params.test === 1) {
ttxRequest.test = 1;
}

/*
* Now construt the full server request
*/
const options = {
contentType: 'application/json',
withCredentials: false
};

// Allow the ability to configure the HB endpoint for testing purposes.
const ttxSettings = config.getConfig('ttxSettings');
const url = (ttxSettings && ttxSettings.url) || END_POINT;

// Return the server request
return {
'method': 'POST',
'url': url,
Expand Down Expand Up @@ -93,12 +101,7 @@ function isBidRequestValid(bid) {
return false;
}

if ((typeof bid.params.site === 'undefined' || typeof bid.params.site.id === 'undefined') &&
(typeof bid.params.siteId === 'undefined')) {
return false;
}

if (typeof bid.params.productId === 'undefined') {
if (typeof bid.params.siteId === 'undefined' || typeof bid.params.productId === 'undefined') {
return false;
}

Expand Down
3 changes: 1 addition & 2 deletions modules/adformBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {registerBidder} from 'src/adapters/bidderFactory';
const BIDDER_CODE = 'adform';
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [],
isBidRequestValid: function (bid) {
return !!(bid.params.mid);
},
Expand Down Expand Up @@ -35,7 +34,7 @@ export const spec = {

request.unshift('//' + globalParams[0][1] + '/adx/?rp=4');

request.push('stid=' + validBidRequests[0].requestId);
request.push('stid=' + validBidRequests[0].auctionId);

for (i = 1, l = globalParams.length; i < l; i++) {
_key = globalParams[i][0];
Expand Down
Loading

0 comments on commit 511e124

Please sign in to comment.