Skip to content

Commit 0b3753d

Browse files
committed
feat: remove support for Waffle keywords parsing
BREAKING CHANGE: remove support Waffle keywords as Waffle.io closed
1 parent 33460cd commit 0b3753d

File tree

4 files changed

+6
-176
lines changed

4 files changed

+6
-176
lines changed

README.md

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# issue-parser
22

3-
Parser for [Github](https://github.com), [GitLab](https://gitlab.com), [Bitbucket](https://bitbucket.org) and [Waffle](https://waffle.io) issues actions, references and mentions
3+
Parser for [Github](https://github.com), [GitLab](https://gitlab.com) and [Bitbucket](https://bitbucket.org) issues actions, references and mentions
44

55
[![Travis](https://img.shields.io/travis/pvdlg/issue-parser.svg)](https://travis-ci.org/pvdlg/issue-parser)
66
[![Codecov](https://img.shields.io/codecov/c/github/pvdlg/issue-parser.svg)](https://codecov.io/gh/pvdlg/issue-parser)
@@ -10,7 +10,6 @@ The parser can identify:
1010
- GitHub [closing keywords](https://help.github.com/articles/closing-issues-using-keywords), [duplicate keyword](https://help.github.com/articles/about-duplicate-issues-and-pull-requests), [issue references](https://guides.github.com/features/issues/#notifications) and [user mentions](https://guides.github.com/features/issues/#notifications)
1111
- GitLab [closing keywords](https://docs.gitlab.com/ee/user/project/issues/automatic_issue_closing.html), [duplicate keyword](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12845), [issue references](https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected) and [user mentions](https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected)
1212
- Bitbucket [closing keywords](https://confluence.atlassian.com/bitbucket/resolve-issues-automatically-when-users-push-code-221451126.html), [issue references](https://confluence.atlassian.com/bitbucket/mark-up-comments-issues-and-commit-messages-321859781.html) and [user mentions](https://confluence.atlassian.com/bitbucket/mark-up-comments-issues-and-commit-messages-321859781.html)
13-
- Waffle.io [epics](https://help.waffle.io/epics/which-keywords-are-supported-with-epics) and [dependencies](https://help.waffle.io/dependencies/which-keywords-are-supported-with-dependencies) keywords
1413
- [Custom](#custom-format) or [additional](#extend-existing-format) keywords
1514

1615
## Install
@@ -80,28 +79,6 @@ parse('Issue description, ref user/package#1, fixing #2. /cc @user');
8079
*/
8180
```
8281

83-
### Waffle format
84-
85-
```js
86-
const issueParser = require('issue-parser');
87-
const parse = issueParser('waffle');
88-
89-
parse('Issue description, ref user/package#1, Fix #2, blocks user/package#3, Require #4, Parent of #5, Child of #6 /cc @user');
90-
/*
91-
{
92-
refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}],
93-
actions: {
94-
close: [{raw: 'Fix #2', action: 'Fix', prefix: '#', issue: '2'}],
95-
block: [{raw: 'blocks user/package#3', action: 'Blocks', slug: 'user/package', prefix: '#', issue: '3'}],
96-
require: [{raw: 'Require #4', action: 'Require', prefix: '#', issue: '4'}],
97-
parentOf: [{raw: 'Parent of #5', action: 'Parent of', prefix: '#', issue: '5'}],
98-
childOf: [{raw: 'Child of #6', action: 'Child of', prefix: '#', issue: '6'}],
99-
},
100-
mentions: [{raw: '@user', prefix: '@', user: 'user'}],
101-
}
102-
*/
103-
```
104-
10582
### Custom format
10683

10784
```js
@@ -341,10 +318,6 @@ Parser options. Can be `github`, `gitlab` or `bitbucket` for predefined options,
341318
Type: `Object`<br>
342319
Default:
343320
`{close: ['close', 'closes', 'closed', 'closing', 'fix', 'fixes', 'fixed', 'fixing', 'resolve', 'resolves', 'resolved', 'resolving', 'implement', 'implements', 'implemented', 'implementing'],
344-
block: ['blocks', 'block', 'required by', 'needed by', 'dependency of'],
345-
require: ['blocked by', 'requires', 'require', 'need', 'needs', 'depends on'],
346-
parentOf: ['parent of', 'parent to', 'parent'],
347-
childOf: ['child of', 'child to', 'child'],
348321
duplicate: ['Duplicate of', '/duplicate']}`
349322

350323
Object with type of action as key and array of keywords as value.

lib/hosts-config.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,27 +84,6 @@ module.exports = {
8484
hosts: ['https://gitlab.com'],
8585
issueURLSegments: ['issues', 'merge_requests'],
8686
},
87-
waffle: {
88-
actions: {
89-
// https://help.waffle.io/dependencies/which-keywords-are-supported-with-dependencies
90-
close: ['close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved'],
91-
// https://help.github.com/articles/closing-issues-using-keywords
92-
block: ['blocks', 'block', 'required by', 'needed by', 'dependency of'],
93-
require: ['blocked by', 'requires', 'require', 'need', 'needs', 'depends on'],
94-
// https://help.waffle.io/epics/which-keywords-are-supported-with-epics
95-
parentOf: ['parent of', 'parent to', 'parent'],
96-
// https://help.waffle.io/epics/which-keywords-are-supported-with-epics
97-
childOf: ['child of', 'child to', 'child'],
98-
// https://help.github.com/articles/about-duplicate-issues-and-pull-requests
99-
duplicate: ['Duplicate of'],
100-
},
101-
delimiters: [':'],
102-
// https://guides.github.com/features/issues/#notifications
103-
mentionsPrefixes: ['@'],
104-
issuePrefixes: ['#', 'gh-'],
105-
hosts: ['https://github.com'],
106-
issueURLSegments: ['issues', 'pull'],
107-
},
10887
default: {
10988
actions: {
11089
close: [
@@ -125,10 +104,6 @@ module.exports = {
125104
'implemented',
126105
'implementing',
127106
],
128-
block: ['blocks', 'block', 'required by', 'needed by', 'dependency of'],
129-
require: ['blocked by', 'requires', 'require', 'need', 'needs', 'depends on'],
130-
parentOf: ['parent of', 'parent to', 'parent'],
131-
childOf: ['child of', 'child to', 'child'],
132107
duplicate: ['Duplicate of', '/duplicate'],
133108
},
134109
delimiters: [':'],

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "issue-parser",
3-
"description": "Parser for Github, GitLab, Bitbucket and Waffle issues actions, references and mentions",
3+
"description": "Parser for Github, GitLab and Bitbucket issues actions, references and mentions",
44
"version": "0.0.0-development",
55
"author": "Pierre Vanduynslager (https://github.com/pvdlg)",
66
"bugs": {
@@ -41,8 +41,7 @@
4141
"pr",
4242
"pull-request",
4343
"references",
44-
"resolve",
45-
"waffle"
44+
"resolve"
4645
],
4746
"license": "MIT",
4847
"main": "index.js",

test/index.test.js

Lines changed: 3 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -89,47 +89,6 @@ test('Parse GitLab issue', t => {
8989
);
9090
});
9191

92-
test('Parse Waffle issue', t => {
93-
t.deepEqual(
94-
m('Waffle')(
95-
'Fix #1 reSOLved gh-2 CLOSES Gh-3 fix o/r#4 #5 o/r#6 fix https://github.com/o/r/issues/7 https://github.com/o/r/issues/8 fix https://github.com/o/r/pull/9 https://github.com/o/r/pull/10 fixing #11 Duplicate OF #12 @user BloCks #13 Requires o/r#14 parent of https://github.com/o/r/issues/15 child to Gh-16'
96-
),
97-
{
98-
actions: {
99-
close: [
100-
{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'},
101-
{raw: 'reSOLved gh-2', action: 'Resolved', slug: undefined, prefix: 'gh-', issue: '2'},
102-
{raw: 'CLOSES Gh-3', action: 'Closes', slug: undefined, prefix: 'Gh-', issue: '3'},
103-
{raw: 'fix o/r#4', action: 'Fix', slug: 'o/r', prefix: '#', issue: '4'},
104-
{raw: 'fix https://github.com/o/r/issues/7', action: 'Fix', slug: 'o/r', prefix: undefined, issue: '7'},
105-
{raw: 'fix https://github.com/o/r/pull/9', action: 'Fix', slug: 'o/r', prefix: undefined, issue: '9'},
106-
],
107-
block: [{raw: 'BloCks #13', action: 'Blocks', slug: undefined, prefix: '#', issue: '13'}],
108-
require: [{raw: 'Requires o/r#14', action: 'Requires', slug: 'o/r', prefix: '#', issue: '14'}],
109-
parentOf: [
110-
{
111-
raw: 'parent of https://github.com/o/r/issues/15',
112-
action: 'Parent of',
113-
slug: 'o/r',
114-
prefix: undefined,
115-
issue: '15',
116-
},
117-
],
118-
childOf: [{raw: 'child to Gh-16', action: 'Child to', slug: undefined, prefix: 'Gh-', issue: '16'}],
119-
duplicate: [{raw: 'Duplicate OF #12', action: 'Duplicate of', slug: undefined, prefix: '#', issue: '12'}],
120-
},
121-
refs: [
122-
{raw: '#5', slug: undefined, prefix: '#', issue: '5'},
123-
{raw: 'o/r#6', slug: 'o/r', prefix: '#', issue: '6'},
124-
{raw: 'https://github.com/o/r/issues/8', slug: 'o/r', prefix: undefined, issue: '8'},
125-
{raw: 'https://github.com/o/r/pull/10', slug: 'o/r', prefix: undefined, issue: '10'},
126-
{raw: '#11', slug: undefined, prefix: '#', issue: '11'},
127-
],
128-
mentions: [{raw: '@user', prefix: '@', user: 'user'}],
129-
}
130-
);
131-
});
132-
13392
test('Parse with default options', t => {
13493
t.deepEqual(
13594
m()(
@@ -152,10 +111,6 @@ test('Parse with default options', t => {
152111
},
153112
{raw: 'Fix: #11', action: 'Fix', slug: undefined, prefix: '#', issue: '11'},
154113
],
155-
block: [],
156-
require: [],
157-
parentOf: [],
158-
childOf: [],
159114
duplicate: [{raw: 'Duplicate OF #10', action: 'Duplicate of', slug: undefined, prefix: '#', issue: '10'}],
160115
},
161116
refs: [
@@ -188,10 +143,6 @@ test('Parse with custom options', t => {
188143
{raw: 'Close* #12', action: 'Close', slug: undefined, prefix: '#', issue: '12'},
189144
],
190145
fix: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}],
191-
block: [],
192-
require: [],
193-
parentOf: [],
194-
childOf: [],
195146
},
196147
refs: [
197148
{raw: 'o/r#4', slug: 'o/r', prefix: '#', issue: '4'},
@@ -221,10 +172,6 @@ test('Parse with options overrides', t => {
221172
{
222173
actions: {
223174
close: [{raw: 'Fix #1', action: 'Fix', slug: undefined, prefix: '#', issue: '1'}],
224-
block: [],
225-
require: [],
226-
parentOf: [],
227-
childOf: [],
228175
},
229176
refs: [
230177
{raw: 'o/r#4', slug: 'o/r', prefix: '#', issue: '4'},
@@ -283,66 +230,6 @@ test('Parse actions.close', t => {
283230
]);
284231
});
285232

286-
test('Parse actions.block', t => {
287-
t.deepEqual(m('waffle')('Blocks #1, Block #2').actions.block, [
288-
{issue: '1', action: 'Blocks', slug: undefined, prefix: '#', raw: 'Blocks #1'},
289-
{issue: '2', action: 'Block', slug: undefined, prefix: '#', raw: 'Block #2'},
290-
]);
291-
t.deepEqual(m('waffle')('Blocks #1,Block #2').actions.block, [
292-
{issue: '1', action: 'Blocks', slug: undefined, prefix: '#', raw: 'Blocks #1'},
293-
{issue: '2', action: 'Block', slug: undefined, prefix: '#', raw: 'Block #2'},
294-
]);
295-
t.deepEqual(m('waffle')('blocks #1, BLOCK #2').actions.block, [
296-
{issue: '1', action: 'Blocks', slug: undefined, prefix: '#', raw: 'blocks #1'},
297-
{issue: '2', action: 'Block', slug: undefined, prefix: '#', raw: 'BLOCK #2'},
298-
]);
299-
});
300-
301-
test('Parse actions.require', t => {
302-
t.deepEqual(m('waffle')('Requires #1, Require #2').actions.require, [
303-
{issue: '1', action: 'Requires', slug: undefined, prefix: '#', raw: 'Requires #1'},
304-
{issue: '2', action: 'Require', slug: undefined, prefix: '#', raw: 'Require #2'},
305-
]);
306-
t.deepEqual(m('waffle')('Requires #1,Require #2').actions.require, [
307-
{issue: '1', action: 'Requires', slug: undefined, prefix: '#', raw: 'Requires #1'},
308-
{issue: '2', action: 'Require', slug: undefined, prefix: '#', raw: 'Require #2'},
309-
]);
310-
t.deepEqual(m('waffle')('requires #1, REQUIRE #2').actions.require, [
311-
{issue: '1', action: 'Requires', slug: undefined, prefix: '#', raw: 'requires #1'},
312-
{issue: '2', action: 'Require', slug: undefined, prefix: '#', raw: 'REQUIRE #2'},
313-
]);
314-
});
315-
316-
test('Parse actions.parentOf', t => {
317-
t.deepEqual(m('waffle')('Parent of #1, Parent to #2').actions.parentOf, [
318-
{issue: '1', action: 'Parent of', slug: undefined, prefix: '#', raw: 'Parent of #1'},
319-
{issue: '2', action: 'Parent to', slug: undefined, prefix: '#', raw: 'Parent to #2'},
320-
]);
321-
t.deepEqual(m('waffle')('Parent of #1,Parent to #2').actions.parentOf, [
322-
{issue: '1', action: 'Parent of', slug: undefined, prefix: '#', raw: 'Parent of #1'},
323-
{issue: '2', action: 'Parent to', slug: undefined, prefix: '#', raw: 'Parent to #2'},
324-
]);
325-
t.deepEqual(m('waffle')('parent of #1, PARENT TO #2').actions.parentOf, [
326-
{issue: '1', action: 'Parent of', slug: undefined, prefix: '#', raw: 'parent of #1'},
327-
{issue: '2', action: 'Parent to', slug: undefined, prefix: '#', raw: 'PARENT TO #2'},
328-
]);
329-
});
330-
331-
test('Parse actions.childOf', t => {
332-
t.deepEqual(m('waffle')('Child of #1, Child to #2').actions.childOf, [
333-
{issue: '1', action: 'Child of', slug: undefined, prefix: '#', raw: 'Child of #1'},
334-
{issue: '2', action: 'Child to', slug: undefined, prefix: '#', raw: 'Child to #2'},
335-
]);
336-
t.deepEqual(m('waffle')('Child of #1,Child to #2').actions.childOf, [
337-
{issue: '1', action: 'Child of', slug: undefined, prefix: '#', raw: 'Child of #1'},
338-
{issue: '2', action: 'Child to', slug: undefined, prefix: '#', raw: 'Child to #2'},
339-
]);
340-
t.deepEqual(m('waffle')('child of #1, CHILD TO #2').actions.childOf, [
341-
{issue: '1', action: 'Child of', slug: undefined, prefix: '#', raw: 'child of #1'},
342-
{issue: '2', action: 'Child to', slug: undefined, prefix: '#', raw: 'CHILD TO #2'},
343-
]);
344-
});
345-
346233
test('Parse actions.duplicate', t => {
347234
t.deepEqual(m('github')('Duplicate of #1, DUPLICATE of #2').actions.duplicate, [
348235
{issue: '1', action: 'Duplicate of', slug: undefined, prefix: '#', raw: 'Duplicate of #1'},
@@ -413,7 +300,7 @@ Fix #2
413300

414301
test('Empty options', t => {
415302
t.deepEqual(m({actions: {close: []}, issuePrefixes: [], mentionsPrefixes: []})('Fix #1, @user'), {
416-
actions: {block: [], require: [], parentOf: [], childOf: [], duplicate: []},
303+
actions: {duplicate: []},
417304
mentions: [],
418305
refs: [],
419306
});
@@ -423,10 +310,6 @@ test('Empty options', t => {
423310
refs: [],
424311
actions: {
425312
close: [{issue: '1', action: 'Fix', slug: undefined, prefix: '#', raw: 'Fix #1'}],
426-
block: [],
427-
require: [],
428-
parentOf: [],
429-
childOf: [],
430313
duplicate: [],
431314
},
432315
mentions: [{raw: '@user', prefix: '@', user: 'user'}],
@@ -436,7 +319,7 @@ test('Empty options', t => {
436319

437320
test('Empty String', t => {
438321
const empty = {
439-
actions: {close: [], block: [], require: [], parentOf: [], childOf: [], duplicate: []},
322+
actions: {close: [], duplicate: []},
440323
mentions: [],
441324
refs: [],
442325
};
@@ -448,7 +331,7 @@ test('Empty String', t => {
448331
test('Throw TypeError for invalid options', t => {
449332
t.throws(
450333
() => m('missing-option'),
451-
"The supported configuration are [github, bitbucket, gitlab, waffle, default], got 'missing-option'"
334+
"The supported configuration are [github, bitbucket, gitlab, default], got 'missing-option'"
452335
);
453336
t.throws(() => m([]), 'The options argument must be a String or an Object');
454337
t.throws(() => m(1), 'The options argument must be a String or an Object');

0 commit comments

Comments
 (0)