Skip to content

Commit

Permalink
Merge branch 'hotfix-0.2.1'
Browse files Browse the repository at this point in the history
Change-Id: Ie8bff23bc3d8fad4d2f8abdbe31e59ab19c25853
  • Loading branch information
gustavjp committed Dec 10, 2014
2 parents 5ba1ed8 + fa514c0 commit 7ae4591
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## 0.2 - YYYY-MM-DD
## 0.2.1 - 2014-12-10
### Fixed
- Review advice output rounding bug. Should now round correctly and output right ammount of sessions.

## 0.2 - 2014-12-09
### Added
- Change log (this file).
- Automatic adding of reviewer based on git blame.

## 0.1 - 2014-11-22
### Added
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.nexception.reviewassistant</groupId>
<artifactId>reviewassistant</artifactId>
<packaging>jar</packaging>
<version>0.2</version>
<version>0.2.1</version>
<name>reviewassistant</name>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public static Calculation calculate(PatchSetCreatedEvent event) {
private static int calculateReviewTime(PatchSetCreatedEvent event) {
int lines = event.patchSet.sizeInsertions + Math.abs(event.patchSet.sizeDeletions);
int minutes = (int) Math.ceil(lines / 5);
minutes = (int) Math.ceil(minutes / 5.0);
minutes = minutes * 5;
if(minutes < 5) {
minutes = 5;
}
Expand All @@ -133,7 +135,7 @@ private static int calculateReviewTime(PatchSetCreatedEvent event) {
* @return the recommended amount of review sessions
*/
private static int calculateReviewSessions(int minutes) {
int sessions = Math.round(minutes / 60);
int sessions = (int) Math.round(minutes / 60.0);
if (sessions < 1) {
sessions = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Object apply(RevisionResource resource) throws AuthException, BadRequestE
advice += calculation.minutes + " minutes";
}
advice += "</strong> reviewing this change.</div>";
if (calculation.sessions > 1) {
if (calculation.hours >= 1) {
advice += "<div>This should be split up in <strong>" + calculation.sessions +
" to " + (calculation.sessions + 1) + " sessions</strong>.</div>";
}
Expand Down

0 comments on commit 7ae4591

Please sign in to comment.