From db7f0cdffba46c5ce9ac4959688d3ec8fc6e65b0 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 20 Feb 2019 15:15:29 -0800 Subject: [PATCH] enable deploy events --- service/hook/parser/parse.go | 44 ++++++++++++++++++++++++++++++++++++ store/batch/batch.go | 19 ++++++++++++---- store/build/build.go | 19 ++++++++++++---- store/build/scan.go | 19 ++++++++++++---- store/logs/logs.go | 19 ++++++++++++---- store/logs/scan.go | 17 +++++++++++--- store/perm/perm.go | 19 ++++++++++++---- store/perm/scan.go | 19 ++++++++++++---- store/repos/repos.go | 19 ++++++++++++---- store/repos/scan.go | 19 ++++++++++++---- store/repos/type.go | 17 +++++++++++--- store/secret/scan.go | 19 ++++++++++++---- store/secret/secret.go | 19 ++++++++++++---- store/stage/scan.go | 19 ++++++++++++---- store/stage/stage.go | 19 ++++++++++++---- store/stage/type.go | 17 +++++++++++--- store/step/scan.go | 19 ++++++++++++---- store/step/step.go | 19 ++++++++++++---- store/store.go | 18 --------------- store/user/scan.go | 19 ++++++++++++---- store/user/user.go | 19 ++++++++++++---- 21 files changed, 326 insertions(+), 91 deletions(-) diff --git a/service/hook/parser/parse.go b/service/hook/parser/parse.go index c72858436..3a2d255f8 100644 --- a/service/hook/parser/parse.go +++ b/service/hook/parser/parse.go @@ -22,6 +22,7 @@ import ( "os" "strconv" "strings" + "time" "github.com/drone/drone/core" "github.com/drone/go-scm/scm" @@ -317,7 +318,50 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core SSHURL: v.Repo.CloneSSH, } return hook, repo, nil + case *scm.DeployHook: + hook = &core.Hook{ + Trigger: core.TriggerHook, + Event: core.EventPromote, + Link: v.TargetURL, + Timestamp: time.Now().Unix(), + Message: v.Desc, + After: v.Ref.Sha, + Ref: v.Ref.Path, + Source: v.Ref.Name, + Target: v.Ref.Name, + Author: v.Sender.Login, + AuthorName: v.Sender.Name, + AuthorEmail: v.Sender.Email, + AuthorAvatar: v.Sender.Avatar, + Sender: v.Sender.Login, + Deployment: v.Target, + Params: toMap(v.Data), + } + repo = &core.Repository{ + UID: v.Repo.ID, + Namespace: v.Repo.Namespace, + Name: v.Repo.Name, + Slug: scm.Join(v.Repo.Namespace, v.Repo.Name), + Link: v.Repo.Link, + Branch: v.Repo.Branch, + Private: v.Repo.Private, + HTTPURL: v.Repo.Clone, + SSHURL: v.Repo.CloneSSH, + } + return hook, repo, nil default: return nil, nil, nil } } + +func toMap(src interface{}) map[string]string { + set, ok := src.(map[string]interface{}) + if !ok { + return nil + } + dst := map[string]string{} + for k, v := range set { + dst[k] = fmt.Sprint(v) + } + return nil +} diff --git a/store/batch/batch.go b/store/batch/batch.go index c679c59f3..fe66c6cba 100644 --- a/store/batch/batch.go +++ b/store/batch/batch.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package batch @@ -9,9 +20,9 @@ import ( "fmt" "time" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" "github.com/drone/drone/store/repos" + "github.com/drone/drone/store/shared/db" ) // New returns a new Batcher. diff --git a/store/build/build.go b/store/build/build.go index 07d19fd82..2adb83c08 100644 --- a/store/build/build.go +++ b/store/build/build.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package build import ( "context" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new Buildcore. diff --git a/store/build/scan.go b/store/build/scan.go index e00303432..f9365f3ea 100644 --- a/store/build/scan.go +++ b/store/build/scan.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package build @@ -8,8 +19,8 @@ import ( "database/sql" "encoding/json" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" "github.com/jmoiron/sqlx/types" ) diff --git a/store/logs/logs.go b/store/logs/logs.go index e56725ab9..21608ea8c 100644 --- a/store/logs/logs.go +++ b/store/logs/logs.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package logs @@ -10,8 +21,8 @@ import ( "io" "io/ioutil" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new LogStore. diff --git a/store/logs/scan.go b/store/logs/scan.go index 00587ac68..ab3ab5fe3 100644 --- a/store/logs/scan.go +++ b/store/logs/scan.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package logs diff --git a/store/perm/perm.go b/store/perm/perm.go index bb1401ef3..4657e4e9e 100644 --- a/store/perm/perm.go +++ b/store/perm/perm.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package perm import ( "context" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new PermStore. diff --git a/store/perm/scan.go b/store/perm/scan.go index 1e5e9d936..18b233283 100644 --- a/store/perm/scan.go +++ b/store/perm/scan.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package perm import ( "database/sql" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // helper function converts the Perm structure to a set diff --git a/store/repos/repos.go b/store/repos/repos.go index c80845123..6d19ad6a4 100644 --- a/store/repos/repos.go +++ b/store/repos/repos.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package repos import ( "context" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new RepositoryStore. diff --git a/store/repos/scan.go b/store/repos/scan.go index 589e0b595..48b3ee30e 100644 --- a/store/repos/scan.go +++ b/store/repos/scan.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package repos import ( "database/sql" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // ToParams converts the Repository structure to a set diff --git a/store/repos/type.go b/store/repos/type.go index cc1bf21f0..2a28eb8f6 100644 --- a/store/repos/type.go +++ b/store/repos/type.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package repos diff --git a/store/secret/scan.go b/store/secret/scan.go index c8ade3a6f..5ab56469b 100644 --- a/store/secret/scan.go +++ b/store/secret/scan.go @@ -1,15 +1,26 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package secret import ( "database/sql" + "github.com/drone/drone/core" "github.com/drone/drone/store/shared/db" "github.com/drone/drone/store/shared/encrypt" - "github.com/drone/drone/core" ) // helper function converts the User structure to a set diff --git a/store/secret/secret.go b/store/secret/secret.go index 18df4ffb7..c29ec9ed1 100644 --- a/store/secret/secret.go +++ b/store/secret/secret.go @@ -1,15 +1,26 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package secret import ( "context" + "github.com/drone/drone/core" "github.com/drone/drone/store/shared/db" "github.com/drone/drone/store/shared/encrypt" - "github.com/drone/drone/core" ) // New returns a new Secret database store. diff --git a/store/stage/scan.go b/store/stage/scan.go index 6a5620788..722bcacb6 100644 --- a/store/stage/scan.go +++ b/store/stage/scan.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package stage @@ -8,8 +19,8 @@ import ( "database/sql" "encoding/json" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" "github.com/jmoiron/sqlx/types" ) diff --git a/store/stage/stage.go b/store/stage/stage.go index d04196cf7..46808256b 100644 --- a/store/stage/stage.go +++ b/store/stage/stage.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package stage import ( "context" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new StageStore. diff --git a/store/stage/type.go b/store/stage/type.go index 5f74fa9bd..243917628 100644 --- a/store/stage/type.go +++ b/store/stage/type.go @@ -1,6 +1,17 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package stage diff --git a/store/step/scan.go b/store/step/scan.go index ceb9441c1..799ac3634 100644 --- a/store/step/scan.go +++ b/store/step/scan.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package step import ( "database/sql" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // helper function converts the Step structure to a set diff --git a/store/step/step.go b/store/step/step.go index 74e756e4f..b1ff8b8e6 100644 --- a/store/step/step.go +++ b/store/step/step.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package step import ( "context" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new StepStore. diff --git a/store/store.go b/store/store.go index 6d1b370d8..433638d85 100644 --- a/store/store.go +++ b/store/store.go @@ -3,21 +3,3 @@ // that can be found in the LICENSE file. package store - -import ( - "github.com/drone/drone/core" -) - -// Stores provides all database stores. -type Stores struct { - Batch core.Batcher - Builds core.BuildStore - Crons core.CronStore - Logs core.LogStore - Perms core.PermStore - Secrets core.SecretStore - Stages core.StageStore - Steps core.StepStore - Repos core.RepositoryStore - Users core.UserStore -} diff --git a/store/user/scan.go b/store/user/scan.go index 5f5d15c6b..63049f414 100644 --- a/store/user/scan.go +++ b/store/user/scan.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package user import ( "database/sql" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // helper function converts the User structure to a set diff --git a/store/user/user.go b/store/user/user.go index cf4b5c963..c2ea78b08 100644 --- a/store/user/user.go +++ b/store/user/user.go @@ -1,14 +1,25 @@ -// Copyright 2019 Drone.IO Inc. All rights reserved. -// Use of this source code is governed by the Drone Non-Commercial License -// that can be found in the LICENSE file. +// Copyright 2019 Drone IO, Inc. +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package user import ( "context" - "github.com/drone/drone/store/shared/db" "github.com/drone/drone/core" + "github.com/drone/drone/store/shared/db" ) // New returns a new UserStore.