Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
Merge branch 'release/1.3.3'
  • Loading branch information
KensoDev committed Jun 10, 2017
2 parents 4e046f3 + 5168b4a commit d8a4346
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 34 deletions.
56 changes: 38 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@

## Summary

Working with Jira can be a delight but it can also be a huge pain if you are
like me, working in the terminal most of the day. Opening the browser and
entering a bunch of fields can be a real pain.
Gong is a CLI to make working with an issue tracker (look at the supported clients) and still keeping your flow going in the terminal.

I created (am creating) jglow to solve a bunch of my pains in managing my flow
You can easily start branches off of issues, comment and also link commits to the issue URL.

## Usage

### Currently supported clients

* Jira

If you would like to contribute a different client, please feel free to submit a PR

### Login

In order to use `gong` you first you need to login.

`gong login` will prompt you 3 things.
`gong login {client-name}`

Each of the supported clients will prompt the required fields in order to login to the system. Jira will need username, pass and a couple more while others might only need an API token.

```
Type your username please: [email protected]
Please type your password. Don't worry, nothing will show on the screen: ************************
What is the instance URL for Jira (no need for https://): ORG.atlassian.net
Successfully logged in to Jira, congrats!
```
Once you input all of the details the client will attempt to login. If succeeded it will let you know.

Login will check your credentials against Jira, if details are correct, it will
save the login details to disk. By default this goes to `$HOME/.gong.ini`
[![asciicast](https://asciinema.org/a/dcko3kv5xwobpf4rgj0e4ulyo.png)](https://asciinema.org/a/dcko3kv5xwobpf4rgj0e4ulyo)

### Start working on an issue

Expand All @@ -40,6 +40,8 @@ This will do a couple of things
1. Create a branch name `{type}/{issue-id}-{issue-title-sluggified}`
2. Transition the issue to a started state

[![asciicast](https://asciinema.org/a/c5libsysjmb5f8f8gizkbldzv.png)](https://asciinema.org/a/c5libsysjmb5f8f8gizkbldzv)

### `gong browse`

While working on a branch that matches the gong regular expression (look
Expand All @@ -49,17 +51,35 @@ issue automatically.
### `gong comment`

While working on a branch that matches the gong regular expression, you can
type `gong comment "some comment"` and it will send a comment on the ticket.
type `echo "comment" | gong comment` and it will send a comment on the ticket.

### Why a pipe?

The reason for choosing a pipe and not just have the comment as an argument is to have the ability to send **any** output to the comment.

What I find most useful is to send diffs, files, buffers from vim and more.

With this approach, I find I write much better comments to tickets. You will do the same :)

![asciicast](https://asciinema.org/a/d0rcjavbv55lbq1xpsrqiyyu6.png)](https://asciinema.org/a/d0rcjavbv55lbq1xpsrqiyyu6)

### `gong prepare-commit-message`

This is **not** meant to be used directly, instead it is meant to be wrapped with simple wrapper git hooks.

Sample hooks can be found in `git-hooks` directory.

All you need to do is to copy them into your `.git/hooks` directory.

This is a perfect way to streamline communication
This will add a link to the issue to every commit. Whether you do `git commit "commit message" or edit the commit message using the editor with `git commit`

## Work in progress
## Issues/Feedback

This is very much a work in progress and I am adding more features.
If you have any issues, please open one here on Github or hit me up on twitter [@KensoDev](https://twitter.com/KensoDev)

## Upcoming features

### gong slack
### `gong slack`

Send a message to a slack channel, tagging the issue you are working on

Expand Down
18 changes: 7 additions & 11 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
We are in the process of refactoring to a generic client interface which you can easily extend to differnet clients.

☐ gong comment










☐ Git commit hook (Prepare commit message hook)

☐ ./gong create (Creates a ticket from a template)
The most involved feature

UX issue (Don't mean UI)
Setup issue
8 changes: 7 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ func Login(client Client) (bool, error) {
return false, err
}

return client.Authenticate(fields), nil
authenticated := client.Authenticate(fields)

if authenticated {
return true, nil
}

return false, fmt.Errorf("Cloud not login")
}

func getUserHomeOrDefault() string {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gong/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.3.0
current_version = 1.3.3
commit = False
tag = False

Expand Down
4 changes: 3 additions & 1 deletion cmd/gong/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
app := cli.NewApp()
app.Version = "v1.3.0"
app.Version = "v1.3.3"

var branchType string

Expand Down Expand Up @@ -144,6 +144,8 @@ func main() {
out, err := exec.Command(cmd, args...).Output()

if err != nil {
message := fmt.Sprintf("Could not post message: %s. This can happen on empty repos", err)
color.Red(message)
return err
}

Expand Down
6 changes: 6 additions & 0 deletions git-hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
#

echo "$1\n$(cat $1 | gong prepare-commit-message)"
6 changes: 6 additions & 0 deletions git-hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
#

echo "$(cat $1)\n$(cat $1 | gong prepare-commit-message)" > $1
4 changes: 2 additions & 2 deletions jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ func (j *JiraClient) FormatField(fieldName string, value string) string {
// GetAuthFields : Get a map of auth fields
func (j *JiraClient) GetAuthFields() map[string]bool {
return map[string]bool{
"username": false,
"domain": false,
"username": true,
"domain": true,
"password": true,
"project_prefix": false,
}
Expand Down

0 comments on commit d8a4346

Please sign in to comment.