Christopher Johnson (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/172477
Change subject: Fix stat math
......................................................................
Fix stat math
Change-Id: Ie062175dc3e6a5c869f6c71e5821a426f41ce4e6
---
M src/query/SprintQuery.php
M src/storage/SprintBuildStats.php
M src/storage/SprintTransaction.php
3 files changed, 7 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint
refs/changes/77/172477/1
diff --git a/src/query/SprintQuery.php b/src/query/SprintQuery.php
index 510340f..7e93e4d 100644
--- a/src/query/SprintQuery.php
+++ b/src/query/SprintQuery.php
@@ -118,12 +118,12 @@
}
public function getEdges ($tasks) {
-
// Load all edges of depends and depended on tasks
$edges = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array_keys($tasks))
->withEdgeTypes(array(PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK,
PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK))
->execute();
+ return $edges;
}
public function getEvents($xactions) {
diff --git a/src/storage/SprintBuildStats.php b/src/storage/SprintBuildStats.php
index c412391..5209514 100644
--- a/src/storage/SprintBuildStats.php
+++ b/src/storage/SprintBuildStats.php
@@ -2,9 +2,6 @@
final class SprintBuildStats {
- private $task_open_status_sum;
- private $task_closed_status_sum;
-
public function buildDateArray($start, $end, $timezone) {
$period = new DatePeriod(
diff --git a/src/storage/SprintTransaction.php
b/src/storage/SprintTransaction.php
index d4299ce..9d69a32 100644
--- a/src/storage/SprintTransaction.php
+++ b/src/storage/SprintTransaction.php
@@ -37,7 +37,7 @@
case "task-add":
// A task was added to the sprint
$this->AddTasksToday($date, $dates);
- $this->AddPointsToday($date, $task_phid, $dates);
+// $this->AddPointsToday($date, $task_phid, $dates);
$this->AddTaskInSprint($task_phid);
break;
case "task-remove":
@@ -108,7 +108,7 @@
}
private function ClosePointsToday($date, $task_phid, $dates) {
- $dates[$date]->setPointsClosedToday($this->task_points[$task_phid]);
+ $dates[$date]->setPointsClosedToday($this->task_points[$task_phid]);
return $dates;
}
@@ -144,13 +144,13 @@
if (isset($this->task_in_sprint[$task_phid])) {
// Adjust points for that day
- $task_points = $xaction->getNewValue() - $xaction->getOldValue();
- $dates[$date]->setPointsAddedToday($task_points);
+ $this->task_points[$task_phid] = $xaction->getNewValue() -
$xaction->getOldValue();
+ $dates[$date]->setPointsAddedToday($this->task_points[$task_phid]);
// If the task is closed, adjust completed points as well
if (isset($this->task_statuses[$task_phid]) &&
$this->task_statuses[$task_phid] == 'closed') {
- $task_points = $xaction->getNewValue() - $xaction->getOldValue();
- $dates[$date]->setPointsClosedToday($task_points);
+ $this->task_points[$task_phid] = $xaction->getNewValue() -
$xaction->getOldValue();
+ $dates[$date]->setPointsClosedToday($this->task_points[$task_phid]);
}
}
return $dates;
--
To view, visit https://gerrit.wikimedia.org/r/172477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie062175dc3e6a5c869f6c71e5821a426f41ce4e6
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions/Sprint
Gerrit-Branch: master
Gerrit-Owner: Christopher Johnson (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits