Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collective team in the progress report #1071

Merged
merged 6 commits into from
Jul 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/progress-tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ jobs:
const teamMembers = {
Authors: {},
Reviewers: {},
Analysts: {}
Analysts: {},
All: {}
}

const parseListItems = text => {
Expand Down Expand Up @@ -72,17 +73,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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized this doesn't work for unique contributors.

For example, in tunetheweb#73 there are only 2 people (you and Barry) but the All/Total cell says 4. I'd expect this value to also deduplicate repeated contributors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to deduplicate there as that is a chapter-wise stats and it represents a different quantity. The summary table is not showing in the Total columns what you feel it should. It has always been different. For example, even before we introduced All, Reviewers were adding up to 3, though there were only two unique people involved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In short, we are deduplication multiple roles of a person in a single chapter, but we are not deduplicating roles of individuals across chapters, and we should not. If you are looking for an absolute number of unique contributors and in how many chapters they each contributed in one or more roles, the place you should be looking at is under the Contributor Details under the the All section.

nums[0],
nums[size - 1],
(sum / size).toFixed(2),
nums[Math.floor(size / 2)]
]
}

Expand Down Expand Up @@ -129,6 +131,7 @@ jobs:
team.Authors = parseUserNames(authors)
team.Reviewers = parseUserNames(reviewers)
team.Analysts = parseUserNames(analysts)
team.All = [...new Set([...team.Authors, ...team.Reviewers, ...team.Analysts])]
}
})
return team
Expand All @@ -139,7 +142,7 @@ jobs:
}

const formatTeam = team => {
return Object.entries(team).map(([k, v]) => `<span title="${k}: ${v.length ? v.join(', ') : 'TBD'}">${v.length}</span>`).join('/')
return Object.entries(team).map(([k, v]) => `<span title="${k}: ${v.length ? v.join(', ') : 'TBD'}">${v.length}</span>`).join('+').replace(/\+([^+]*)$/, '≥$1')
}

const formatRow = chapter => {
Expand Down Expand Up @@ -176,7 +179,7 @@ jobs:
}

if(!chapters.length) {
core.info(`Nothing to report`)
core.info('Nothing to report')
return
}

Expand All @@ -196,7 +199,7 @@ jobs:
})

const report = [
`Chapters | <span title="${Object.entries(icons).map(([k, v]) => `${v} (${k})`).join(', ')}">Links</span> | <span title="${Object.keys(teamMembers).join('/')}">Team</span> | ${trackedTasks.map((v, i) => `<span title="${v}">${i + 1}<span>`).join(' | ')}`,
`Chapters | <span title="${Object.entries(icons).map(([k, v]) => `${v} (${k})`).join(', ')}">Links</span> | <span title="${Object.keys(teamMembers).join('+').replace(/\+([^+]*)$/, '≥$1')}">Team</span> | ${trackedTasks.map((v, i) => `<span title="${v}">${i + 1}<span>`).join(' | ')}`,
`:--------|:------|:----:${'|:-:'.repeat(totalTrackedTasks)}`
].concat(chapters.map(formatRow)).join('\n')

Expand Down