This commit is contained in:
techknowlogick
2020-03-20 10:29:31 -04:00
committed by GitHub
parent e5a008f7b2
commit 2fa1078911
12 changed files with 177 additions and 34 deletions

View File

@ -19,7 +19,7 @@ steps:
- name: build-without-gcc - name: build-without-gcc
pull: always pull: always
image: golang:1.11 # this step is kept as the lowest version of golang that we support image: golang:1.12 # this step is kept as the lowest version of golang that we support
environment: environment:
GO111MODULE: on GO111MODULE: on
GOPROXY: off GOPROXY: off
@ -28,7 +28,7 @@ steps:
- name: build-linux-386 - name: build-linux-386
pull: always pull: always
image: golang:1.13 image: golang:1.14
environment: environment:
GO111MODULE: on GO111MODULE: on
GOPROXY: off GOPROXY: off
@ -39,7 +39,7 @@ steps:
- name: check - name: check
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make clean golangci-lint revive swagger-check swagger-validate test-vendor - make clean golangci-lint revive swagger-check swagger-validate test-vendor
environment: environment:
@ -105,7 +105,7 @@ steps:
- name: build - name: build
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make build - make build
@ -122,7 +122,7 @@ steps:
- name: unit-test - name: unit-test
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make unit-test-coverage test-check - make unit-test-coverage test-check
environment: environment:
@ -133,7 +133,7 @@ steps:
- name: test-mysql - name: test-mysql
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -147,7 +147,7 @@ steps:
- name: test-mysql8 - name: test-mysql8
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -161,7 +161,7 @@ steps:
- name: test-mssql - name: test-mssql
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -175,7 +175,7 @@ steps:
- name: generate-coverage - name: generate-coverage
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- make coverage - make coverage
environment: environment:
@ -248,7 +248,7 @@ steps:
- name: build - name: build
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make build - make build
@ -259,7 +259,7 @@ steps:
- name: test-sqlite - name: test-sqlite
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -272,7 +272,7 @@ steps:
- name: test-pgsql - name: test-pgsql
pull: always pull: always
image: golang:1.13 image: golang:1.14
commands: commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs - apt-get install -y git-lfs
@ -379,7 +379,7 @@ steps:
- name: static - name: static
pull: always pull: always
image: techknowlogick/xgo:go-1.13.x image: techknowlogick/xgo:go-1.14.x
commands: commands:
- apt update && apt -y install curl - apt update && apt -y install curl
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
@ -477,7 +477,7 @@ steps:
- name: static - name: static
pull: always pull: always
image: techknowlogick/xgo:go-1.13.x image: techknowlogick/xgo:go-1.14.x
commands: commands:
- apt update && apt -y install curl - apt update && apt -y install curl
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs

View File

@ -1,7 +1,7 @@
################################### ###################################
#Build stage #Build stage
FROM golang:1.13-alpine3.11 AS build-env FROM golang:1.14-alpine3.11 AS build-env
ARG GOPROXY ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct} ENV GOPROXY ${GOPROXY:-direct}

View File

@ -9,6 +9,10 @@ SHASUM ?= shasum -a 256
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" ) HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
COMMA := , COMMA := ,
XGO_VERSION := go-1.14.x
MIN_GO_VERSION := 001012000
MIN_NODE_VERSION := 010000000
ifeq ($(HAS_GO), GO) ifeq ($(HAS_GO), GO)
GOPATH ?= $(shell $(GO) env GOPATH) GOPATH ?= $(shell $(GO) env GOPATH)
export PATH := $(GOPATH)/bin:$(PATH) export PATH := $(GOPATH)/bin:$(PATH)
@ -145,8 +149,8 @@ help:
.PHONY: go-check .PHONY: go-check
go-check: go-check:
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');)) $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');))
@if [ "$(GO_VERSION)" -lt "001011000" ]; then \ @if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
echo "Gitea requires Go 1.11 or greater to build. You can get it at https://golang.org/dl/"; \ echo "Gitea requires Go 1.12 or greater to build. You can get it at https://golang.org/dl/"; \
exit 1; \ exit 1; \
fi fi
@ -161,7 +165,7 @@ git-check:
node-check: node-check:
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');)) $(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');))
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1)) $(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
@if [ "$(NODE_VERSION)" -lt "010000000" -o "$(NPM_MISSING)" = "1" ]; then \ @if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \ echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
exit 1; \ exit 1; \
fi fi
@ -480,7 +484,7 @@ release-windows: | $(DIST_DIRS)
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u src.techknowlogick.com/xgo; \ $(GO) get -u src.techknowlogick.com/xgo; \
fi fi
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) . xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone) ifeq ($(CI),drone)
cp /build/* $(DIST)/binaries cp /build/* $(DIST)/binaries
endif endif
@ -490,7 +494,7 @@ release-linux: | $(DIST_DIRS)
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u src.techknowlogick.com/xgo; \ $(GO) get -u src.techknowlogick.com/xgo; \
fi fi
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) . xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
ifeq ($(CI),drone) ifeq ($(CI),drone)
cp /build/* $(DIST)/binaries cp /build/* $(DIST)/binaries
endif endif
@ -500,7 +504,7 @@ release-darwin: | $(DIST_DIRS)
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u src.techknowlogick.com/xgo; \ $(GO) get -u src.techknowlogick.com/xgo; \
fi fi
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) . xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone) ifeq ($(CI),drone)
cp /build/* $(DIST)/binaries cp /build/* $(DIST)/binaries
endif endif

View File

@ -39,7 +39,7 @@ or if sqlite support is required:
The `build` target is split into two sub-targets: The `build` target is split into two sub-targets:
- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater. - `make backend` which requires [Go 1.12](https://golang.org/dl/) or greater.
- `make frontend` which requires [Node.js 10](https://nodejs.org/en/download/) or greater. - `make frontend` which requires [Node.js 10](https://nodejs.org/en/download/) or greater.
If pre-built frontend files are present it is possible to only build the backend: If pre-built frontend files are present it is possible to only build the backend:

View File

@ -19,8 +19,8 @@ params:
author: The Gitea Authors author: The Gitea Authors
website: https://docs.gitea.io website: https://docs.gitea.io
version: 1.11.3 version: 1.11.3
minGoVersion: 1.11 minGoVersion: 1.12
goVersion: 1.13 goVersion: 1.14
minNodeVersion: 10 minNodeVersion: 10
outputs: outputs:

4
go.mod
View File

@ -1,6 +1,6 @@
module code.gitea.io/gitea module code.gitea.io/gitea
go 1.13 go 1.14
require ( require (
cloud.google.com/go v0.45.0 // indirect cloud.google.com/go v0.45.0 // indirect
@ -50,6 +50,7 @@ require (
github.com/gobwas/glob v0.2.3 github.com/gobwas/glob v0.2.3
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28 github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
github.com/golang/protobuf v1.3.4 // indirect
github.com/google/go-github/v24 v24.0.1 github.com/google/go-github/v24 v24.0.1
github.com/gorilla/context v1.1.1 github.com/gorilla/context v1.1.1
github.com/huandu/xstrings v1.3.0 github.com/huandu/xstrings v1.3.0
@ -91,6 +92,7 @@ require (
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
github.com/stretchr/testify v1.4.0 github.com/stretchr/testify v1.4.0
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
github.com/tinylib/msgp v1.1.1 // indirect
github.com/tstranex/u2f v1.0.0 github.com/tstranex/u2f v1.0.0
github.com/unknwon/cae v1.0.0 github.com/unknwon/cae v1.0.0
github.com/unknwon/com v1.0.1 github.com/unknwon/com v1.0.1

4
go.sum
View File

@ -269,6 +269,8 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@ -553,6 +555,8 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.1 h1:TnCZ3FIuKeaIy+F45+Cnp+caqdXGy4z74HvwXN+570Y=
github.com/tinylib/msgp v1.1.1/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/toqueteos/trie v1.0.0 h1:8i6pXxNUXNRAqP246iibb7w/pSFquNTQ+uNfriG7vlk= github.com/toqueteos/trie v1.0.0 h1:8i6pXxNUXNRAqP246iibb7w/pSFquNTQ+uNfriG7vlk=
github.com/toqueteos/trie v1.0.0/go.mod h1:Ywk48QhEqhU1+DwhMkJ2x7eeGxDHiGkAdc9+0DYcbsM= github.com/toqueteos/trie v1.0.0/go.mod h1:Ywk48QhEqhU1+DwhMkJ2x7eeGxDHiGkAdc9+0DYcbsM=

View File

@ -393,7 +393,7 @@ func (p *Buffer) Bytes() []byte { return p.buf }
// than relying on this API. // than relying on this API.
// //
// If deterministic serialization is requested, map entries will be sorted // If deterministic serialization is requested, map entries will be sorted
// by keys in lexographical order. This is an implementation detail and // by keys in lexicographical order. This is an implementation detail and
// subject to change. // subject to change.
func (p *Buffer) SetDeterministic(deterministic bool) { func (p *Buffer) SetDeterministic(deterministic bool) {
p.deterministic = deterministic p.deterministic = deterministic

View File

@ -456,6 +456,8 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
return nil return nil
} }
var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
// writeAny writes an arbitrary field. // writeAny writes an arbitrary field.
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error { func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
v = reflect.Indirect(v) v = reflect.Indirect(v)
@ -519,8 +521,8 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
// mutating this value. // mutating this value.
v = v.Addr() v = v.Addr()
} }
if etm, ok := v.Interface().(encoding.TextMarshaler); ok { if v.Type().Implements(textMarshalerType) {
text, err := etm.MarshalText() text, err := v.Interface().(encoding.TextMarshaler).MarshalText()
if err != nil { if err != nil {
return err return err
} }

View File

@ -474,8 +474,8 @@ func AppendExtension(b []byte, e Extension) ([]byte, error) {
// and returns any remaining bytes. // and returns any remaining bytes.
// Possible errors: // Possible errors:
// - ErrShortBytes ('b' not long enough) // - ErrShortBytes ('b' not long enough)
// - ExtensionTypeErorr{} (wire type not the same as e.Type()) // - ExtensionTypeError{} (wire type not the same as e.Type())
// - TypeErorr{} (next object not an extension) // - TypeError{} (next object not an extension)
// - InvalidPrefixError // - InvalidPrefixError
// - An umarshal error returned from e.UnmarshalBinary // - An umarshal error returned from e.UnmarshalBinary
func ReadExtensionBytes(b []byte, e Extension) ([]byte, error) { func ReadExtensionBytes(b []byte, e Extension) ([]byte, error) {

View File

@ -201,14 +201,14 @@ func ReadMapHeaderBytes(b []byte) (sz uint32, o []byte, err error) {
// - ErrShortBytes (too few bytes) // - ErrShortBytes (too few bytes)
// - TypeError{} (not a str or bin) // - TypeError{} (not a str or bin)
func ReadMapKeyZC(b []byte) ([]byte, []byte, error) { func ReadMapKeyZC(b []byte) ([]byte, []byte, error) {
o, b, err := ReadStringZC(b) o, x, err := ReadStringZC(b)
if err != nil { if err != nil {
if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType { if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType {
return ReadBytesZC(b) return ReadBytesZC(b)
} }
return nil, b, err return nil, b, err
} }
return o, b, nil return o, x, nil
} }
// ReadArrayHeaderBytes attempts to read // ReadArrayHeaderBytes attempts to read

135
vendor/modules.txt vendored

File diff suppressed because it is too large Load Diff