(startDate, endDate)
| 158 | } |
| 159 | |
| 160 | export async function generateCSV(startDate, endDate) { |
| 161 | let {v3PRs, s2PRs, racPRs, otherPRs, offPRs, counts} = await generateData(startDate, endDate); |
| 162 | |
| 163 | function formatRows(rows) { |
| 164 | return rows |
| 165 | .map(([component, instructions, url, title]) => |
| 166 | [escapeCSV(component), escapeCSV(instructions), url, escapeCSV(title)].join() |
| 167 | ) |
| 168 | .join('\n'); |
| 169 | } |
| 170 | |
| 171 | let csv = `V3 \n${formatRows(v3PRs)}\n\nRainbow \n${formatRows(s2PRs)}\n\nRAC \n${formatRows(racPRs)}\n\nOff PR \n${formatRows(offPRs)}\n\nOther \n${formatRows(otherPRs)}\n`; |
| 172 | |
| 173 | return {csv, counts}; |
| 174 | } |
| 175 | |
| 176 | async function listOpenOffPRs() { |
| 177 | let allPRs = []; |
no test coverage detected