Account for issues created in the middle of a milestone in burndown chart
- Currently, if an issue is created in the middle of a milestone, the burndown chart considers it to have been created at the beginning of the milestone. This is a simplifying assumption. See https://docs.gitlab.com/ee/user/project/milestones/burndown_charts.html and #91 (closed).
- The change here accounts for this case more explicitly, so that if an issue is created in the middle of a milestone, the chart line will move up, as expected.
Algorithm / scenarios
- Assume all dates/times are with "day" granularity.
- Assume each issue has
closed_at, and it gets updated every time the issue is closed.
- Suppose I am looking at a given day, call it
d, and that
milestone-start-date <= d <= milestone-end-date, which we only care about for the purpose of generating the chart. Note that
dhas no relation to
now. We can be looking at milestones in the past, present, or future.
- We only generate the chart from
- Suppose I am looking at a given issue
ithat has the associated milestone with it. I only care about issues with this milestone.
- Note that
i.created_at <= i.closed_at <= nowby the logic of issues. An issue can be closed and re-opened many times. But
i.created_atis the first time it is open.
i.closed_atstores the latest day it has been closed.
|Scenario (For given
||User-facing interpretation and assumption||Technical logic (Count/weight the issue?)|