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

Add Gulp Review-Start Task #6067

Merged
merged 14 commits into from
Dec 14, 2020
Merged
11 changes: 11 additions & 0 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ If the PR is for a standard bid adapter or a standard analytics adapter, just th

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.

### Running Tests and Verifying Integrations

General gulp commands include separate commands for serving the codebase on a built in webserver, creating code coverage reports and allowing serving integration examples. The `review-start` gulp command combinese those into one command.

- Run `gulp review-start`, adding the host parameter `gulp review-start --host=0.0.0.0` will bind to all IPs on the machine
- A page will open which provides a hub for common reviewer tools.
- If you need to manually acceess the tools:
- Navigate to build/coverage/lcov-report/index.html to view coverage
- Navigate to integrationExamples/gpt/hellow_world.html for basic integration testing
- The hello_world.html and other exampls can be edited and used as needed to verify functionality

### General PR review Process
- All required global and bidder-adapter rules defined in the [Module Rules](https://docs.prebid.org/dev-docs/module-rules.html) must be followed. Please review these rules often - we depend on reviewers to enforce them.
- Checkout the branch (these instructions are available on the github PR page as well).
Expand Down
20 changes: 19 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,28 @@ function viewCoverage(done) {
connect.server({
port: coveragePort,
root: 'build/coverage/lcov-report',
livereload: false
livereload: false,
debug: true
});
opens('http://' + mylocalhost + ':' + coveragePort);
done();
};

viewCoverage.displayName = 'view-coverage';

// View the reviewer tools page
function viewReview(done) {
var mylocalhost = (argv.host) ? argv.host : 'localhost';
var reviewUrl = 'http://' + mylocalhost + ':' + port + '/integrationExamples/reviewerTools/index.html'; // reuse the main port from 9999

// console.log(`stdout: opening` + reviewUrl);

opens(reviewUrl);
done();
};

viewReview.displayName = 'view-review';

// Watch Task with Live Reload
function watch(done) {
var mainWatcher = gulp.watch([
Expand Down Expand Up @@ -383,4 +397,8 @@ gulp.task('e2e-test', gulp.series(clean, setupE2e, gulp.parallel('build-bundle-p
gulp.task(bundleToStdout);
gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step

// build task for reviewers, runs test-coverage, serves, without watching
gulp.task(viewReview);
gulp.task('review-start', gulp.series(clean, lint, gulp.parallel('build-bundle-dev', watch, testCoverage), viewReview));

module.exports = nodeBundle;
40 changes: 40 additions & 0 deletions integrationExamples/reviewerTools/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<html lang="en">
<head>
<!--
This page provides links to common reviewer tools, tips and tricks.
-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Prebid Reviewer Tools</title>
<style>
.section{padding-top:40px;}
.container{max-width:600px;margin:0 auto;}
</style>
</head>

<body>
<div class="section">
<div class="container">
<div class="row">
<h1>Reviewer Tools</h1>
<p>Below are links to the most common tool used by Prebid reviewers. For more info on PR review processes check out the <a href="https://github.com/prebid/Prebid.js/blob/master/PR_REVIEW.md">General PR Review Process</a> page on Github.</p>
<h2>Common</h2>
<ul>
<li><a href="/build/coverage/lcov-report">Code Coverage</a></li>
<li><a href="/integrationExamples/gpt/hello_world.html">Hello World</a></li>
</ul>
<h2>Other Tools</h2>
<ul>
<li><a href="/integrationExamples/">Other Integration Examples</a></li>
</ul>
<h2>Documentation & Training Material</h2>
<ul>
<li><a href="https://github.com/prebid/Prebid.js/blob/master/PR_REVIEW.md">General PR Review Process</a></li>
<li><a href="https://youtu.be/aNCJ_Ct6Q8Y">Reviewer Video</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>