Skip to content

Commit 03bb2bb

Browse files
authored
Revert "Route WEB_FEATURES.yml changes to web-features contributors (#255)" (#268)
This reverts commit 78ba0bc.
1 parent f03de16 commit 03bb2bb

File tree

4 files changed

+17
-41
lines changed

4 files changed

+17
-41
lines changed

lib/metadata/find-owners.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"use strict";
22
var github = require('../github'),
3-
paths = require('./paths'),
43
uniq = require('../uniq'),
54
yaml = require('js-yaml');
65

7-
// https://github.com/web-platform-tests/rfcs/blob/master/rfcs/web_features.md#step-4-adjust-the-wpt-pr-bot-to-handle-reviews-of-the-changes
8-
var webFeaturesReviewers = ['foolip', 'jcscottiii'];
9-
106
function getReviewersFile(path, reviewers) {
117
return github.get("/repos/:owner/:repo/contents/:path", { path: path + "/META.yml" })
128
.then(function(file) {
@@ -40,15 +36,9 @@ function parentDir(path) {
4036
return path.join("/");
4137
}
4238

43-
module.exports = async function(filenames) {
44-
// If only WEB_FEATURES.yml files are touched, route the review to
45-
// web-features contributors.
46-
if (filenames.every((filename) => filename.endsWith('/WEB_FEATURES.yml'))) {
47-
return webFeaturesReviewers;
48-
}
49-
39+
module.exports = async function(_directories) {
5040
var reviewers = [];
51-
var directories = paths(filenames).slice(0);
41+
var directories = _directories.slice(0);
5242
// Reversing the array here keeps compatibility with a previous version of
5343
// this code, which used a recursive structure and called pop() on the
5444
// array each time. This could likely be removed with some investigation.

lib/metadata/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22

33
const getFilenames = require('./filenames'),
4+
paths = require('./paths'),
45
findSpecs = require('./find-specs'),
56
findOwners = require('./find-owners'),
67
findRemovedReviewers = require('./find-removed-reviewers'),
@@ -49,6 +50,7 @@ module.exports = async function getMetadata(number, author, title, content) {
4950
author = author.toLowerCase();
5051

5152
metadata.filenames = await getFilenames(number);
53+
metadata.paths = paths(metadata.filenames);
5254
const fileLabels = labels.fromFiles(metadata.filenames);
5355
metadata.isRoot = metadata.filenames.some(function(path) {
5456
return path.split('/').length == 1;
@@ -61,7 +63,7 @@ module.exports = async function getMetadata(number, author, title, content) {
6163
fileLabels, labels.fromWorkingGroups(metadata.workingGroups)
6264
);
6365

64-
let reviewers = await findOwners(metadata.filenames);
66+
let reviewers = await findOwners(metadata.paths);
6567

6668
const removedReviewers = await findRemovedReviewers(number);
6769
reviewers = reviewers.filter(function(reviewer) {

test/find-owners.js

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ suite('parse META', function() {
3131

3232
suite('integration', function() {
3333
test('directory contains file', function() {
34-
return findOwners(['resources/testharness.js'])
34+
return findOwners(['resources'])
3535
.then(function(reviewers) {
3636
reviewers.sort();
3737

@@ -40,46 +40,24 @@ suite('integration', function() {
4040
});
4141

4242
test('parent directory contains file', function() {
43-
return findOwners(['dom/nodes/attributes.html'])
43+
return findOwners(['2dcontext/scroll'])
4444
.then(function(reviewers) {
4545
reviewers.sort();
4646

4747
assert.deepEqual(reviewers, [
48-
'annevk', 'jdm', 'zqzhang'
48+
'AmeliaBR', 'annevk', 'fserb', 'jdashg', 'kenrussell'
4949
]);
5050
});
5151
});
5252

5353
test('consolidation of multiple directories', function() {
54-
return findOwners(['resources/testharness.js', 'dom/nodes/attributes.html'])
54+
return findOwners(['resources', '2dcontext'])
5555
.then(function(reviewers) {
5656
reviewers.sort();
5757

5858
assert.deepEqual(reviewers, [
59-
'annevk', 'ayg', 'gsnedders',
60-
'jdm', 'jgraham', 'zqzhang'
61-
]);
62-
});
63-
});
64-
65-
test('only WEB_FEATURES.yml changes', function() {
66-
return findOwners(['dom/WEB_FEATURES.yml'])
67-
.then(function(reviewers) {
68-
reviewers.sort();
69-
70-
assert.deepEqual(reviewers, [
71-
'foolip', 'jcscottiii'
72-
]);
73-
});
74-
});
75-
76-
test('WEB_FEATURES.yml and test changes', function() {
77-
return findOwners(['dom/WEB_FEATURES.yml', 'dom/nodes/attributes.html'])
78-
.then(function(reviewers) {
79-
reviewers.sort();
80-
81-
assert.deepEqual(reviewers, [
82-
'annevk', 'jdm', 'zqzhang'
59+
'AmeliaBR', 'annevk', 'ayg', 'fserb', 'gsnedders',
60+
'jdashg', 'jgraham', 'kenrussell'
8361
]);
8462
});
8563
});

test/get-metadata.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ suite('getMetadata', function() {
5656
],
5757
rootReviewers: [ 'jgraham' ],
5858
filenames: [ 'WebIDL/interfaces.html', 'interfaces/WebIDL.idl' ],
59+
paths: [ 'WebIDL', 'interfaces' ],
5960
labels: [ 'WebIDL', 'interfaces', 'wg-webplatform' ],
6061
isRoot: false,
6162
isWebKitVerified: false,
@@ -166,6 +167,10 @@ suite('getMetadata', function() {
166167
permission: "write"
167168
}
168169
],
170+
paths: [
171+
"svg/coordinate-systems",
172+
"svg/coordinate-systems/parsing",
173+
],
169174
reviewedDownstream: null,
170175
reviewers: [
171176
"ameliabr",
@@ -375,6 +380,7 @@ suite('getMetadata', function() {
375380
'media-source/webm/test-a-1s.webm-manifest.json',
376381
'media-source/webm/test-v-1s-blue.webm',
377382
'media-source/webm/test-v-1s-blue.webm-manifest.json' ],
383+
paths: [ '', 'media-source', 'media-source/mp4', 'media-source/webm' ],
378384
isRoot: true,
379385
specs:
380386
{ 'media-source':

0 commit comments

Comments
 (0)