Skip to content

Commit e239890

Browse files
committedNov 2, 2017
1 parent 54b1004 commit e239890

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed
 

Diff for: ‎lib/links.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

3-
const FIXES_RE = /Fixes:\s*(\S+)/mg;
4-
const FIX_RE = /Fixes:\s*(\S+)/;
5-
const REFS_RE = /Refs?:\s*(\S+)/mg;
6-
const REF_RE = /Refs?:\s*(\S+)/;
3+
const FIXES_RE = /(Close[ds]?|Fix(e[ds])?|Resolve[sd]?)\s*:\s*(\S+)/mg;
4+
const FIX_RE = /(Close[ds]?|Fix(e[ds])?|Resolve[sd]?)\s*:\s*(\S+)/;
5+
const REFS_RE = /Refs?\s*:\s*(\S+)/mg;
6+
const REF_RE = /Refs?\s*:\s*(\S+)/;
77
const { JSDOM } = require('jsdom');
88

99
/**
@@ -21,7 +21,7 @@ class LinkParser {
2121
for (const item of arr) {
2222
const m = item.match(FIX_RE);
2323
if (!m) continue;
24-
const fix = m[1];
24+
const fix = m[3];
2525
const url = fix.replace(/^#/, `${repo}#`).replace('#', '/issues/');
2626
result.push(`https://github.com/${url}`);
2727
}

Diff for: ‎test/fixtures/op_html.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
22
"<p>The npm install rules had a hidden dependency on the <code>node</code> binary<br>\ninstall rule creating the <code>$PREFIX/bin</code> directory.</p>\n<p>Because with <code>./configure --shared</code> no binary is created, the rule<br>\nsubsequently failed. Fix that by creating the directory before<br>\ncreating the symlinks to the npm and npx scripts.</p>\n<p>(Whether it makes sense to install npm without a <code>node</code> binary is<br>\na separate question. This commit is not taking positions. :-))</p>\n<p>Regression introduced in commit <a href=\"https://github.com/nodejs/node/commit/ed8c89a07d159b72a2e351a76c92b8b6a15515bd\" class=\"commit-link\"><tt>ed8c89a</tt></a> (\"build: fix shared installing<br>\ntarget\") which, as the commit log indicates, was itself a bug fix for<br>\nthe <code>./configure --shared</code> install.</p>\n<p>Fixes: <a href=\"https://github.com/nodejs/node/issues/16437\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"267969588\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16437\">#16437</a><br>\nRefs: <a href=\"https://github.com/nodejs/node/pull/15148\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"254809069\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/15148\">#15148</a></p>",
3-
"<p>Refs: <a href=\"https://github.com/nodejs/node/pull/16293\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"266519190\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16293\">#16293</a></p>\n<h5>Checklist</h5>\n\n<ul class=\"contains-task-list\">\n<li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> <code>make -j4 test</code> (UNIX), or <code>vcbuild test</code> (Windows) passes</li>\n<li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> commit message follows <a href=\"https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines\">commit guidelines</a></li>\n</ul>\n<h5>Affected core subsystem(s)</h5>\n\n<p>vm</p>"
3+
"<p>Refs: <a href=\"https://github.com/nodejs/node/pull/16293\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"266519190\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16293\">#16293</a></p>\n<h5>Checklist</h5>\n\n<ul class=\"contains-task-list\">\n<li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> <code>make -j4 test</code> (UNIX), or <code>vcbuild test</code> (Windows) passes</li>\n<li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> commit message follows <a href=\"https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines\">commit guidelines</a></li>\n</ul>\n<h5>Affected core subsystem(s)</h5>\n\n<p>vm</p>",
4+
"<p>Included reference to \\'constant time\\' in crypto.timingSafeEqual description</p>\n<p><span aria-label=\"This pull request closes issue #16504.\" class=\"issue-keyword tooltipped tooltipped-se\">Fixes</span> : <a href=\"https://github.com/nodejs/node/issues/16504\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"268571876\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16504\">#16504</a></p>"
45
]

Diff for: ‎test/unit/links.test.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ const assert = require('assert');
66
const htmls = fixtures.readJSON('op_html.json');
77

88
const expected = [{
9-
fixes: ['https://github.com/node/issues/16437'],
9+
fixes: ['https://github.com/nodejs/node/issues/16437'],
1010
refs: ['https://github.com/nodejs/node/pull/15148']
1111
}, {
1212
fixes: [],
1313
refs: ['https://github.com/nodejs/node/pull/16293']
14+
}, {
15+
fixes: ['https://github.com/nodejs/node/issues/16504'],
16+
refs: []
1417
}];
1518

1619
describe('LinkParser', () => {
1720
it('should parse fixes and refs', () => {
1821
for (let i = 0; i < htmls.length; ++i) {
1922
const op = htmls[i];
20-
const parser = new LinkParser('node', op);
23+
const parser = new LinkParser('nodejs/node', op);
2124
const actual = {
2225
fixes: parser.getFixes(),
2326
refs: parser.getRefs()

0 commit comments

Comments
 (0)