Repository navigation
feat(tracker): optional estimation sum in issue list group headers - #11122
MichaelUray wants to merge 2 commits into
Conversation
Issue list group headers only showed the reported/estimated time when the list was grouped by milestone or assignee, so e.g. a Backlog status group gave no idea how much work it holds. Add a "Show estimation sum in groups" display option to the issue, milestone and component list views (off by default). When enabled, IssueStatistics is shown for every grouping. The list header now passes the projected documents of the whole group and the view options to header extras. With the option enabled, IssueStatistics fetches the time fields of the not yet loaded group issues once per set of group issue ids (no extra live subscriptions, no refetch on live updates of loaded rows or when another page is loaded); loaded rows stay live. Milestone/assignee summaries without the option keep using the loaded rows as before. The summing is extracted into the pure helper calcIssueTimeStats with unit tests. Sub-issues with an ancestor in the same group are counted through that ancestor's childInfo, and only childInfo entries of sub-issues of the same group are used, so a sub-issue listed in another group is counted there and not twice (all entries are used when sub-issues are hidden). Closed issues are capped by reported time and unstarted issues are excluded only for milestone/assignee planning groups, as before. Fixes hcengineering#7034 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
|
Thanks @MichaelUray, please take a look at the following review comments:
|
…e sum option Without "Show estimation sum in groups", milestone and assignee group headers again use the previous calculation: the loaded rows plus the full childInfo of each loaded parent. Sub-issues that are not loaded yet keep counting, so the totals are the same as before this feature. With the option enabled, all issues of the group are fetched and each issue's time is counted in the group the issue is listed in. A sub-issue assigned to Bob under a parent assigned to Alice then counts for Bob, not for Alice. This is a change from the previous behaviour, limited to the opt-in option. Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
|
Thanks @ArtyomSavchenko, you are right on all three points. I added a follow-up commit. 1. and 3. Totals when a group is not fully loaded I went with your first suggestion. Without the "Show estimation sum in groups" option, milestone and assignee headers use the previous calculation again: the loaded rows, with each loaded parent counting all of its sub-issues through With the option enabled, the header fetches the time fields of the group's issues that are not loaded yet. It then sums the whole group, so nothing drops out when a group spans several pages. 2. Commit message Agreed, "as before" was wrong for the enabled option. Without the option the numbers are now really unchanged. With the option, time is counted in the group the issue is listed in: a sub-issue assigned to Bob under a parent assigned to Alice counts for Bob, not for Alice. The new commit message describes this as a change, limited to the opt-in option, and I updated the PR description the same way. |
|
This work continues in the Platform Collective repository: Platform-Collective/platform#285. Closing this pull request here to keep the discussion in one place. Thank you for the reviews and feedback. |
Fixes #7034
Problem and change
Issue list group headers only showed the reported/estimated time when the
list was grouped by milestone or assignee, so e.g. a Backlog status group gave
no idea how much work it holds.
Add a "Show estimation sum in groups" display option to the issue, milestone
and component list views (off by default). When enabled, IssueStatistics is
shown for every grouping. The list header now passes the projected documents
of the whole group and the view options to header extras. When the option is enabled and the group is only partially loaded, IssueStatistics fetches time fields for all issue IDs in the group and uses the response to supplement the live loaded rows. It adds no live subscription and does not repeat the query for updates to loaded rows or additional pages while the group ID set remains unchanged.
Without the option, milestone and assignee headers keep the previous
calculation unchanged (
calcPlanningIssueTimeStats): the loaded rows, witheach loaded parent counting all its sub-issues through
childInfo, includingsub-issues that are not loaded or are listed in another group.
With the option, the sum uses
calcIssueTimeStats. Sub-issues with anancestor in the same group are counted through that ancestor's
childInfo.Only
childInfoentries of sub-issues of the same group are used, so asub-issue listed in another group is counted there and not twice (all entries
are used when sub-issues are hidden). Behaviour change, only with the
option enabled: time is counted in the group the issue is listed in. For
example, a sub-issue assigned to Bob under a parent assigned to Alice counts
for Bob, not for Alice. For closed root issues, estimation is capped by reported time when there are no relevant children, or by the children's reported time when their estimation sum is nonzero. If relevant children exist but their estimation sum is zero, the parent's estimation is retained without that cap. In milestone/assignee planning groups, unstarted root issues contribute reported time but no estimation.
Tests
plugins/tracker-resources/src/__tests__/issueTimeStats.test.ts:childInfoas before. The previous PR head showed 5h there.