Skip to content

Commit

Permalink
Merge branch 'master' into appier-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkuo-appier committed Jun 16, 2020
2 parents 86c913a + 3de9e9c commit 2c4f7a3
Show file tree
Hide file tree
Showing 1,102 changed files with 141,292 additions and 42,761 deletions.
131 changes: 89 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,96 @@
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#

aliases:
- &environment
docker:
# specify the version you desire here
- image: circleci/node:12.16.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/Prebid.js

- &restore_dep_cache
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- &save_dep_cache
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- &install
name: Install gulp cli
command: sudo npm install -g gulp-cli

- &run_unit_test
name: BrowserStack testing
command: gulp test --browserstack --nolintfix

- &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

# Download and run BrowserStack local
- &setup_browserstack
name : Download BrowserStack Local binary and start it.
command : |
# Download the browserstack binary file
wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
# Unzip it
unzip BrowserStackLocal-linux-x64.zip
# Run the file with user's access key
./BrowserStackLocal ${BROWSERSTACK_ACCESS_KEY} &
- &unit_test_steps
- checkout
- restore_cache: *restore_dep_cache
- run: npm install
- save_cache: *save_dep_cache
- run: *install
- run: *setup_browserstack
- run: *run_unit_test

- &endtoend_test_steps
- checkout
- restore_cache: *restore_dep_cache
- run: npm install
- save_cache: *save_dep_cache
- run: *install
- run: *setup_browserstack
- run: *run_endtoend_test

version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
<<: *environment
steps: *unit_test_steps

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/Prebid.js

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: npm install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run: sudo npm install -g gulp-cli
# Download and run BrowserStack local
- run:
name : Download BrowserStack Local binary and start it.
command : |
# Download the browserstack binary file
wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
# Unzip it
unzip BrowserStackLocal-linux-x64.zip
# Run the file with user's access key
./BrowserStackLocal ${BROWSERSTACK_ACCESS_KEY} &
# run tests!
- run:
name: BrowserStack testing
command: gulp test --browserstack --nolintfix
e2etest:
<<: *environment
steps: *endtoend_test_steps

workflows:
version: 2
commit:
jobs:
- build
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- e2etest

experimental:
pipelines: true
19 changes: 17 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

const allowedModules = require("./allowedModules");

module.exports = {
"env": {
"browser": true,
Expand All @@ -11,6 +14,10 @@ module.exports = {
}
},
"extends": "standard",
"plugins": [
"prebid",
"import"
],
"globals": {
"$$PREBID_GLOBAL$$": false
},
Expand All @@ -21,6 +28,7 @@ module.exports = {
"comma-dangle": "off",
"semi": "off",
"space-before-function-paren": "off",
"import/extensions": ["error", "ignorePackages"],

// Exceptions below this line are temporary, so that eslint can be added into the CI process.
// Violations of these styles should be fixed, and the exceptions removed over time.
Expand All @@ -29,7 +37,14 @@ module.exports = {
"eqeqeq": "off",
"no-return-assign": "off",
"no-throw-literal": "off",
"no-undef": "off",
"no-undef": 2,
"no-useless-escape": "off",
}
"no-console": "error"
},
"overrides": Object.keys(allowedModules).map((key) => ({
"files": key + "/**/*.js",
"rules": {
"prebid/validate-imports": ["error", allowedModules[key]]
}
}))
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ build/coverage/
.idea/
# if you remove the above rule, at least ignore the following:

# VS Code
.vscode/

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0
12.16.1
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ commit your changes, and [open a pull request](https://help.github.com/articles/
master branch.

Pull requests must have 80% code coverage before beign considered for merge.
Additional details about the process can be found [here](./pr_review.md).
Additional details about the process can be found [here](./PR_REVIEW.md).

## Issues
[prebid.org](http://prebid.org/) contains documentation that may help answer questions you have about using Prebid.js.
Expand Down Expand Up @@ -48,8 +48,10 @@ When you are adding code to Prebid.js, or modifying code that isn't covered by a
- _Assert_: check that the expected results have occurred
- e.g., use Chai assertions to check that the expected output is equal to the actual output
- Test the public interface, not the internal implementation
- If you need to check `adloader.loadScript` in a test, use a `stub` rather than a `spy`. `spy`s trigger a network call which can result in a `script error` and cause unrelated unit tests to fail. `stub`s will let you gather information about the `adloader.loadScript` call without affecting external resources
- If you need to check `adloader.loadExternalScript` in a test, use a `stub` rather than a `spy`. `spy`s trigger a network call which can result in a `script error` and cause unrelated unit tests to fail. `stub`s will let you gather information about the `adloader.loadExternalScript` call without affecting external resources
- If your test makes ajax requests, use the global xhr stub in `test/mocks/xhr`. Do not use your own `sinon.useFakeXMLHttpRequest()` or `sinon.createFakeServer()`.
- When writing tests you may use ES2015 syntax if desired
- If your test relies on `Window` or `global` object, do not mutate that object directly. Instead, create a separate copy of that object and perform operations on that new copy.

### Test Examples
Prebid.js already has many tests. Read them to see how Prebid.js is tested, and for inspiration:
Expand Down
25 changes: 20 additions & 5 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ For modules and core platform updates, the initial reviewer should request an ad
- Review for obvious errors or bad coding practice / use best judgement here.
- If the change is a new feature / change to core prebid.js - review the change with a Tech Lead on the project and make sure they agree with the nature of change.
- If the change results in needing updates to docs (such as public API change, module interface etc), add a label for "needs docs" and inform the submitter they must submit a docs PR to update the appropriate area of Prebid.org **before the PR can merge**. Help them with finding where the docs are located on prebid.org if needed.
- Below are some examples of bidder specific updates that should require docs update (in their dev-docs/bidders/bidder.md file):
- If they support the GDPR consentManagement module and TCF1, add `gdpr_supported: true`
- If they support the GDPR consentManagement module and TCF2, add `tcf2_supported: true`
- If they support the US Privacy consentManagementUsp module, add `usp_supported: true`
- If they support one or more userId modules, add `userId: (list of supported vendors)`
- If they support video and/or native mediaTypes add `media_types: video, native`. Note that display is added by default. If you don't support display, add "no-display" as the first entry, e.g. `media_types: no-display, native`
- If they support COPPA, add `coppa_supported: true`
- If they support SChain, add `schain_supported: true`
- If their bidder doesn't work well with safeframed creatives, add `safeframes_ok: false`. This will alert publishers to not use safeframed creatives when creating the ad server entries for their bidder.
- If they're a member of Prebid.org, add `prebid_member: true`
- 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.
Expand All @@ -24,7 +34,7 @@ For modules and core platform updates, the initial reviewer should request an ad
- Follow steps above for general review process. In addition, please verify the following:
- Verify that bidder has submitted valid bid params and that bids are being received.
- Verify that bidder is not manipulating the prebid.js auction in any way or doing things that go against the principles of the project. If unsure check with the Tech Lead.
- Verify that the bidder is being as efficient as possible, ideally not loading an external library, however if they do load a library it should be cached.
- Verify that the bidder is being as efficient as possible, ideally not loading an external library, however if they do load a library it should be cached.
- 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.
Expand All @@ -39,11 +49,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.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
// override the regular exclusion from above (for being inside node_modules).
{
test: /.js$/,
include: new RegExp(`\\${path.sep}prebid\.js`),
include: new RegExp(`\\${path.sep}prebid\\.js`),
use: {
loader: 'babel-loader',
// presets and plugins for Prebid.js must be manually specified separate from your other babel rule.
Expand All @@ -66,7 +66,7 @@ module.exports = {
}
```

Or for Babel 6 and/or Node v8.6.0 and less:
Or for Babel 6:
```javascript
// you must manually install and specify the presets and plugins yourself
options: {
Expand Down Expand Up @@ -112,9 +112,9 @@ prebid.requestBids({
$ cd Prebid.js
$ npm install

*Note:* You need to have `NodeJS` 6.x or greater installed.
*Note:* You need to have `NodeJS` 12.16.1 or greater installed.

*Note:* In the 1.24.0 release of Prebid.js we have transitioned to using gulp 4.0 from using gulp 3.9.1. To compily with gulp's recommended setup for 4.0, you'll need to have `gulp-cli` installed globally prior to running the general `npm install`. This shouldn't impact any other projects you may work on that use an earlier version of gulp in it's setup.
*Note:* In the 1.24.0 release of Prebid.js we have transitioned to using gulp 4.0 from using gulp 3.9.1. To comply with gulp's recommended setup for 4.0, you'll need to have `gulp-cli` installed globally prior to running the general `npm install`. This shouldn't impact any other projects you may work on that use an earlier version of gulp in its setup.

If you have a previous version of `gulp` installed globally, you'll need to remove it before installing `gulp-cli`. You can check if this is installed by running `gulp -v` and seeing the version that's listed in the `CLI` field of the output. If you have the `gulp` package installed globally, it's likely the same version that you'll see in the `Local` field. If you already have `gulp-cli` installed, it should be a lower major version (it's at version `2.0.1` at the time of the transition).

Expand Down
27 changes: 27 additions & 0 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

const sharedWhiteList = [
'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 = {
'modules': [
...sharedWhiteList,
'criteo-direct-rsa-validate',
'jsencrypt',
'crypto-js',
'live-connect' // Maintained by LiveIntent : https://github.com/liveintent-berlin/live-connect/
],
'src': [
...sharedWhiteList,
'fun-hooks/no-eval',
'just-clone',
'dlv',
'dset',
'deep-equal'
]
};
Loading

0 comments on commit 2c4f7a3

Please sign in to comment.