feat: add grouping and sorting options for shipped work report#674
feat: add grouping and sorting options for shipped work report#674
Conversation
- Add GROUP_BY, SORT_BY, and SORT_ORDER environment variables - Implement sort_issues() to sort by time_to_close, time_to_first_response, etc. - Implement group_issues() to group by author or assignee - Add comprehensive unit tests for sorting and grouping functionality - Update README.md with documentation for new configuration options Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
|
@copilot can you fix the following error? markdown_writer.py:281:8: R1702: Too many nested blocks (6/5) (too-many-nested-blocks) |
Fixed in commit d68cfab by adding a |
Signed-off-by: Zack Koppert <zkoppert@github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the markdown report generation to support grouping and sorting the shipped work report via environment-variable configuration, with accompanying documentation and unit tests.
Changes:
- Add
GROUP_BY,SORT_BY, andSORT_ORDERenv var support in configuration parsing. - Implement issue sorting/grouping logic in
markdown_writer.write_to_markdown()and add helper functions. - Add unit tests covering grouping/sorting behavior and document the new env vars in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
markdown_writer.py |
Adds sort_issues/group_issues helpers and applies them during markdown item-table generation. |
config.py |
Parses new grouping/sorting env vars and stores them on EnvVars. |
README.md |
Documents GROUP_BY, SORT_BY, and SORT_ORDER configuration options. |
test_sorting_grouping.py |
Adds unit tests for the new sorting/grouping behavior and markdown output. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zack Koppert <zkoppert@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix EnvVars.__repr__ with proper comma separators and closing paren - Add descending sort order assertion to test_sort_with_none_values Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pull Request
Proposed Changes
This PR adds configuration options to group and sort items in the shipped work report, enabling better organization when analyzing metrics by contributor or time-based metrics.
New Features
Three new environment variables provide flexible report organization:
authororassigneetime_to_close,time_to_first_response,time_to_answer,time_in_draft, orcreated_atasc(ascending) ordesc(descending)Implementation Details
config.py
EnvVarsclass with validationSORT_ORDERdefaults toascfor invalid values__repr__method with proper comma-space separators and closing parenthesis for well-formed debugging outputmarkdown_writer.py
sort_issues()helper function that sorts by specified metric while ensuring None values always appear at the end regardless of sort directiongroup_issues()helper function that organizes items into dictionary keyed by field valuewrite_to_markdown()to apply sorting before grouping### {group_name}headersREADME.md
test_sorting_grouping.py
Usage Example
Readiness Checklist
Author/Contributor
make lintand fix any issues that you have introducedmake testand ensure you have test coverage for the lines you are introducing@jeffrey-luszczReviewer
fix,documentation,enhancement,infrastructure,maintenance, orbreakingOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.