Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove golang vendored directory #18277

Merged
merged 3 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
48 changes: 24 additions & 24 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ steps:
image: golang:1.16 # this step is kept as the lowest version of golang that we support
environment:
GO111MODULE: on
GOPROXY: off
GOPROXY: https://goproxy.cn
commands:
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
- go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
depends_on: [checks-backend]

- name: build-backend-arm64
image: golang:1.17
environment:
GO111MODULE: on
GOPROXY: off
GOPROXY: https://goproxy.cn
GOOS: linux
GOARCH: arm64
TAGS: bindata gogit
Expand All @@ -110,23 +110,23 @@ steps:
image: golang:1.17
environment:
GO111MODULE: on
GOPROXY: off
GOPROXY: https://goproxy.cn
GOOS: windows
GOARCH: amd64
TAGS: bindata gogit
commands:
- go build -mod=vendor -o gitea_windows
- go build -o gitea_windows
depends_on: [checks-backend]

- name: build-backend-386
image: golang:1.17
environment:
GO111MODULE: on
GOPROXY: off
GOPROXY: https://goproxy.cn
GOOS: linux
GOARCH: 386
commands:
- go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
- go build -o gitea_linux_386 # test if compatible with 32 bit
depends_on: [checks-backend]

---
Expand Down Expand Up @@ -224,7 +224,7 @@ steps:
commands:
- make unit-test-coverage test-check
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata sqlite sqlite_unlock_notify
RACE_ENABLED: true
GITHUB_READ_TOKEN:
Expand All @@ -237,7 +237,7 @@ steps:
commands:
- make unit-test-coverage test-check
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
GITHUB_READ_TOKEN:
Expand All @@ -249,7 +249,7 @@ steps:
commands:
- make test-mysql-migration integration-test-coverage
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata
RACE_ENABLED: true
TEST_LDAP: 1
Expand All @@ -264,7 +264,7 @@ steps:
commands:
- timeout -s ABRT 40m make test-mysql8-migration test-mysql8
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata
RACE_ENABLED: true
TEST_LDAP: 1
Expand All @@ -278,7 +278,7 @@ steps:
commands:
- make test-mssql-migration test-mssql
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata
RACE_ENABLED: true
TEST_LDAP: 1
Expand All @@ -291,7 +291,7 @@ steps:
commands:
- make coverage
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata
depends_on:
- unit-test
Expand Down Expand Up @@ -384,7 +384,7 @@ steps:
commands:
- timeout -s ABRT 40m make test-sqlite-migration test-sqlite
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
Expand All @@ -398,7 +398,7 @@ steps:
commands:
- timeout -s ABRT 40m make test-pgsql-migration test-pgsql
environment:
GOPROXY: off
GOPROXY: https://goproxy.cn
TAGS: bindata gogit
RACE_ENABLED: true
TEST_TAGS: gogit
Expand Down Expand Up @@ -760,7 +760,7 @@ steps:
auto_tag_suffix: linux-amd64
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand All @@ -778,7 +778,7 @@ steps:
auto_tag_suffix: linux-amd64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand Down Expand Up @@ -822,7 +822,7 @@ steps:
tags: dev-linux-amd64
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand All @@ -840,7 +840,7 @@ steps:
tags: dev-linux-amd64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand Down Expand Up @@ -875,7 +875,7 @@ steps:
repo: gitea/gitea
tags: linux-arm64
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
Expand Down Expand Up @@ -917,7 +917,7 @@ steps:
auto_tag_suffix: linux-arm64
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand All @@ -935,7 +935,7 @@ steps:
auto_tag_suffix: linux-arm64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand Down Expand Up @@ -979,7 +979,7 @@ steps:
tags: dev-linux-arm64
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand All @@ -997,7 +997,7 @@ steps:
tags: dev-linux-arm64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=off
- GOPROXY=https://goproxy.cn
password:
from_secret: docker_password
username:
Expand Down
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G

LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64

GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/integrations/migration-test code.gitea.io/gitea/integrations,$(shell $(GO) list -mod=vendor ./... | grep -v /vendor/))
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/integrations/migration-test code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))

FOMANTIC_WORK_DIR := web_src/fomantic

Expand All @@ -116,7 +116,7 @@ TEST_TAGS ?= sqlite sqlite_unlock_notify

TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR)

GO_DIRS := cmd integrations models modules routers build services vendor tools
GO_DIRS := cmd integrations models modules routers build services tools

GO_SOURCES := $(wildcard *.go)
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
Expand All @@ -126,7 +126,7 @@ ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
endif

#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/swagger
SWAGGER := $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger
SWAGGER := $(GO) run github.com/go-swagger/go-swagger/cmd/swagger
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|g
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
Expand Down Expand Up @@ -237,7 +237,7 @@ fmt:
.PHONY: vet
vet:
@echo "Running go vet..."
@GOOS= GOARCH= $(GO) build -mod=vendor code.gitea.io/gitea-vet
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)

.PHONY: $(TAGS_EVIDENCE)
Expand Down Expand Up @@ -295,7 +295,7 @@ checks: checks-frontend checks-backend
checks-frontend: svg-check

.PHONY: checks-backend
checks-backend: test-vendor swagger-check swagger-validate
checks-backend: swagger-check swagger-validate

.PHONY: lint
lint: lint-frontend lint-backend
Expand Down Expand Up @@ -331,7 +331,7 @@ test: test-frontend test-backend
.PHONY: test-backend
test-backend:
@echo "Running go test with $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
@$(GO) test $(GOTESTFLAGS) -mod=vendor -tags='$(TEST_TAGS)' $(GO_PACKAGES)
@$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_PACKAGES)

.PHONY: test-frontend
test-frontend: node_modules
Expand All @@ -352,18 +352,18 @@ test-check:
.PHONY: test\#%
test\#%:
@echo "Running go test with -tags '$(TEST_TAGS)'..."
@$(GO) test -mod=vendor $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_PACKAGES)
@$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_PACKAGES)

.PHONY: coverage
coverage:
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' coverage.out > coverage-bodged.out
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' integration.coverage.out > integration.coverage-bodged.out
GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all || (echo "gocovmerge failed"; echo "integration.coverage.out"; cat integration.coverage.out; echo "coverage.out"; cat coverage.out; exit 1)
GO111MODULE=on $(GO) run build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all || (echo "gocovmerge failed"; echo "integration.coverage.out"; cat integration.coverage.out; echo "coverage.out"; cat coverage.out; exit 1)

.PHONY: unit-test-coverage
unit-test-coverage:
@echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
@$(GO) test $(GOTESTFLAGS) -mod=vendor -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
@$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1

.PHONY: vendor
vendor:
Expand Down Expand Up @@ -501,22 +501,22 @@ integration-test-coverage: integrations.cover.test generate-ini-mysql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out

integrations.mysql.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.mysql.test

integrations.mysql8.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.mysql8.test

integrations.pgsql.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.pgsql.test

integrations.mssql.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.mssql.test

integrations.sqlite.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags '$(TEST_TAGS)'
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags '$(TEST_TAGS)'

integrations.cover.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test

.PHONY: migrations.mysql.test
migrations.mysql.test: $(GO_SOURCES)
Expand Down Expand Up @@ -577,13 +577,13 @@ backend: go-check generate $(EXECUTABLE)
.PHONY: generate
generate: $(TAGS_PREREQ)
@echo "Running go generate..."
@CC= GOOS= GOARCH= $(GO) generate -mod=vendor -tags '$(TAGS)' $(GO_PACKAGES)
@CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES)

$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@

.PHONY: release
release: frontend generate release-windows release-linux release-darwin release-copy release-compress release-sources release-docs release-check
release: frontend generate release-windows release-linux release-darwin release-copy release-compress vendor release-sources release-docs release-check

$(DIST_DIRS):
mkdir -p $(DIST_DIRS)
Expand Down
2 changes: 1 addition & 1 deletion modules/options/options_bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

package options

//go:generate go run -mod=vendor ../../build/generate-bindata.go ../../options options bindata.go
//go:generate go run ../../build/generate-bindata.go ../../options options bindata.go
2 changes: 1 addition & 1 deletion modules/public/public_bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

package public

//go:generate go run -mod=vendor ../../build/generate-bindata.go ../../public public bindata.go true
//go:generate go run ../../build/generate-bindata.go ../../public public bindata.go true
2 changes: 1 addition & 1 deletion modules/templates/templates_bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

package templates

//go:generate go run -mod=vendor ../../build/generate-bindata.go ../../templates templates bindata.go true
//go:generate go run ../../build/generate-bindata.go ../../templates templates bindata.go true
Loading