Don't update versions for already tagged tickets, rename a method [MAILPOET-1783]

This commit is contained in:
wxa
2019-02-13 13:52:48 +03:00
committed by M. Shull
parent a829e05bfb
commit 898d61de2d

View File

@ -22,7 +22,7 @@ class ReleaseVersionController {
} }
function assignVersionToCompletedTickets($version = null) { function assignVersionToCompletedTickets($version = null) {
$version = $this->checkVersion($version); $version = $this->ensureCorrectVersion($version);
if (!$version) { if (!$version) {
throw new \Exception('The version is invalid or already released'); throw new \Exception('The version is invalid or already released');
} }
@ -39,7 +39,7 @@ class ReleaseVersionController {
} }
private function getDoneIssuesWithoutVersion() { private function getDoneIssuesWithoutVersion() {
$jql = "project = $this->project AND status = Done AND (fixVersion = EMPTY OR fixVersion IN unreleasedVersions()) AND updated >= -52w"; $jql = "project = $this->project AND status = Done AND fixVersion = EMPTY AND updated >= -52w";
$result = $this->jira->search($jql, ['key']); $result = $this->jira->search($jql, ['key']);
return array_map(function ($issue) { return array_map(function ($issue) {
return [ return [
@ -49,7 +49,7 @@ class ReleaseVersionController {
}, $result['issues']); }, $result['issues']);
} }
private function checkVersion($version) { private function ensureCorrectVersion($version) {
try { try {
$version_data = $this->jira->getVersion($version); $version_data = $this->jira->getVersion($version);
} catch (\Exception $e) { } catch (\Exception $e) {