in tools/rfc-render/render-rfc-table.js [29:112]
async function render() {
const lines = [];
const files = await fs.readdir(path.join(__dirname, '..', '..', 'text'));
const octo = new Octokit({
auth: process.env.GITHUB_TOKEN
});
const issueByStatus = { };
for (const status of labels) {
issueByStatus[status] = [];
}
const request = octo.issues.listForRepo.endpoint.merge({
repo: 'aws-cdk-rfcs',
owner: 'aws',
state: 'all',
});
const result = await octo.paginate(request);
for (const issue of result) {
// skip pull requests
if (issue.pull_request) {
continue;
}
const status = determineStatus(issue.labels);
let warning = '';
if (issue.state === 'closed') {
// skip closed issues of unknown status
if (status === UNKNOWN_STATUS) {
continue;
}
}
const { champion, pr_number } = findMetadata(issue);
const doc = findDocFile(files, issue.number);
let link;
// we we already have a doc, then the link should go to it
if (doc) {
link = `https://github.com/aws/aws-cdk-rfcs/blob/master/text/${doc}`;
} else if (pr_number) {
link = `https://github.com/aws/aws-cdk-rfcs/pull/${pr_number}`;
} else {
link = `https://github.com/aws/aws-cdk-rfcs/issues/${issue.number}`;
}
issueByStatus[status].push({
number: issue.number,
title: issue.title,
link,
assignee: issue.assignee && issue.assignee.login,
champion,
status,
doc,
warning
});
}
lines.push('\\#|Title|Owner|Status');
lines.push('---|-----|-----|------');
for (const issues of Object.values(issueByStatus)) {
for (const row of issues.sort(byNumber)) {
const cols = [
`[${row.number}](https://github.com/aws/aws-cdk-rfcs/issues/${row.number})`,
`[${row.title}](${row.link})`,
renderUser(row.assignee),
display[row.status],
];
lines.push(cols.join('|'));
}
}
return lines;
}