Skip to content
Snippets Groups Projects
Commit 0f41b376 authored by Björn Brala's avatar Björn Brala
Browse files

feat: check for exlstlng lssues wlth exllclt verslon

parent 78ee8664
No related branches found
No related tags found
No related merge requests found
Pipeline #134377 passed
......@@ -200,17 +200,36 @@ class Project {
$uid = Settings::getRequiredSetting('uid');
$tid = Config::getSetting('bot_tag_tid');
$this->debug("Looking for issue for {$this->name} {$this->version}");
$issues = Request::getAllPages(
"/api-d7/node.json?type=project_issue&author=" . $uid . "&field_project=" . $this->nid . '&field_issue_version=' . $this->version,
['title', 'nid', 'status', 'taxonomy_vocabulary_9']
['title', 'nid', 'status', 'taxonomy_vocabulary_9', 'field_issue_version']
);
$this->debug("Found " . count($issues) . " issues for {$this->name} {$this->version}");
if (count($issues) === 0) {
// Attempt with an 8.x version if the version itself was not found
$issues = Request::getAllPages(
$this->debug("Looking for issue for {$this->name} 8.x-{$this->version}");
// Attempt with an 8.x version if the version itself was not found
$issues = Request::getAllPages(
"/api-d7/node.json?type=project_issue&author=" . $uid . "&field_project=" . $this->nid . '&field_issue_version=8.x-' . $this->version,
['title', 'nid', 'status', 'taxonomy_vocabulary_9']
['title', 'nid', 'status', 'taxonomy_vocabulary_9', 'field_issue_version']
);
$this->debug("Found " . count($issues) . " issues for {$this->name} 8.x-{$this->version}");
}
// Look for all issues and compare field_issue_version to the version. Mostly to handle the move to dev versions.
if (count($issues) === 0 && str_contains($this->version, 'x')) {
$normalized_version = str_replace(['.x', '-dev'], '', $this->version);
$this->debug("Looking for issue for {$this->name} against version {$normalized_version}");
$issues = Request::getAllPages(
"/api-d7/node.json?type=project_issue&author=" . $uid . "&field_project=" . $this->nid,
['title', 'nid', 'status', 'taxonomy_vocabulary_9', 'field_issue_version']
);
$issues = array_filter($issues, function($issue) use ($normalized_version) {
return str_starts_with($issue->field_issue_version, $normalized_version) !== FALSE;
});
$this->debug("Found " . count($issues) . " issues for {$this->name} {$normalized_version}");
}
$issues = array_reverse($issues);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment