Skip to content
Snippets Groups Projects
Commit 0594b4f2 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

Use non-deprecated API when checking merge status, and improve error handling

parent ef593c4c
Branches
No related tags found
No related merge requests found
......@@ -608,10 +608,10 @@ class DrupalorgIssueFork extends Entity {
'with_merge_status_recheck' => TRUE,
]));
timer_start('merge_status_check');
while (in_array(($merge_status = $this->fetchMergeRequestInfo($iid)['merge_status']), ['unchecked', 'checking']) && timer_read('merge_status_check') < 60*1000) {
while (in_array(($merge_status = $this->fetchMergeRequestInfo($iid)['detailed_merge_status']), ['unchecked', 'checking']) && timer_read('merge_status_check') < 60*1000) {
usleep($poll_delay);
}
return $merge_status === 'can_be_merged';
return $merge_status === 'mergeable';
}
/**
......@@ -667,9 +667,11 @@ class DrupalorgIssueFork extends Entity {
}
catch (Exception $e) {
$uri = $this->uri();
watchdog('drupalorg_issue_fork', 'Exception in merging !@iid for !issue: %msg', [
watchdog('drupalorg_issue_fork', 'Exception in merging !@iid for !issue (at @file:@line): %msg', [
'@iid' => $iid,
'!issue' => l($this->label(), $uri['path'], $uri['options']),
'@file' => $e->getFile(),
'@line' => $e->getLine(),
'%msg' => $e->getMessage(),
], WATCHDOG_ERROR);
return FALSE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment