/** * Runs the election for the last month. * * @param boolean whether the script should avoid any output * @return void */ public function electLastMonthCommand($quiet = FALSE) { $this->initializeOurSettings(); $this->quiet = $quiet; $monthIdentifier = $this->electomat->getMonthIdentifierLastMonth(); $this->outputLine('Getting the awards for ' . $monthIdentifier); // elect the global committer of the month award if ($this->canAwardBeElected('committerOfTheMonth', $monthIdentifier) === TRUE) { $this->showTopRankingAndAnnouncement('committerOfTheMonth'); $award = $this->createNewAward('committerOfTheMonth', $monthIdentifier, $this->topCommitters->getFirst()); if ($this->settings['sendNotificationMailsForCoderOfTheMonth']) { $this->notifyCeremonyMasterOnNewAward($award); $this->outputLine('-> notifiying the ceremony master about that lucky moment...'); } else { $this->outputLine('Mail notifications disabled, no mail sent to the ceremony master!'); } } // elect the topic awards $topicAwardTypes = array('feature', 'bugfix', 'task', 'documentation', 'test', 'release'); foreach ($topicAwardTypes as $awardType) { unset($this->topCommitters); if ($this->canAwardBeElected($awardType, $monthIdentifier)) { $this->showTopRankingAndAnnouncement($awardType); // create the award $award = $this->createNewAward($awardType, $monthIdentifier, $this->topCommitters->getFirst()); // notify the ceremony master if ($this->settings['sendNotificationMailsForTopicAwardWinner']) { $this->notifyCeremonyMasterOnNewTopicAward($award); $this->outputLine('-> notifiying the ceremony master about that lucky moment...'); } else { $this->outputLine('Mail notifications disabled, no mail sent to ceremony master!'); } } } }
/** * Index action * * @return void */ public function indexAction() { $monthIdentifier = $this->electomatService->getMonthIdentifierLastMonth(); $this->view->assign('numberOfCommits', $this->commitRepository->getCommitsByMonth($monthIdentifier)->count()); $this->view->assign('numberOfActiveRepositories', $this->repositoryRepository->extractTheRepositoriesFromAStackOfCommits($this->commitRepository->getCommitsByMonth($monthIdentifier))->count()); $this->view->assign('numberOfMonitoredRepositories', $this->repositoryRepository->countByIsActive(TRUE)); $this->view->assign('numberOfCommitters', $this->aggregatedDataPerUserRepository->findNumberOfCommittersPerMonth($monthIdentifier)); $this->view->assign('coderOfTheMonthAward', $this->awardRepository->findLatestAwards(1)->getFirst()); $this->view->assign('currentTopicAwards', $this->awardRepository->findCurrentTopicAwards()); }
/** * Finds the topic awards (everything that is not the basic committer of the month award) * for the current month. * * @return \TYPO3\Flow\Persistence\QueryResultInterface */ public function findCurrentTopicAwards() { $query = $this->createQuery(); $query->matching($query->logicalAnd($query->equals('month', $this->electomatService->getMonthIdentifierLastMonth()), $query->logicalNot($query->equals('type', 'committerOfTheMonth')))); return $query->execute(); }