New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore case of email address when counting different authors in commits #467
Ignore case of email address when counting different authors in commits #467
Conversation
src/test/java/io/jenkins/plugins/forensics/miner/CommitStatisticsTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best way to start an issue is:
Create a failing test case that exposes the problem
src/main/java/io/jenkins/plugins/forensics/miner/CommitStatistics.java
Outdated
Show resolved
Hide resolved
…ics.java Co-authored-by: Ullrich Hafner <ullrich.hafner@gmail.com>
@@ -132,7 +132,7 @@ public String toString() { | |||
|
|||
private static int getDistinctCount(final Collection<? extends CommitDiffItem> commits, | |||
final Function<CommitDiffItem, String> property) { | |||
return (int) commits.stream().map(property).map(s -> String.toLowerCase(Locale.ENGLISH)).distinct().count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intellij threw the following error for this syntax:
Non-static method 'toLowerCase(java.util.Locale)' cannot be referenced from a static context
I changed it to the current one. And updated the test cases. Shall I write new one for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should write a failing test before you touch the code 🥲.
Do you want me to create this test case? |
Codecov Report
@@ Coverage Diff @@
## master #467 +/- ##
=========================================
Coverage 71.42% 71.42%
Complexity 386 386
=========================================
Files 48 48
Lines 1169 1169
Branches 101 101
=========================================
Hits 835 835
Misses 293 293
Partials 41 41
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -132,7 +132,7 @@ public String toString() { | |||
|
|||
private static int getDistinctCount(final Collection<? extends CommitDiffItem> commits, | |||
final Function<CommitDiffItem, String> property) { | |||
return (int) commits.stream().map(property).map(s -> String.toLowerCase(Locale.ENGLISH)).distinct().count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should write a failing test before you touch the code 🥲.
src/main/java/io/jenkins/plugins/forensics/miner/CommitStatistics.java
Outdated
Show resolved
Hide resolved
Yes |
src/test/java/io/jenkins/plugins/forensics/miner/CommitStatisticsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/jenkins/plugins/forensics/miner/CommitStatisticsTest.java
Show resolved
Hide resolved
…icsTest.java Co-authored-by: Ullrich Hafner <ullrich.hafner@gmail.com>
…/github.com/Jagrutiti/forensics-api-plugin into bug/make-email-insensitive-to-count-authors
Description
Updated code to fix case sensitivity issue of email ids.
Jira id
https://issues.jenkins.io/browse/JENKINS-70239