1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

Enforce code format (#228)

* format .drone.yml & go code

* improve .editorconfig

* extend Makefile

* enforce go code format

* fix space

* update deps

* clean up
This commit is contained in:
6543 2021-06-22 12:34:35 +02:00 committed by GitHub
parent 310c46d3ab
commit bfc4aa8059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 146 additions and 123 deletions

View File

@ -1,15 +0,0 @@
#!/bin/bash
set -e
set -x
VERSION=$DRONE_TAG
if [ -z "$VERSION" ]; then
VERSION=${DRONE_COMMIT_SHA:0:8}
fi
echo "Building $VERSION"
go build -ldflags '-extldflags "-static" -X github.com/woodpecker-ci/woodpecker/version.Version='${VERSION} -o release/drone-server github.com/woodpecker-ci/woodpecker/cmd/drone-server
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-X github.com/woodpecker-ci/woodpecker/version.Version='${VERSION} -o release/drone-agent github.com/woodpecker-ci/woodpecker/cmd/drone-agent

View File

@ -9,6 +9,7 @@ pipeline:
commands:
- make deps
- make test
- make formatcheck
test-frontend:
image: node:10.17.0-stretch
@ -49,7 +50,7 @@ pipeline:
- (cd web/; go generate ./...)
- ./.drone.sh
when:
event: [ push, tag ]
event: [push, tag]
# publish-server-alpine:
# image: plugins/docker
@ -68,8 +69,8 @@ pipeline:
publish-server:
image: plugins/docker
repo: woodpeckerci/woodpecker-server
secrets: [ docker_username, docker_password ]
tag: [ latest ]
secrets: [docker_username, docker_password]
tag: [latest]
when:
branch: master
event: push
@ -78,8 +79,8 @@ pipeline:
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: Dockerfile.agent
secrets: [ docker_username, docker_password ]
tag: [ latest ]
secrets: [docker_username, docker_password]
tag: [latest]
when:
branch: master
event: push
@ -94,28 +95,28 @@ pipeline:
# branch: master
# event: push
# release-server-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-server
# dockerfile: Dockerfile.alpine
# secrets: [ docker_username, docker_password ]
# tag: "${DRONE_TAG}-alpine"
# when:
# event: tag
#
# release-agent-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-agent
# dockerfile: Dockerfile.agent.alpine
# secrets: [ docker_username, docker_password ]
# tag: "${DRONE_TAG}-alpine"
# when:
# event: tag
# release-server-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-server
# dockerfile: Dockerfile.alpine
# secrets: [ docker_username, docker_password ]
# tag: "${DRONE_TAG}-alpine"
# when:
# event: tag
#
# release-agent-alpine:
# image: plugins/docker
# repo: woodpeckerci/woodpecker-agent
# dockerfile: Dockerfile.agent.alpine
# secrets: [ docker_username, docker_password ]
# tag: "${DRONE_TAG}-alpine"
# when:
# event: tag
release-server:
image: plugins/docker
repo: woodpeckerci/woodpecker-server
secrets: [ docker_username, docker_password ]
secrets: [docker_username, docker_password]
tag: ${DRONE_TAG}
when:
event: tag
@ -124,7 +125,7 @@ pipeline:
image: plugins/docker
repo: woodpeckerci/woodpecker-agent
dockerfile: Dockerfile.agent
secrets: [ docker_username, docker_password ]
secrets: [docker_username, docker_password]
tag: ${DRONE_TAG}
when:
event: tag

View File

@ -1,16 +1,19 @@
root = true
[*.js]
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
[*.go]
indent_style = tab
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab

47
.gitignore vendored
View File

@ -1,18 +1,45 @@
drone/drone
*.sqlite
*.out
/.env
extras/
release/
cli/release/
server/swagger/files/*.json
server/swagger/swagger_gen.go
### IDEs ###
.idea/
.vscode/
!.vscode/launch.json
### GO ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories
# vendor/
### Frontend ###
web/node_modules
web/dist/files
web/*.log
web/.env
### Docker ###
docker-compose.yml
### Other ##
# runetime or build relicts
*.sqlite
*.out
/.env
extras/
release/
build/
cli/release/
server/swagger/files/*.json
server/swagger/swagger_gen.go
docs/venv

View File

@ -1,9 +1,10 @@
GO_VERSION=1.16
DOCKER_RUN_GO_VERSION=1.16
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*")
GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
DOCKER_RUN?=
_with-docker:
$(eval DOCKER_RUN=docker run --rm -v $(shell pwd):/go/src/ -v $(shell pwd)/build:/build -w /go/src golang:$(GO_VERSION))
$(eval DOCKER_RUN=docker run --rm -v $(shell pwd):/go/src/ -v $(shell pwd)/build:/build -w /go/src golang:$(DOCKER_RUN_GO_VERSION))
all: deps build
@ -16,13 +17,23 @@ deps:
go get -d github.com/jackspirou/syscerts
formatcheck:
([ -z "$(shell gofmt -d $(GOFILES_NOVENDOR))" ]) || (echo "Source is unformatted"; exit 1)
@([ -z "$(shell gofmt -d $(GOFILES_NOVENDOR) | head)" ]) || (echo "Source is unformatted"; exit 1)
format:
@gofmt -w ${GOFILES_NOVENDOR}
.PHONY: clean
clean:
go clean -i ./...
rm -rf build
.PHONY: vet
vet:
@echo "Running go vet..."
@go vet $(GO_PACKAGES)
test-agent:
$(DOCKER_RUN) go test -race -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/drone-agent $(go list ./... | grep -v /vendor/)
$(DOCKER_RUN) go test -race -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/drone-agent $(GO_PACKAGES)
test-server:
$(DOCKER_RUN) go test -race -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/drone-server

View File

@ -34,12 +34,12 @@ pipeline:
- Install the needed tools in custom Docker images, use them as context
```diff
pipeline:
build:
pipeline:
build:
- image: debian
+ image: mycompany/image-with-awscli
commands:
- aws help
+ image: mycompany/image-with-awscli
commands:
- aws help
```
## File changes are incremental

2
build/.gitignore vendored
View File

@ -1,2 +0,0 @@
drone-agent
drone-server

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strconv"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildApproveCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strconv"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildDeclineCmd = cli.Command{

View File

@ -5,8 +5,8 @@ import (
"strconv"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildInfoCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strconv"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildKillCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"os"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildLastCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"os"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildListCmd = cli.Command{

View File

@ -5,8 +5,8 @@ import (
"strconv"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildPsCmd = cli.Command{

View File

@ -5,8 +5,8 @@ import (
"os"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildQueueCmd = cli.Command{

View File

@ -5,8 +5,8 @@ import (
"fmt"
"strconv"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildStartCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strconv"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var buildStopCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strconv"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var logPurgeCmd = cli.Command{

View File

@ -3,8 +3,8 @@ package repo
import (
"fmt"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var repoAddCmd = cli.Command{

View File

@ -3,8 +3,8 @@ package repo
import (
"fmt"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var repoChownCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"os"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var repoInfoCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"os"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var repoListCmd = cli.Command{

View File

@ -1,8 +1,8 @@
package repo
import (
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var repoRepairCmd = cli.Command{

View File

@ -4,8 +4,8 @@ import (
"os"
"text/template"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)
var repoSyncCmd = cli.Command{

View File

@ -3,8 +3,8 @@ package user
import (
"fmt"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
)

View File

@ -22,8 +22,8 @@ import (
"sync"
"time"
"github.com/woodpecker-ci/woodpecker/version"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/version"
)
// the file implements some basic healthcheck logic based on the

View File

@ -19,6 +19,8 @@ import (
"time"
"github.com/dimfeld/httptreemux"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/woodpecker-ci/woodpecker/cncd/queue"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/plugins/environments"
@ -37,8 +39,6 @@ import (
"github.com/woodpecker-ci/woodpecker/server/web"
"github.com/woodpecker-ci/woodpecker/store"
"github.com/woodpecker-ci/woodpecker/store/datastore"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"golang.org/x/sync/errgroup"
"github.com/urfave/cli"

View File

@ -8,13 +8,13 @@ import (
"strconv"
"time"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/backend/docker"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/backend/kubernetes"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/interrupt"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/multipart"
"github.com/urfave/cli"
)
var executeCommand = cli.Command{

View File

@ -206,7 +206,7 @@ func TestFifoErrors2(t *testing.T) {
}
task2 := &Task{
ID: "2",
ID: "2",
}
task3 := &Task{
@ -220,7 +220,7 @@ func TestFifoErrors2(t *testing.T) {
for i := 0; i < 2; i++ {
got, _ := q.Poll(noContext, func(*Task) bool { return true })
if got != task1 && got != task2{
if got != task1 && got != task2 {
t.Errorf("expect task1 or task2 returned from queue as task3 depends on them")
return
}

View File

@ -110,15 +110,15 @@ func (t *InfoT) String() string {
var sb strings.Builder
for _, task := range t.Pending {
sb.WriteString("\t" + task.String())
sb.WriteString("\t" + task.String())
}
for _, task := range t.Running {
sb.WriteString("\t" + task.String())
sb.WriteString("\t" + task.String())
}
for _, task := range t.WaitingOnDeps {
sb.WriteString("\t" + task.String())
sb.WriteString("\t" + task.String())
}
return sb.String()

2
go.mod
View File

@ -56,7 +56,7 @@ require (
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5
github.com/urfave/cli v1.22.4
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
google.golang.org/appengine v1.6.6 // indirect

6
go.sum
View File

@ -246,10 +246,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk=
golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=

View File

@ -17,8 +17,8 @@ package model
import (
"context"
"github.com/woodpecker-ci/woodpecker/cncd/queue"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/cncd/queue"
)
// Task defines scheduled pipeline Task.

View File

@ -28,10 +28,10 @@ import (
"net/url"
"strings"
"github.com/mrjones/oauth"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/remote"
"github.com/woodpecker-ci/woodpecker/remote/bitbucketserver/internal"
"github.com/mrjones/oauth"
)
const (

View File

@ -22,9 +22,9 @@ import (
"strings"
"time"
"github.com/mrjones/oauth"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/remote/bitbucketserver/internal"
"github.com/mrjones/oauth"
)
const (

View File

@ -18,9 +18,9 @@ import (
"testing"
"github.com/franela/goblin"
"github.com/mrjones/oauth"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/remote/bitbucketserver/internal"
"github.com/mrjones/oauth"
)
func Test_helper(t *testing.T) {

View File

@ -25,9 +25,9 @@ import (
"strings"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/mrjones/oauth"
log "github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/model"
)
const (

View File

@ -15,8 +15,8 @@
package middleware
import (
"github.com/woodpecker-ci/woodpecker/store"
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/store"
"github.com/gin-gonic/gin"
)

View File

@ -25,11 +25,11 @@ import (
"time"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/cncd/queue"
"github.com/woodpecker-ci/woodpecker/remote"
"github.com/woodpecker-ci/woodpecker/shared/httputil"
"github.com/woodpecker-ci/woodpecker/store"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/router/middleware/session"

View File

@ -27,12 +27,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/remote"
"github.com/woodpecker-ci/woodpecker/shared/httputil"
"github.com/woodpecker-ci/woodpecker/shared/token"
"github.com/woodpecker-ci/woodpecker/store"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/frontend/yaml"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc"

View File

@ -19,8 +19,8 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/woodpecker-ci/woodpecker/server"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/woodpecker-ci/woodpecker/server"
)
var (

View File

@ -27,14 +27,14 @@ import (
"google.golang.org/grpc/metadata"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/cncd/logging"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc"
"github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc/proto"
"github.com/woodpecker-ci/woodpecker/cncd/pubsub"
"github.com/woodpecker-ci/woodpecker/cncd/queue"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/sirupsen/logrus"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/remote"

View File

@ -18,9 +18,9 @@ import (
"fmt"
"time"
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) GetBuild(id int64) (*model.Build, error) {

View File

@ -17,9 +17,9 @@ package datastore
import (
gosql "database/sql"
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) ConfigsForBuild(buildID int64) ([]*model.Config, error) {

View File

@ -19,9 +19,9 @@ import (
"io"
"io/ioutil"
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) LogFind(proc *model.Proc) (io.ReadCloser, error) {

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) ProcLoad(id int64) (*model.Proc, error) {

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) RegistryFind(repo *model.Repo, addr string) (*model.Registry, error) {

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) GetRepo(id int64) (*model.Repo, error) {

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) SecretFind(repo *model.Repo, name string) (*model.Secret, error) {

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) SenderFind(repo *model.Repo, login string) (*model.Sender, error) {

View File

@ -19,9 +19,9 @@ import (
"os"
"time"
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/store"
"github.com/woodpecker-ci/woodpecker/store/datastore/ddl"
"github.com/russross/meddler"
"github.com/sirupsen/logrus"
)

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) TaskList() ([]*model.Task, error) {

View File

@ -15,9 +15,9 @@
package datastore
import (
"github.com/russross/meddler"
"github.com/woodpecker-ci/woodpecker/model"
"github.com/woodpecker-ci/woodpecker/store/datastore/sql"
"github.com/russross/meddler"
)
func (db *datastore) GetUser(id int64) (*model.User, error) {