mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-19 20:53:27 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff12f26f81 | |||
| 7424ebc606 | |||
| 85de83a6e2 | |||
| fc5be16ac6 | |||
| 000a923189 | |||
| d5e4ce3df1 | |||
| 7320d4afef | |||
| 3ecca6895d | |||
| 0e520a49ae |
@@ -8,6 +8,7 @@ language: go
|
||||
|
||||
go:
|
||||
- 1.12.x
|
||||
- 1.13.x
|
||||
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## 1.0.21 - 2019-09-16
|
||||
|
||||
* [[#277](https://github.com/Netflix-Skunkworks/go-jira/issues/277)] update figtree to latest [Cory Bennett] [[0e520a4](https://github.com/Netflix-Skunkworks/go-jira/commit/0e520a4)]
|
||||
* Switch over to using github.com/go-jira/jira, from gopkg.in [Mike Pountney] [[27f57b2](https://github.com/Netflix-Skunkworks/go-jira/commit/27f57b2)]
|
||||
* fix worklog template to allow multiline comments [Matthias Bethke] [[43e07f1](https://github.com/Netflix-Skunkworks/go-jira/commit/43e07f1)]
|
||||
* Allow reading password from stdin [Justin Ko] [[225e1dc](https://github.com/Netflix-Skunkworks/go-jira/commit/225e1dc)]
|
||||
* all: unindent some code [Daniel Martí] [[31c113d](https://github.com/Netflix-Skunkworks/go-jira/commit/31c113d)]
|
||||
* don't use ReadAll when decoding JSON [Daniel Martí] [[9bcdcc1](https://github.com/Netflix-Skunkworks/go-jira/commit/9bcdcc1)]
|
||||
* start making staticcheck happier [Daniel Martí] [[9b9186f](https://github.com/Netflix-Skunkworks/go-jira/commit/9b9186f)]
|
||||
* all: convert to a Go module [Daniel Martí] [[f125ef3](https://github.com/Netflix-Skunkworks/go-jira/commit/f125ef3)]
|
||||
* CI: test on Go 1.12.x, cleanup [Daniel Martí] [[664c5ca](https://github.com/Netflix-Skunkworks/go-jira/commit/664c5ca)]
|
||||
* make automatic pagination on search optional, fix tests [Cory Bennett] [[36c99ce](https://github.com/Netflix-Skunkworks/go-jira/commit/36c99ce)]
|
||||
* prefer defer resp.Body.Close to avoid leaks on subsequent errors [Cory Bennett] [[181bd74](https://github.com/Netflix-Skunkworks/go-jira/commit/181bd74)]
|
||||
* add pagination to search [Miles Maddox] [[76dd1d8](https://github.com/Netflix-Skunkworks/go-jira/commit/76dd1d8)]
|
||||
* Fix function comments based on best practices from Effective Go [CodeLingo Bot] [[23ac118](https://github.com/Netflix-Skunkworks/go-jira/commit/23ac118)]
|
||||
* [[#201](https://github.com/Netflix-Skunkworks/go-jira/issues/201)] update required library, failing to populate cookiejar from cookies file [Cory Bennett] [[ee69afa](https://github.com/Netflix-Skunkworks/go-jira/commit/ee69afa)]
|
||||
|
||||
## 1.0.20 - 2018-08-04
|
||||
|
||||
* [[#201](https://github.com/Netflix-Skunkworks/go-jira/issues/201)] update required library, failing to populate cookiejar from cookies file [Cory Bennett] [[ee69afa](https://github.com/Netflix-Skunkworks/go-jira/commit/ee69afa)]
|
||||
|
||||
@@ -39,7 +39,7 @@ lint:
|
||||
@golint ./cmd/jira
|
||||
|
||||
all:
|
||||
$(GO) get -u github.com/karalabe/xgo
|
||||
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo
|
||||
rm -rf dist
|
||||
mkdir -p dist
|
||||
xgo --targets="freebsd/amd64,linux/386,linux/amd64,windows/386,windows/amd64,darwin/amd64" -dest ./dist -ldflags="-w -s" ./cmd/jira
|
||||
|
||||
@@ -3,12 +3,14 @@ package main
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
|
||||
"github.com/coryb/figtree"
|
||||
"github.com/coryb/oreo"
|
||||
|
||||
"github.com/go-jira/jira/jiracli"
|
||||
"github.com/go-jira/jira/jiracmd"
|
||||
"gopkg.in/coryb/yaml.v2"
|
||||
"gopkg.in/op/go-logging.v1"
|
||||
)
|
||||
|
||||
@@ -28,6 +30,10 @@ func main() {
|
||||
jiracli.InitLogging()
|
||||
|
||||
configDir := ".jira.d"
|
||||
|
||||
yaml.UseMapType(reflect.TypeOf(map[string]interface{}{}))
|
||||
defer yaml.RestoreMapType()
|
||||
|
||||
fig := figtree.NewFigTree(
|
||||
figtree.WithHome(jiracli.Homedir()),
|
||||
figtree.WithEnvPrefix("JIRA"),
|
||||
|
||||
@@ -7,7 +7,7 @@ require (
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
|
||||
github.com/cheekybits/genny v1.0.0 // indirect
|
||||
github.com/coryb/figtree v0.0.0-20180728224503-071d1ef303df
|
||||
github.com/coryb/figtree v1.0.1-0.20190907170512-58176d03ef0d
|
||||
github.com/coryb/kingpeon v0.0.0-20180107011214-9a669f143f2e
|
||||
github.com/coryb/oreo v0.0.0-20180804211640-3e1b88fc08f1
|
||||
github.com/davecgh/go-spew v1.1.0 // indirect
|
||||
|
||||
@@ -8,6 +8,8 @@ github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitf
|
||||
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
|
||||
github.com/coryb/figtree v0.0.0-20180728224503-071d1ef303df h1:cS4Z9Nlv8J4UqFbLp9ltZypgenm2p3Jeg0yqLfpH2pc=
|
||||
github.com/coryb/figtree v0.0.0-20180728224503-071d1ef303df/go.mod h1:uAkZUEGm6dROpxfy+8vXLs7JrLCI4O+gQyKAuISxI/g=
|
||||
github.com/coryb/figtree v1.0.1-0.20190907170512-58176d03ef0d h1:99xxg8FYj+5TYg88DxA4xL8ODuI6OvuSu35WQOVPDPg=
|
||||
github.com/coryb/figtree v1.0.1-0.20190907170512-58176d03ef0d/go.mod h1:uAkZUEGm6dROpxfy+8vXLs7JrLCI4O+gQyKAuISxI/g=
|
||||
github.com/coryb/kingpeon v0.0.0-20180107011214-9a669f143f2e h1:tGmk9Tuyz7fKuBq/d3nFJvVWRvc48MEBKQC4uYV3wb0=
|
||||
github.com/coryb/kingpeon v0.0.0-20180107011214-9a669f143f2e/go.mod h1:gBc0uEH6swbOMoR7VkVuW7w5fGvZu/KHeSgxBR4Ta7Q=
|
||||
github.com/coryb/oreo v0.0.0-20180804211640-3e1b88fc08f1 h1:Hh0qSvmvoAGL8VxvEoUv9UuUf9XlKcQtSxAMTz1kqfE=
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"github.com/coryb/oreo"
|
||||
)
|
||||
|
||||
const VERSION = "1.0.20"
|
||||
const VERSION = "1.0.21"
|
||||
|
||||
type Jira struct {
|
||||
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package jiracli
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func realPath(path string) string {
|
||||
cpath, err := filepath.EvalSymlinks(path)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return cpath
|
||||
}
|
||||
|
||||
func comparePaths(p1 string, p2 string) bool {
|
||||
if realPath(p1) == realPath(p2) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func TestFindClosestParentPath(t *testing.T) {
|
||||
dir, err := ioutil.TempDir("", "testFindParentPath")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
origDir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer os.Chdir(origDir)
|
||||
|
||||
t1 := filepath.Join(dir, "/.test1")
|
||||
t2 := filepath.Join(t1, "/.test2")
|
||||
t3 := filepath.Join(t2, "/.test1")
|
||||
err = os.MkdirAll(t3, os.ModePerm)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
os.Chdir(t3)
|
||||
|
||||
path1, err := findClosestParentPath(".test1")
|
||||
if err != nil {
|
||||
t.Errorf("findClosestParentPath should not have errored: %s", err)
|
||||
}
|
||||
if ok := comparePaths(path1, t3); !ok {
|
||||
t.Errorf("%s != %s", path1, t3)
|
||||
}
|
||||
|
||||
path2, err := findClosestParentPath(".test2")
|
||||
if err != nil {
|
||||
t.Errorf("findClosestParentPath should not have errored: %s", err)
|
||||
}
|
||||
if ok := comparePaths(path2, t2); !ok {
|
||||
t.Errorf("%s != %s", path2, t2)
|
||||
}
|
||||
|
||||
path3, err := findClosestParentPath(".test3")
|
||||
if err.Error() != ".test3 not found in parent directory hierarchy" {
|
||||
t.Errorf("incorrect error from findClosestParentPath: %s", err)
|
||||
}
|
||||
if path3 != "" {
|
||||
t.Errorf("path3 should be empty, but is not: %s", path3)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user