ghi icon indicating copy to clipboard operation
ghi copied to clipboard

Fix milestone extraction, Fixes #289

Open shubhamshuklaer opened this issue 9 years ago • 8 comments
trafficstars

shubhamshuklaer avatar May 23 '16 10:05 shubhamshuklaer

@shubhamshuklaer what changes should this bring?

ghi milestone --list doesn't list milestones, it lists issues within current milestone (which is something I need, but milestone overview is also needed.

doesn't solve ghi new -m "new issue" => shows current issue

Thx!

caifara avatar May 23 '16 14:05 caifara

@caifara It shows the milestone overview. Here is a sample output. It shows milestone overview(Which includes the issues with this milestone). I cloned https://github.com/jekyll/jekyll and created a branch named 4680-test. It inferred issue no "4680" from that and got which milestone was assigned to issue 4680. Then it printed that milestone overview. https://api.github.com/repos/jekyll/jekyll/issues/4680 https://api.github.com/repos/jekyll/jekyll/milestones/38

(Inferring issue from branch prefix: #4680)
#38: undetermined
@parkr created this milestone 109 days ago.  open 
 42% (3 closed, 4 open)                                                                                                                                

    This milestone is used to collect any issues or pull requests which have not been decided upon, but have been triaged.


Issues:
  4680: Add "urlsafe" mode to Utils.slugify  pending-feedback  undetermined 9 ↑ �
  4662: Jekyll, kramdown, rouge with linenos generates W3C validator error  bug   ★  undetermined 1 �
  4467: where key exists functionality  suggestion  undetermined 1 �
  4269: WIP: Incremental regen improvements  enhancement  undetermined 20 ↑ �

shubhamshuklaer avatar May 23 '16 15:05 shubhamshuklaer

@caifara Oh sorry, now I got it, what you were saying. You want to list all open milestone irrespective of inferred issue. Actually I solved the "not found" error which was mentioned in the OP's description

but it seems like there's an issue with the milestone subcommand whereby it uses the branch prefix (ie, issue number) as the milestone name..

The branch prefix is the issue no. not milestone number(which should be found from the inferred issue's description). I fixed that.

$ ghi milestone --list
(Inferring issue from branch prefix: #112)
Not Found

The current behavior of ghi milestone --list is

  1. ghi milestone --list gives the list of open milestones when no issue can be inferred.
  2. ghi milestone --list shows the milestone assigned to the inferred issue(If it can be inferred)
  3. ghi milestone --list issue_no will show the milestone assigned to the issue no.

I fixed the second case(It was giving not found error)

shubhamshuklaer avatar May 23 '16 15:05 shubhamshuklaer

@caifara You are right, there should be some command which will just list open milestone irrespective of the inferred issue. And the same case with open too. And milestone creation too. And correct --list option should not be used for showing a particular milestone. There should be a ghi milestone --show which will infer issue or take issue as argument.

shubhamshuklaer avatar May 23 '16 15:05 shubhamshuklaer

@caifara You should create a separate issue for this. (As far as I can understand) #289 is about the problem where branch prefix was being used as milestone number and this pull request fixes that. From OP's description of #289

it uses the branch prefix (ie, issue number) as the milestone name.

shubhamshuklaer avatar May 23 '16 16:05 shubhamshuklaer

@shubhamshuklaer Is this PR good to go if I were to merge it into my fork?

drazisil avatar Oct 03 '17 02:10 drazisil

@drazisil I tested it when I created it, but I no longer use ghi (Havne't been active on github lately). So can't say whether its good now. I will create a pull request on your fork if I get around to using ghi again.

shubhamshuklaer avatar Oct 04 '17 13:10 shubhamshuklaer