1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-05 15:15:44 +02:00

Merge pull request #876 from SAP/mail-culprits

mailSendNotification: Avoid full merge trace being added to culprits
This commit is contained in:
Sven Merk 2019-09-17 14:35:08 +02:00 committed by GitHub
commit 37ec5d4a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -58,10 +58,10 @@ user3@domain.com noreply+github@domain.com'''
@Test
void testCulpritsFromGitCommit() throws Exception {
def gitCommand = "git log -2 --pretty=format:'%ae %ce'"
def gitCommand = "git log -2 --first-parent --pretty=format:'%ae %ce'"
def expected = "user2@domain.com user3@domain.com"
shellRule.setReturnValue("git log -2 --pretty=format:'%ae %ce'", 'user2@domain.com user3@domain.com')
shellRule.setReturnValue("git log -2 --first-parent --pretty=format:'%ae %ce'", 'user2@domain.com user3@domain.com')
def result = stepRule.step.getCulprits(
[

View File

@ -223,7 +223,7 @@ def getCulprits(config, branch, numberOfCommits) {
}
}
def recipients = sh(returnStdout: true, script: "git log -${numberOfCommits} --pretty=format:'%ae %ce'")
def recipients = sh(returnStdout: true, script: "git log -${numberOfCommits} --first-parent --pretty=format:'%ae %ce'")
return getDistinctRecipients(recipients)
} catch(err) {
echo "[${STEP_NAME}] Culprit retrieval from git failed with '${err.getMessage()}'. Please make sure to configure gitSshKeyCredentialsId. So far, only fixed list of recipients is used."