-
Bug
-
Resolution: Unresolved
-
Major
-
None
The class AbstractParsingIssueStrategy uses:
ChangeLogSet changeSets = build.getChangeSet();
The class that represents the ChangeLogSet is:
ChangeLogSet class: class hudson.plugins.git.GitChangeSetList
which is output in the build.
In the GitChangeSet class getMsg returns the title or the first line of the commit
@Exported public String getMsg() { return this.title; }
Which is what is used in MentionedInCommitStrategy:
@Override public List<JiraCommit> getJiraIssuesFromChangeSet(final ChangeLogSet.Entry change) { final List<JiraCommit> result = new ArrayList<>(); final List<String> foundTickets = new ArrayList<>(); for (String validJiraPrefix : Config.getGlobalConfig().getJiraTickets()) { String msg = change.getMsg(); ...
The problem is our git commit standards specify having the JIRA at the end, for example:
Upgraded Docker Image See JAS-1234
so what is getting passed is the first line, and the mentionedInCommitStrategy does not pick up any JIRA.
Perhaps if the ChangeLogSet.Entry class in jenkins cored exposed getComment this could be used instead in mentionedInCommitStrategy.
- relates to
-
JENKINS-49202 ChangeLogSet.Entry does not expose getComment to get entire commit message
-
- In Review
-
[JENKINS-49143] When Updating JIRA Comments mentionedInCommitStrategy does not pick up on JIRA not specified on first line of commit
Description |
Original:
Using the mentionedInCommitStrategy does not search the entire changelog from stash. The screenshot shows an example of where the JIRA issue is found but if the JIRA is on a seperate line it will not be found. I seen a related issue about the regex perhaps this is the culprit? I tried setting up a Logger in Jenkins but not getting any exceptions or errors. The global configuration is correct, all the prefixes are defined. The JIRA ext plugin is correctly configured with the job dsl plugin code. |
New:
Using the mentionedInCommitStrategy does not search the entire changelog from stash. The screenshot shows an example of where the JIRA issue is found and works correclty but if the JIRA is on a seperate line it will not be found. I seen a related issue about the regex perhaps this is the culprit? I tried setting up a Logger in Jenkins but not getting any exceptions or errors. The global configuration is correct, all the prefixes are defined. The JIRA ext plugin is correctly configured with the job dsl plugin code. An example where the it won't work Added tests See JAS-1234 |
Description |
Original:
Using the mentionedInCommitStrategy does not search the entire changelog from stash. The screenshot shows an example of where the JIRA issue is found and works correclty but if the JIRA is on a seperate line it will not be found. I seen a related issue about the regex perhaps this is the culprit? I tried setting up a Logger in Jenkins but not getting any exceptions or errors. The global configuration is correct, all the prefixes are defined. The JIRA ext plugin is correctly configured with the job dsl plugin code. An example where the it won't work Added tests See JAS-1234 |
New:
The class AbstractParsingIssueStrategy uses: {code:java} ChangeLogSet changeSets = build.getChangeSet();{code} The class that represents the ChangeLogSet is: ChangeLogSet class: class hudson.plugins.git.GitChangeSetList which is output in the build. In the GitChangeSet class getMsg returns the title or the first line of the commit {code:java} @Exported public String getMsg() { return this.title; }{code} Which is what is used in MentionedInCommitStrategy: {code:java} @Override public List<JiraCommit> getJiraIssuesFromChangeSet(final ChangeLogSet.Entry change) { final List<JiraCommit> result = new ArrayList<>(); final List<String> foundTickets = new ArrayList<>(); for (String validJiraPrefix : Config.getGlobalConfig().getJiraTickets()) { String msg = change.getMsg(); ... {code} The problem is our git commit standards specify having the JIRA at the end, for example: {code:java} Upgraded Docker Image See JAS-1234 {code} so what is getting passed is the first line, and the mentionedInCommitStrategy does not pick up any JIRA. Perhaps if the ChangeLogSet.Entry class in jenkins cored exposed getComment this could be used instead in mentionedInCommitStrategy. |
Summary | Original: Using mentionInCommitStrategy does not search the entire changelog | New: When Updating JIRA Comments mentionedInCommitStrategy does not pick up on JIRA not specified on first line of commit |
Description |
Original:
The class AbstractParsingIssueStrategy uses: {code:java} ChangeLogSet changeSets = build.getChangeSet();{code} The class that represents the ChangeLogSet is: ChangeLogSet class: class hudson.plugins.git.GitChangeSetList which is output in the build. In the GitChangeSet class getMsg returns the title or the first line of the commit {code:java} @Exported public String getMsg() { return this.title; }{code} Which is what is used in MentionedInCommitStrategy: {code:java} @Override public List<JiraCommit> getJiraIssuesFromChangeSet(final ChangeLogSet.Entry change) { final List<JiraCommit> result = new ArrayList<>(); final List<String> foundTickets = new ArrayList<>(); for (String validJiraPrefix : Config.getGlobalConfig().getJiraTickets()) { String msg = change.getMsg(); ... {code} The problem is our git commit standards specify having the JIRA at the end, for example: {code:java} Upgraded Docker Image See JAS-1234 {code} so what is getting passed is the first line, and the mentionedInCommitStrategy does not pick up any JIRA. Perhaps if the ChangeLogSet.Entry class in jenkins cored exposed getComment this could be used instead in mentionedInCommitStrategy. |
New:
The class AbstractParsingIssueStrategy uses: {code:java} ChangeLogSet changeSets = build.getChangeSet();{code} The class that represents the ChangeLogSet is: {code:java} ChangeLogSet class: class hudson.plugins.git.GitChangeSetList{code} which is output in the build. In the GitChangeSet class getMsg returns the title or the first line of the commit {code:java} @Exported public String getMsg() { return this.title; }{code} Which is what is used in MentionedInCommitStrategy: {code:java} @Override public List<JiraCommit> getJiraIssuesFromChangeSet(final ChangeLogSet.Entry change) { final List<JiraCommit> result = new ArrayList<>(); final List<String> foundTickets = new ArrayList<>(); for (String validJiraPrefix : Config.getGlobalConfig().getJiraTickets()) { String msg = change.getMsg(); ... {code} The problem is our git commit standards specify having the JIRA at the end, for example: {code:java} Upgraded Docker Image See JAS-1234 {code} so what is getting passed is the first line, and the mentionedInCommitStrategy does not pick up any JIRA. Perhaps if the ChangeLogSet.Entry class in jenkins cored exposed getComment this could be used instead in mentionedInCommitStrategy. |
Link | New: This issue relates to JENKINS-49202 [ JENKINS-49202 ] |
Just realized that maybe there is an issue with a git related plugin will also investigate