From 57b7d52ae75dadfb1620da989a7b9f3519000535 Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 20 Jul 2020 18:59:34 -0400 Subject: [PATCH 1/6] Report combined team size --- .github/workflows/progress-tracker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/progress-tracker.yml b/.github/workflows/progress-tracker.yml index 5edc4e2c384..fafd38a0649 100644 --- a/.github/workflows/progress-tracker.yml +++ b/.github/workflows/progress-tracker.yml @@ -129,6 +129,7 @@ jobs: team.Authors = parseUserNames(authors) team.Reviewers = parseUserNames(reviewers) team.Analysts = parseUserNames(analysts) + team.All = [...team.Authors, ...team.Reviewers, ...team.Analysts] } }) return team @@ -139,7 +140,7 @@ jobs: } const formatTeam = team => { - return Object.entries(team).map(([k, v]) => `${v.length}`).join('/') + return Object.entries(team).map(([k, v]) => `${v.length}`).join('+').replace(/\+([^+]*)$/, '=$1') } const formatRow = chapter => { From 23bbe6585f33c974685e918246c1d20db0150c91 Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 20 Jul 2020 19:07:39 -0400 Subject: [PATCH 2/6] Refactor stats calculation --- .github/workflows/progress-tracker.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/progress-tracker.yml b/.github/workflows/progress-tracker.yml index fafd38a0649..1838f66d549 100644 --- a/.github/workflows/progress-tracker.yml +++ b/.github/workflows/progress-tracker.yml @@ -72,17 +72,18 @@ jobs: core.info(`Tracking progress of ${totalTrackedTasks} tasks across chapters`) const calcStats = nums => { - if (!nums.length) { + const size = nums.length + if (!size) { return [0, 0, 0, 0, 0] } nums.sort((a, b) => a - b) - const half = Math.floor(nums.length / 2) + const sum = nums.reduce((a,b) => a + b, 0) return [ - nums.reduce((a,b) => a + b, 0), - Math.min(...nums), - Math.max(...nums), - (nums.reduce((a,b) => a + b, 0) / nums.length).toFixed(2), - nums[half] + sum, + nums[0], + nums[size - 1], + (sum / size).toFixed(2), + nums[Math.floor(size / 2)] ] } From d9da7b293bb4bf9bd7a2b5ddf8ffbf7fa15633d3 Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 20 Jul 2020 19:12:26 -0400 Subject: [PATCH 3/6] Adjust tooltip as per new team formatting --- .github/workflows/progress-tracker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/progress-tracker.yml b/.github/workflows/progress-tracker.yml index 1838f66d549..f903519390e 100644 --- a/.github/workflows/progress-tracker.yml +++ b/.github/workflows/progress-tracker.yml @@ -198,7 +198,7 @@ jobs: }) const report = [ - `Chapters | Links | Team | ${trackedTasks.map((v, i) => `${i + 1}`).join(' | ')}`, + `Chapters | Links | Team | ${trackedTasks.map((v, i) => `${i + 1}`).join(' | ')}`, `:--------|:------|:----:${'|:-:'.repeat(totalTrackedTasks)}` ].concat(chapters.map(formatRow)).join('\n') From 2264b55965c003ec4a46d7da9ec684bbddb2adfc Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 20 Jul 2020 19:26:23 -0400 Subject: [PATCH 4/6] Add new team type in the initialization --- .github/workflows/progress-tracker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/progress-tracker.yml b/.github/workflows/progress-tracker.yml index f903519390e..cda22dda1e3 100644 --- a/.github/workflows/progress-tracker.yml +++ b/.github/workflows/progress-tracker.yml @@ -41,7 +41,8 @@ jobs: const teamMembers = { Authors: {}, Reviewers: {}, - Analysts: {} + Analysts: {}, + All: {} } const parseListItems = text => { From e6cad5907b64fc8ba52c39954fbd2b156f225554 Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 20 Jul 2020 19:46:27 -0400 Subject: [PATCH 5/6] Change backticks to single quotes --- .github/workflows/progress-tracker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/progress-tracker.yml b/.github/workflows/progress-tracker.yml index cda22dda1e3..8faa6da8f58 100644 --- a/.github/workflows/progress-tracker.yml +++ b/.github/workflows/progress-tracker.yml @@ -179,7 +179,7 @@ jobs: } if(!chapters.length) { - core.info(`Nothing to report`) + core.info('Nothing to report') return } From b36f001fb3252e894f9875648ff0f8a1afb6072c Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Mon, 20 Jul 2020 21:13:36 -0400 Subject: [PATCH 6/6] Make union of chapter contributors unique --- .github/workflows/progress-tracker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/progress-tracker.yml b/.github/workflows/progress-tracker.yml index 8faa6da8f58..54283db7240 100644 --- a/.github/workflows/progress-tracker.yml +++ b/.github/workflows/progress-tracker.yml @@ -131,7 +131,7 @@ jobs: team.Authors = parseUserNames(authors) team.Reviewers = parseUserNames(reviewers) team.Analysts = parseUserNames(analysts) - team.All = [...team.Authors, ...team.Reviewers, ...team.Analysts] + team.All = [...new Set([...team.Authors, ...team.Reviewers, ...team.Analysts])] } }) return team @@ -142,7 +142,7 @@ jobs: } const formatTeam = team => { - return Object.entries(team).map(([k, v]) => `${v.length}`).join('+').replace(/\+([^+]*)$/, '=$1') + return Object.entries(team).map(([k, v]) => `${v.length}`).join('+').replace(/\+([^+]*)$/, '≥$1') } const formatRow = chapter => { @@ -199,7 +199,7 @@ jobs: }) const report = [ - `Chapters | Links | Team | ${trackedTasks.map((v, i) => `${i + 1}`).join(' | ')}`, + `Chapters | Links | Team | ${trackedTasks.map((v, i) => `${i + 1}`).join(' | ')}`, `:--------|:------|:----:${'|:-:'.repeat(totalTrackedTasks)}` ].concat(chapters.map(formatRow)).join('\n')