(tasks, failedTask, reason)
| 259 | } |
| 260 | |
| 261 | function evaluateMergeCandidates(tasks, options = {}) { |
| 262 | return tasks |
| 263 | .filter((task) => MERGE_CANDIDATE_STATUSES.has(normalizeStatus(task.status))) |
| 264 | .map((task) => { |
| 265 | const merge = validateMergeOrder(task, tasks); |
| 266 | const authority = taskGovernanceAuthority(task, options); |
| 267 | if (!merge.ok) { |
| 268 | return { task, merge, authority, governance: null }; |
| 269 | } |
| 270 | if (typeof options.authorize !== 'function') { |
| 271 | return { |
| 272 | task, |
| 273 | merge, |
| 274 | authority, |
| 275 | governance: { |
| 276 | authorized: false, |
| 277 | status: 'unknown', |
| 278 | authorization_code: 'GOVERNANCE_AUTHORITY_REQUIRED', |
no test coverage detected