Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from target/fix-jira-regex
Browse files Browse the repository at this point in the history
fix: Jira Regex Should Support Numbers
  • Loading branch information
therynamo authored Sep 25, 2018
2 parents 0a94b8f + 28b725a commit 2ad1ad6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/facades/ReleaseCommunicationFacade.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
const { groupFinder, getTagDiffFromTagId } = require('../utils');

const PR_TEMPLATE_COMMENT_REGEX = new RegExp(/<!--[\s\S]*?-->/, 'gm');
const regex = nconf.get('regex') || /(?:\[|https:\/\/jira\..*\.com\/browse\/)([A-Z]+-[0-9]+)\]?/;
const regex = nconf.get('regex') || /(?:\[|https:\/\/jira\..*\.com\/browse\/)([A-Z0-9]+-[0-9]+)\]?/;
const JIRA_REGEX = new RegExp(regex, 'g');
const SQUASH_PR_REGEX = new RegExp(/\(#(.*)\)/, 'g');

Expand Down
2 changes: 1 addition & 1 deletion src/facades/__fixtures__/pullRequestResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"number": 1,
"title": "bla",
"body":
"Nonesense test\r\nasdfasdf;lkj\r\n[JIRA-1234](https://jira.bla.com/browse/JIRA-1234)\r\n\r\nTestingasdf;lkj\r\n\r\n```Code```\r\n\r\n``codebad`"
"Nonesense test\r\nasdfasdf;lkj\r\n[JIRA-1234](https://jira.bla.com/browse/JIRA-1234)\r\n\r\nTestingasdf;lkj\r\n\r\n```Code```\r\n\r\n``codebad` https://jira.bla.com/browse/JIRA2-3455"
}
2 changes: 1 addition & 1 deletion src/facades/__fixtures__/pullRequestResponseRawLink.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"number": 1,
"title": "bla",
"body":
"Nonesense test\r\nasdfasdf;lkj\r\nhttps://jira.bla.com/browse/JIRA-1234)\r\n\r\nTestingasdf;lkj\r\n\r\n```Code```\r\n\r\n``codebad`"
"Nonesense test\r\nasdfasdf;lkj\r\nhttps://jira.bla.com/browse/JIRA-1234)\r\n\r\nTestingasdf;lkj\r\n\r\n```Code```\r\n\r\n``codebad` https://jira.bla.com/browse/JIRA2-3455"
}
4 changes: 2 additions & 2 deletions src/facades/__tests__/ReleaseCommunicationFacade.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('ReleaseCommunicationFacade', () => {
const diff = await RC.parseDiff(squashDiffResponse);
const expectedDiff = [
{
jiraTickets: ['JIRA-1234'],
jiraTickets: ['JIRA-1234', 'JIRA2-3455'],
message: pullRequestResponse.body,
number: 1,
title: 'bla',
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('ReleaseCommunicationFacade', () => {
const diff = await RC.parseDiff(squashDiffResponse);
const expectedDiff = [
{
jiraTickets: ['JIRA-1234'],
jiraTickets: ['JIRA-1234', 'JIRA2-3455'],
message: pullRequestResponseRawLink.body,
number: 1,
title: 'bla',
Expand Down

0 comments on commit 2ad1ad6

Please sign in to comment.