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

[Issue 314] 30k deliverable reporting #685

Merged
merged 40 commits into from
Nov 28, 2023

Conversation

widal001
Copy link
Collaborator

@widal001 widal001 commented Nov 9, 2023

Summary

Creates the infrastructure to report on the percentage of tickets or story points completed per 30k deliverable.

Fixes #314

Time to review: 25 mins

Changes proposed

What was added, updated, or removed in this PR.

  • Improves infrastructure for reporting
  • Adds DeliverableTasks dataset to join sprint data to 30k deliverables
  • Adds DeliverablePercentComplete which reports the percentage of points or tasks complete by 30k deliverable
  • Adds a CLI for both exporting data and calculating metrics
  • Adds an integration with slack that allows us to post metrics to Slack

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

  1. Check out the pr: git checkout main && git fetch origin && git checkout issue-314-30k-deliverable-reporting
  2. Follow the instructions on the README.md

Outstanding tasks

There were a few tasks that I still want to do, but I'll tackle them in follow-up tickets:

Additional information

Screenshots, GIF demos, code examples

Screenshot 2023-11-20 at 12 10 36 PM utput to help show the changes working as expected. Screenshot 2023-11-20 at 12 11 25 PM

@widal001 widal001 added the draft Not yet ready for review label Nov 9, 2023
@widal001 widal001 marked this pull request as ready for review November 20, 2023 17:13
@widal001 widal001 removed the draft Not yet ready for review label Nov 20, 2023
Copy link
Collaborator

@lucasmbrown-usds lucasmbrown-usds left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the code at all, but the outputs look great! Definitely makes sense to merge these major changes and make other updates later.

Copy link
Collaborator

@lucasmbrown-usds lucasmbrown-usds left a comment

Choose a reason for hiding this comment

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

Really excellent work. Nice and clean architecture, great tests. This will be an excellent foundation for a healthy future of vibrant metrics!

analytics/Makefile Show resolved Hide resolved
4. Set up the project: `make setup` -- This will install the required packages and prompt you to authenticate with GitHub
5. Create a `.secrets.toml` with the following details:
```toml
reporting_channel_id = "<REPLACE_WITH_CHANNEL_ID>"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to add instructions on where to how to get these IDs and tokens?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was planning to do this in our GitBook instance -- but if you think it would be better in the repo, I can add them here instead.

analytics/README.md Show resolved Hide resolved
)
# calculate burndown
burndown = SprintBurndown(sprint_data, sprint=sprint)
# optionally display the burndown chart in the browser
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we make this into a single, reusable method, since it gets used below too? or does that add rather than reduce complexity?

if show_results:
burndown.show_chart()
# optionally post the results to slack
if post_results:
slackbot = slack.SlackBot(client=WebClient(token=settings.slack_bot_token))
burndown.post_results_to_slack(
slackbot=slackbot,
channel_id=settings.reporting_channel_id,
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm good point, I might have to give this some more thought to see if it can be abstracted out.

I should be able to tackle this in #741 since that might involve some refactoring and setting up dependency injection to simplify mocking.

analytics/src/analytics/metrics/burndown.py Show resolved Hide resolved
We no longer want to track these files in git history
Removes export_github_data and changes how the functions to export
project and issue data are called from cli.py
Adds transformation step that extracts the parent issue number from the
milestone description when it is preceded by the phrase `deliverable:`
The SprintBoard._load_data() method used to be called during __init__()
This commit changes it to a class method so that dataset can be loaded
through other methods like from_dict() or from_csv()
- Adds a new dataset class: DeliverableTasks
- Updates BaseMetric to accept **kwargs
- Creates test for DeliverablePercentComplete
- Moves functions to generate test data into conftest.py
- Moves function to load data from json file to utils.py
Updates calculate() method to reutrn 0% for deliverables without any
story points instead of returning NaN
This SDK will be used to build the slack integration
This is used to load the token and channel details for the slackbot
By returning the plotly chart we can use it in other methods as well
This integration allows us to upload files to Slack
Enables all ruff rules and fixes or ignores each violation
Moving slack functions into a class allows us to inject that class as a
dependency in an export function
Adds the following methods:
- export_results()
- export_chart()
- show_chart()
- post_results_to_slack()
- renames visualize() to plot_results()
- Corrected file names
- Improved post message
- Fixed some type issues flagged by mypy
- Rounds percentages to whole numbers and adds '%' symbol
- Sorts by total points/tickets instead of complete
- Adds lint
- Adds test
- Adds check-prereqs
- Updates setup and install
Enables users to calculate sprint burndown for the current sprint
by passing `@current` to the `sprint` argument
@widal001 widal001 force-pushed the issue-314-30k-deliverable-reporting branch from 892946f to 633bd03 Compare November 28, 2023 19:40
@widal001
Copy link
Collaborator Author

Merging this code now to prevent future merge conflicts, but I'll be addressing a few of @lucasmbrown-usds other comments in these follow-up tickets:

@widal001 widal001 merged commit 2b415f0 into main Nov 28, 2023
8 checks passed
@widal001 widal001 deleted the issue-314-30k-deliverable-reporting branch November 28, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: 30k deliverable burndown v0 chart
2 participants