mislav / hub

A command-line tool that makes git easier to use with GitHub.
https://hub.github.com/
MIT License
22.84k stars 2.2k forks source link

Introduce hub milestone command #2106

Open mlewand opened 5 years ago

mlewand commented 5 years ago

I'd love to see a command to manage milestones of a GitHub repository.

Use case that I'm facing: I'm working on a multirepo architecture, all of which should use the same milestones: iteration x, iteration x+1, backlog, unknown. When creating a new repo I need to recreate these tags there.

It's doable with GH web UI, yes, but after discovering the ease of getting job done with hub command - it's no longer appealing. Especially that I have an automation where I can run a command in each project's repository.

I'd like to perform it with a single command, something like:

hub milestone create "iteration x" "iteration x+1" "unknown" "backlog"

Eventually it could be passed as CSV like so:

hub milestone create "iteration x,iteration x+1,unknown,backlog"

Naturally it would require to also include a hub milestone command that I believe should list open milestones by default.

Related issues (#2063) - though I believe it should be a separate command rather than adding it as a hub issue subcommand as milestones are related to both issues and prs.

In case proposal sounds reasonable I'd be happy to contribute.

mislav commented 5 years ago

Hi thank you for the detailed feature request! I'm not sure if I would greenlight you to start writing code for this, since the hub project is already tricky to maintain due to all the different features that it has. Lately, I've been a bit defensive about adding new hub commands (generally, my answer tended to be “no”).

I'll keep this open until we reach some decision about if and where do we want to fit on our roadmap; until then you can list milestones like so https://github.com/github/hub/issues/2063#issuecomment-480802406 and create them like this:

for milestone in "iteration x" "iteration x+1" "unknown" "backlog"; do
  hub api repos/{owner}/{repo}/milestones -f "title=$milestone"
done
mlewand commented 5 years ago

All righty, a little bit dirty, but I should be able to wrap it in some nice cli. Thanks for a quick feedback - in that case I'll just keep an eye on this.