Revert "Fix issues with conversational message parsing"
This reverts commit 26efaf4436.
Reason for revert: internal issue
Change-Id: Ia2bbf6d5262c5c6669b07ae4f96971cb2775cdd8
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const PATCH_SET_PREFIX_PATTERN = /^Patch Set (\d+):[ ]?/;
|
const PATCH_SET_PREFIX_PATTERN = /^Patch Set (\d)+:[ ]?/;
|
||||||
const COMMENTS_COUNT_PATTERN = /^\((\d+)( inline)? comments?\)$/;
|
const COMMENTS_COUNT_PATTERN = /^\((\d+)( inline)? comments?\)$/;
|
||||||
const LABEL_TITLE_SCORE_PATTERN = /^([A-Za-z0-9-]+)([+-]\d+)$/;
|
const LABEL_TITLE_SCORE_PATTERN = /^([A-Za-z0-9-]+)([+-]\d+)$/;
|
||||||
|
|
||||||
@@ -268,9 +268,6 @@
|
|||||||
* @param {string} text
|
* @param {string} text
|
||||||
*/
|
*/
|
||||||
_consumeMessage(text) {
|
_consumeMessage(text) {
|
||||||
// If this variable is defined, the parsing process has already executed.
|
|
||||||
if (this._successfulParse !== undefined) { return; }
|
|
||||||
|
|
||||||
this._parsedPatchNum = '';
|
this._parsedPatchNum = '';
|
||||||
this._parsedCommentCount = '';
|
this._parsedCommentCount = '';
|
||||||
this._parsedChangeMessage = '';
|
this._parsedChangeMessage = '';
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ limitations under the License.
|
|||||||
|
|
||||||
test('just change message', () => {
|
test('just change message', () => {
|
||||||
const str = [
|
const str = [
|
||||||
'Patch Set 20:',
|
'Patch Set 2:',
|
||||||
'',
|
'',
|
||||||
'I think you should reconsider this approach.',
|
'I think you should reconsider this approach.',
|
||||||
'It really makes no sense.',
|
'It really makes no sense.',
|
||||||
@@ -251,7 +251,7 @@ limitations under the License.
|
|||||||
element._consumeMessage(str);
|
element._consumeMessage(str);
|
||||||
|
|
||||||
assert.isTrue(element._successfulParse);
|
assert.isTrue(element._successfulParse);
|
||||||
assert.equal(element._parsedPatchNum, '20');
|
assert.equal(element._parsedPatchNum, '2');
|
||||||
assert.equal(element._parsedCommentCount, '');
|
assert.equal(element._parsedCommentCount, '');
|
||||||
assert.deepEqual(element._parsedVotes, []);
|
assert.deepEqual(element._parsedVotes, []);
|
||||||
assert.equal(element._parsedChangeMessage, [
|
assert.equal(element._parsedChangeMessage, [
|
||||||
@@ -340,26 +340,6 @@ limitations under the License.
|
|||||||
'Nice work.',
|
'Nice work.',
|
||||||
].join('\n'));
|
].join('\n'));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('vote parsing happened already', () => {
|
|
||||||
const str = [
|
|
||||||
'Patch Set 2: Code-Review-Label+2 Verified+1',
|
|
||||||
'',
|
|
||||||
'LGTM',
|
|
||||||
'',
|
|
||||||
'Nice work.',
|
|
||||||
].join('\n');
|
|
||||||
|
|
||||||
element._successfulParse = true;
|
|
||||||
element._consumeMessage(str);
|
|
||||||
|
|
||||||
assert.notOk(element._parsedPatchNum);
|
|
||||||
|
|
||||||
element._successfulParse = false;
|
|
||||||
element._consumeMessage(str);
|
|
||||||
|
|
||||||
assert.notOk(element._parsedPatchNum);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user