kuleuven / jenkins-mattermost-plugin

Jenkins plugin for Mattermost
MIT License
24 stars 46 forks source link

Notification incorrectly counts affected files #23

Open psylum opened 7 years ago

psylum commented 7 years ago

I recently experienced a situation where the plugin sent a notification about a build which included 2 commits, of the following format: Commit 1:

The notification claimed that 3 files were changed. When looking above, it's clear that only 2 files were affected.

It appears this is due to the use of a HashSet<AffectedFile> in ActiveNotifier.getChanges, which i'm guessing the implementation for the AffectedFile interface must not hash based on purely the filename alone. This was using a git repository. I believe it's safer to either use the original getAffectedPaths method, or to get the Paths from each AffectedFile so that the set is based correctly on file paths.