An easy-to-use burndown chart generator for GitHub Project Boards.
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #24 from jhale1805/dev

Simplify Makefile commands + add optional `chart_end_date` setting

authored by

Joseph Hale and committed by
GitHub
(Nov 1, 2021, 9:39 PM -0700) fec7813b efd02e8f

+12 -6
+1 -1
Makefile
··· 7 7 8 8 run: instructions 9 9 cd ./src/github_projects_burndown_chart \ 10 - && PYTHONPATH=. python main.py $(project_type) $(project_name) 10 + && PYTHONPATH=. python main.py $(type) $(name) 11 11 12 12 test: instructions 13 13 coverage run \
+4 -3
README.md
··· 88 88 |----------|---------| 89 89 | `sprint_start_date` | The first day of the sprint formatted as `YYYY-MM-DD`. <br/><br/> Must be entered here since GitHub Project Boards don't have an assigned start/end date. <br/><br/> Example: `2021-10-08` | 90 90 | `sprint_end_date` | The last day of the sprint formatted as `YYYY-MM-DD`. <br/><br/> Must be entered here since GitHub Project Boards don't have an assigned start/end date. <br/><br/> Example: `2021-10-21` | 91 + | `chart_end_date` | (OPTIONAL) The last day to show on the burndown chart formatted as `YYYY-MM-DD`. <br/><br/> Used to change the end date of the chart without affecting the slope of the ideal burndown line (e.g. to show tasks that were completed after the official end of a sprint). <br/><br/> Example: `2021-10-24` | 91 92 | `points_label` | (OPTIONAL) The prefix for issue labels containing the point value of the issue. Removing this prefix must leave just an integer. If set to `null`, the burndown chart will count open issues instead of points.<br/><br/> Example: `Points: ` (with the space) | 92 93 93 94 #### Organization Projects ··· 100 101 ## Usage 101 102 Given that `PROJECT_TYPE` is one of `[repository, organization]` and `PROJECT_NAME` matches a key in the `config.json` under the chosen `PROJECT_TYPE`, run the following command: 102 103 ``` 103 - make run project_type=PROJECT_TYPE project_name=PROJECT_NAME 104 + make run type=PROJECT_TYPE name=PROJECT_NAME 104 105 ``` 105 106 106 107 This will pop up an interactive window containing the burndown chart, including a button for saving it as a picture. ··· 110 111 111 112 To see this repository's example project board: 112 113 ``` 113 - make run project_type=repository project_name=burndown_chart_kickoff 114 + make run type=repository name=burndown_chart_kickoff 114 115 ``` 115 116 116 117 To see Golang's progress on their current roadmap: 117 118 ``` 118 - make run project_type=organization project_name=golang_on_deck 119 + make run type=organization name=golang_on_deck 119 120 ``` 120 121 121 122 ## Contributing
+7 -2
src/github_projects_burndown_chart/chart/burndown.py
··· 13 13 config['settings']['sprint_start_date']) 14 14 self.end_date_utc: datetime = parse_to_utc( 15 15 config['settings']['sprint_end_date']) 16 + self.chart_end_date_utc: datetime = parse_to_utc( 17 + config['settings']['chart_end_date']) \ 18 + if config['settings'].get('chart_end_date') else None 16 19 17 20 self.project: Project = project 18 21 19 22 def render(self): 23 + end_date = self.chart_end_date_utc if self.chart_end_date_utc else self.end_date_utc 20 24 outstanding_points_by_day = self.project.outstanding_points_by_date( 21 25 self.start_date_utc, 22 - self.end_date_utc) 26 + end_date) 23 27 # Load date dict for priority values with x being range of how many days are in sprint 24 28 x = list(range(len(outstanding_points_by_day.keys()))) 25 29 y = list(outstanding_points_by_day.values()) 30 + sprint_days = (self.end_date_utc - self.start_date_utc).days 26 31 27 32 # Plot point values for sprint along xaxis=range yaxis=points over time 28 33 plt.plot(x, y) 29 34 plt.axline((x[0], self.project.total_points), 30 - slope=-(self.project.total_points/(len(y)-1)), 35 + slope=-(self.project.total_points/(sprint_days)), 31 36 color="green", 32 37 linestyle=(0, (5, 5))) 33 38