Skip to content

Commit f4231d6

Browse files
authored
Merge pull request #1167 from merico-dev/feat-devlake
Feat: Add New Plugin `devlake-config`
2 parents 06eca74 + 3678706 commit f4231d6

17 files changed

Lines changed: 591 additions & 62 deletions

File tree

cmd/plugin/devlake-config/main.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package main
2+
3+
import (
4+
"github.com/devstream-io/devstream/internal/pkg/plugin/devlakeconfig"
5+
"github.com/devstream-io/devstream/pkg/util/log"
6+
)
7+
8+
// NAME is the name of this DevStream plugin.
9+
const NAME = "devlake-config"
10+
11+
// Plugin is the type used by DevStream core. It's a string.
12+
type Plugin string
13+
14+
// Create implements the create of devlake-config.
15+
func (p Plugin) Create(options map[string]interface{}) (map[string]interface{}, error) {
16+
return devlakeconfig.Create(options)
17+
}
18+
19+
// Update implements the update of devlake-config.
20+
func (p Plugin) Update(options map[string]interface{}) (map[string]interface{}, error) {
21+
return devlakeconfig.Update(options)
22+
}
23+
24+
// Delete implements the delete of devlake-config.
25+
func (p Plugin) Delete(options map[string]interface{}) (bool, error) {
26+
return devlakeconfig.Delete(options)
27+
}
28+
29+
// Read implements the read of devlake-config.
30+
func (p Plugin) Read(options map[string]interface{}) (map[string]interface{}, error) {
31+
return devlakeconfig.Read(options)
32+
}
33+
34+
// DevStreamPlugin is the exported variable used by the DevStream core.
35+
var DevStreamPlugin Plugin
36+
37+
func main() {
38+
log.Infof("%T: %s is a plugin for DevStream. Use it with DevStream.\n", DevStreamPlugin, NAME)
39+
}

docs/plugins/devlake-config.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# devlake-config plugin
2+
3+
TODO(dtm): Add your document here.
4+
5+
## Usage
6+
7+
``` yaml
8+
--8<-- "devlake-config.yaml"
9+
```

docs/plugins/devlake-config.zh.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# devlake-config 插件
2+
3+
TODO(dtm): 在这里添加文档.
4+
5+
## 用例
6+
7+
``` yaml
8+
--8<-- "devlake-config.yaml"
9+
```

go.mod

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ require (
2525
github.com/onsi/gomega v1.19.0
2626
github.com/pkg/errors v0.9.1
2727
github.com/sirupsen/logrus v1.8.1
28-
github.com/spf13/cobra v1.4.0
28+
github.com/spf13/cobra v1.5.0
2929
github.com/spf13/viper v1.8.1
3030
github.com/stretchr/testify v1.7.0
3131
github.com/tcnksm/go-input v0.0.0-20180404061846-548a7d7a8ee8
32-
github.com/withfig/autocomplete-tools/integrations/cobra v0.0.0-20220812023423-ab97a51a0978
32+
github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1
3333
github.com/xanzy/go-gitlab v0.55.1
3434
go.uber.org/multierr v1.6.0
3535
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3
3636
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
3737
gopkg.in/gookit/color.v1 v1.1.6
38-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
38+
gopkg.in/yaml.v3 v3.0.1
3939
gotest.tools v2.2.0+incompatible
4040
helm.sh/helm/v3 v3.7.2
4141
k8s.io/api v0.22.4
@@ -52,8 +52,9 @@ require (
5252
github.com/Masterminds/semver/v3 v3.1.1 // indirect
5353
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
5454
github.com/Masterminds/squirrel v1.5.2 // indirect
55-
github.com/PuerkitoBio/purell v1.1.1 // indirect
56-
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
55+
github.com/Microsoft/go-winio v0.4.17 // indirect
56+
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
57+
github.com/acomagu/bufpipe v1.0.3 // indirect
5758
github.com/argoproj/pkg v0.11.1-0.20211203175135-36c59d8fafe0 // indirect
5859
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
5960
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1 // indirect
@@ -92,21 +93,22 @@ require (
9293
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
9394
github.com/fatih/camelcase v1.0.0 // indirect
9495
github.com/fatih/color v1.9.0 // indirect
95-
github.com/fsnotify/fsnotify v1.4.9 // indirect
96+
github.com/fsnotify/fsnotify v1.5.1 // indirect
9697
github.com/fvbommel/sortorder v1.0.1 // indirect
9798
github.com/ghodss/yaml v1.0.0 // indirect
98-
github.com/go-errors/errors v1.0.1 // indirect
99+
github.com/go-errors/errors v1.4.2 // indirect
99100
github.com/go-git/gcfg v1.5.0 // indirect
100-
github.com/go-git/go-billy/v5 v5.0.0 // indirect
101-
github.com/go-git/go-git/v5 v5.2.0 // indirect
101+
github.com/go-git/go-billy/v5 v5.3.1 // indirect
102+
github.com/go-git/go-git/v5 v5.4.2 // indirect
102103
github.com/go-logr/logr v0.4.0 // indirect
103104
github.com/go-openapi/jsonpointer v0.19.5 // indirect
104-
github.com/go-openapi/jsonreference v0.19.5 // indirect
105-
github.com/go-openapi/swag v0.19.14 // indirect
105+
github.com/go-openapi/jsonreference v0.20.0 // indirect
106+
github.com/go-openapi/swag v0.21.1 // indirect
106107
github.com/go-playground/locales v0.14.0 // indirect
107108
github.com/go-playground/universal-translator v0.18.0 // indirect
108109
github.com/go-redis/cache/v8 v8.4.2 // indirect
109110
github.com/go-redis/redis/v8 v8.11.3 // indirect
111+
github.com/go-sql-driver/mysql v1.6.0 // indirect
110112
github.com/gobwas/glob v0.2.3 // indirect
111113
github.com/gogo/protobuf v1.3.2 // indirect
112114
github.com/golang-jwt/jwt/v4 v4.0.0 // indirect
@@ -116,7 +118,7 @@ require (
116118
github.com/google/go-querystring v1.1.0 // indirect
117119
github.com/google/gofuzz v1.1.0 // indirect
118120
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
119-
github.com/google/uuid v1.2.0 // indirect
121+
github.com/google/uuid v1.3.0 // indirect
120122
github.com/googleapis/gnostic v0.5.5 // indirect
121123
github.com/gorilla/mux v1.8.0 // indirect
122124
github.com/gosuri/uitable v0.0.4 // indirect
@@ -132,17 +134,17 @@ require (
132134
github.com/josharian/intern v1.0.0 // indirect
133135
github.com/json-iterator/go v1.1.12 // indirect
134136
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
135-
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
137+
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
136138
github.com/klauspost/compress v1.13.6 // indirect
137139
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
138140
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
139141
github.com/leodido/go-urn v1.2.1 // indirect
140-
github.com/lib/pq v1.10.0 // indirect
142+
github.com/lib/pq v1.10.2 // indirect
141143
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
142144
github.com/magiconair/properties v1.8.5 // indirect
143-
github.com/mailru/easyjson v0.7.6 // indirect
144-
github.com/mattn/go-colorable v0.1.4 // indirect
145-
github.com/mattn/go-isatty v0.0.12 // indirect
145+
github.com/mailru/easyjson v0.7.7 // indirect
146+
github.com/mattn/go-colorable v0.1.11 // indirect
147+
github.com/mattn/go-isatty v0.0.14 // indirect
146148
github.com/mattn/go-runewidth v0.0.9 // indirect
147149
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
148150
github.com/mitchellh/copystructure v1.1.1 // indirect
@@ -165,36 +167,38 @@ require (
165167
github.com/prometheus/client_model v0.2.0 // indirect
166168
github.com/prometheus/common v0.26.0 // indirect
167169
github.com/prometheus/procfs v0.6.0 // indirect
168-
github.com/robfig/cron v1.1.0 // indirect
170+
github.com/robfig/cron v1.2.0 // indirect
171+
github.com/rogpeppe/go-internal v1.8.1 // indirect
169172
github.com/rubenv/sql-migrate v0.0.0-20210614095031-55d5740dbbcc // indirect
170173
github.com/russross/blackfriday v1.5.2 // indirect
171174
github.com/sergi/go-diff v1.1.0 // indirect
172175
github.com/shopspring/decimal v1.2.0 // indirect
173176
github.com/spf13/afero v1.6.0 // indirect
174177
github.com/spf13/cast v1.4.1 // indirect
175178
github.com/spf13/jwalterweatherman v1.1.0 // indirect
176-
github.com/spf13/pflag v1.0.5 // indirect
179+
github.com/spf13/pflag v1.0.6-0.20200504143853-81378bbcd8a1 // indirect
180+
github.com/stretchr/objx v0.3.0 // indirect
177181
github.com/subosito/gotenv v1.2.0 // indirect
178182
github.com/vmihailenco/go-tinylfu v0.2.1 // indirect
179183
github.com/vmihailenco/msgpack/v5 v5.3.4 // indirect
180184
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
181-
github.com/xanzy/ssh-agent v0.2.1 // indirect
185+
github.com/xanzy/ssh-agent v0.3.0 // indirect
182186
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
183187
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
184188
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
185189
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect
186190
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
187-
go.uber.org/atomic v1.7.0 // indirect
191+
go.uber.org/atomic v1.9.0 // indirect
188192
golang.org/x/exp v0.0.0-20210901193431-a062eea981d2 // indirect
189-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
193+
golang.org/x/net v0.0.0-20220728211354-c7608f3a8462 // indirect
190194
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
191-
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
195+
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
192196
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
193197
golang.org/x/text v0.3.7 // indirect
194198
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
195199
google.golang.org/appengine v1.6.7 // indirect
196-
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
197-
google.golang.org/grpc v1.38.0 // indirect
200+
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect
201+
google.golang.org/grpc v1.44.0 // indirect
198202
google.golang.org/protobuf v1.27.1 // indirect
199203
gopkg.in/gorp.v1 v1.7.2 // indirect
200204
gopkg.in/inf.v0 v0.9.1 // indirect

0 commit comments

Comments
 (0)