~knazarov/git-plan

A swiss-army script for planning team's work on GitHub
Fix a typo / extra trailing quote
Use pytz for offset-aware time calculations
Remove unnecessary usage of UTC timezone when storing issues json

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~knazarov/git-plan
read/write
git@git.sr.ht:~knazarov/git-plan

You can also use your local clone with git send-email.

#A swiss-army script for planning team's work on GitHub

This script is a set of tools I commonly use to organize teamwork on GitHub. Currently it can:

  • Synchronize issues and pull requests to a local json file
  • Calculate issue time estimations based on a "T-shirt size"
  • Export summary information about issues / milestones to an Excel file
  • Export summary information about issues / milestones to Google Sheets
  • Build burndown charts in the exported sheets
  • Notify a Slack channel about stale pull requests
  • Export project plan to TaskJuggler (experimental)

Warning: the code of this script is not very clean, and can break. Warning: also, I only maintain this for myself. If you like it -- cool, feel free to copy and adjust as you see fit.

#Installation

You can use standard Python virtualenv / pip tools to install dependencies and this script as well.

For Nix / NixOS users, if you use flakes:

# In inputs
inputs = {
    ...
    git-plan.url = sourcehut:~knazarov/git-plan;
    git-plan.inputs.nixpkgs.follows = "nixpkgs";
    ...
}

# Then you can add git-plan.overlays.default as an overlay
# And then:

my_python = (pkgs.python3.withPackages (ps: with ps; [
    git_plan]));

After this, you can use python -m git_plan <command_line_arguments>

#Usage

Create a file called github-google-sheets.ini and fill it as follows:

[default]
github_token=<your_personal_access_token>
github_org=<github_org_name>
google_sheet_id=<google_sheet_id>
google_sheet_name=<title_of_the_file_you_want>
slack_webhook=<slack_webhook_url_for_stale_pr_notifications>
pr_notify_repos=<reponame_1>,<reponame_2>,...

[<milestone name>]
<reponame_1>=<milestone name>
<reponame_2>=<milestone name>
...

You can get a personal API token for GitHub here: https://github.com/settings/tokens . Google sheet ID can be copied from the URL in your browser.

How to synchronise:

./git-plan.sh sync

There are request limits, and you can only do 5000 requests per hour. If you cross that limit, the script will pause for 10 minutes and try to continue fetching.

The synchronization is also incremental, so if you re-start the script, it will resume where it finished last time. You can run it periodically to fetch new issues.

If you want to run as a service, do:

./git-plan.sh daemon

#Export

To view your issues locally, you can export them to a tsv file like this:

./git-plan.sh export tsv myissues.tsv

If you want to view issues with Microsoft Excel, do this:

./git-plan.sh export xlsx myissues.xlsx