diff --git a/.github/workflows/scripts/generate-weekly-report.js b/.github/workflows/scripts/generate-weekly-report.js index 8633842738cc..f496418e6997 100644 --- a/.github/workflows/scripts/generate-weekly-report.js +++ b/.github/workflows/scripts/generate-weekly-report.js @@ -190,6 +190,24 @@ async function getIssuesData({octokit, context}) { return stats } +function generateComponentsLookingForOwnersReportSection(lookingForOwners) { + let count = 0 + let section = [] + + // NOTE: the newline after is required for markdown to render correctly + section.push(`
+ Components \n`); + for (const components of Object.values(lookingForOwners)) { + count += Object.keys(components).length + for (const [componentName, metadatafilePath] of Object.entries(components)) { + section.push(`- [ ] [${componentName}](${path.join("../blob/main/", path.dirname(metadatafilePath))}) `) + } + } + + section.push(`
`) + return {count, section} +} + function generateReport({ issuesData, previousReport, componentData }) { const out = [ `## Format`, @@ -228,9 +246,10 @@ function generateReport({ issuesData, previousReport, componentData }) { // generate report for components out.push('\n## Components Report', ''); const report = out.join('\n'); @@ -387,37 +411,43 @@ function processFiles(files) { } const processStatusResults = (results) => { - const filteredResults = {}; - + const byStatus = {}; + const lookingForOwners = {}; for (const component in results) { for (const name in results[component]) { const { path, data } = results[component][name]; - if (data && data.status && data.status.stability) { + if (data && data.status) { + if (data.status.stability) { const { stability } = data.status; const statuses = ['unmaintained', 'deprecated']; for (const status of statuses) { if (stability[status] && stability[status].length > 0) { - if (!filteredResults[status]) { - filteredResults[status] = {}; + if (!byStatus[status]) { + byStatus[status] = {}; } - filteredResults[status][name] = { path, stability: data.status.stability, component }; + byStatus[status][name] = { path, stability: data.status.stability, component }; } } + } + if (data.status.codeowners && data.status.codeowners.seeking_new) { + if (!(component in lookingForOwners)) { + lookingForOwners[component] = {} + } + lookingForOwners[component][name] = path + } } } } - return filteredResults; + return {byStatus, lookingForOwners}; }; async function processComponents() { const results = findFilesByName(`.`, 'metadata.yaml'); const resultsClean = processFiles(results) - const resultsWithStability = processStatusResults(resultsClean) - return resultsWithStability - + return processStatusResults(resultsClean) } async function main({ github, context }) {