()
| 30 | |
| 31 | export class CiModule extends BaseModule<CiData> { |
| 32 | override async retrieveData() { |
| 33 | const nextBranchName = getNextBranchName(this.config.github); |
| 34 | const repo: ReleaseRepoWithApi = { |
| 35 | api: this.git.github, |
| 36 | ...this.git.remoteConfig, |
| 37 | nextBranchName, |
| 38 | }; |
| 39 | const {latest, next, releaseCandidate, exceptionalMinor} = |
| 40 | await ActiveReleaseTrains.fetch(repo); |
| 41 | const ciResultPromises = Object.entries({releaseCandidate, exceptionalMinor, latest, next}).map( |
| 42 | async ([trainName, train]: [string, ReleaseTrain | null]) => { |
| 43 | if (train === null) { |
| 44 | return { |
| 45 | active: false, |
| 46 | name: trainName, |
| 47 | label: '', |
| 48 | status: null, |
| 49 | }; |
| 50 | } |
| 51 | |
| 52 | const {result, results} = await githubMacros.getCombinedChecksAndStatusesForRef( |
| 53 | this.git.github, |
| 54 | { |
| 55 | ...this.git.remoteParams, |
| 56 | ref: train.branchName, |
| 57 | }, |
| 58 | ); |
| 59 | |
| 60 | Log.debug(`Individual Status Results for branch (${train.branchName})`); |
| 61 | results.forEach((r) => Log.debug(` - ${r.name}:`.padEnd(80), r.result)); |
| 62 | Log.debug(); |
| 63 | |
| 64 | return { |
| 65 | active: true, |
| 66 | name: train.branchName, |
| 67 | label: `${trainName} (${train.branchName})`, |
| 68 | status: result, |
| 69 | }; |
| 70 | }, |
| 71 | ); |
| 72 | |
| 73 | return await Promise.all(ciResultPromises); |
| 74 | } |
| 75 | |
| 76 | override async printToTerminal() { |
| 77 | const data = await this.data; |
nothing calls this directly
no test coverage detected