aflashyrhetoric / backlog-cli

unofficial cli tool for backlog
Apache License 2.0
3 stars 0 forks source link

Significant refactor and beginning of some functionality #15

Closed aflashyrhetoric closed 5 years ago

aflashyrhetoric commented 5 years ago

Hi @yenchieh , I made some progress and would like some input if/when you have time.

If you're interested, please see README.md for initialization and values-goals.md for some plans I have about development.

I see much room for improvement - for example, Endpoint() should maybe be a struct with receiver functions for building endpoint, and code could be better organized - but I think this is a start. What do you think?

Following commands should be functional

# Simply get links about user (activity/gantt chart)
blg me
# create pull request from current branch to master and generate link
blg pr 
# create pull request from current branch to [someBranch] and generate link
blg pr -b someBranch
# retrieve backlog link to latest commit
blg commit

Thank you :fire:

yenchieh commented 5 years ago

When I do blg me, the program panic because the branch is in develop. I think the program should handle this case. What is the difference between me and user? The links to Backlog doesn't work.

✗ blg commit
Config found. Loaded /Users/yen-chiehchen/backlog-config.yaml
Your latest commit: https://nulab.backlog.jp//git/CACOO/cacoo-app-frontend/commit/596e7e0b409dc7936e55df2035879a9d78bbdcbf% 

I recommend to build it from manual to auto. For example: Version 1:

Version 2:

It will be easier to handle the exception and understand which manual process can be automated.

yenchieh commented 5 years ago

My review is done. It's ok to merge this PR since my review can be in the next PR and this is refactoring instead of new fucntion.

aflashyrhetoric commented 5 years ago

Thank you for review @yenchieh ! 🙇

When I do blg me, the program panic because the branch is in develop.

Good catch, will fix....

What is the difference between me and user?

Initially, I wanted user.go to just provide the struct for a user, but there is no good reason to split user struct from user-related functions like blg me. Thank you, I will merge these two files/functionality.

The CLI is able to retrieve issue key from branch name and ask the user if it's correct issue key

Do you mean for blg commit? I think I named that command poorly, it should have been lastcommit or something similar - it is simply for fetching link and not git commit. Later, I wish to convert this into proper replacement for git commit.

Also currently, the CLI does attempt to get issue key from branch name. Did you have success getting the CLI to work (creating PR / fetching backlog links with blg me or blg commit) on feature branches? ( Not staging or develop) ?

Thank you, I will merge for now.