From e51eb1a00ececa0d3fea2a7e4d2645aed5d35add Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Wed, 8 Feb 2023 05:46:31 +0800 Subject: [PATCH 1/4] bump to go 1.20 (#529) Reviewed-on: https://gitea.com/gitea/tea/pulls/529 Reviewed-by: Lunny Xiao --- .drone.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2aedc74..a1148cc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ platform: steps: - name: vendor pull: always - image: golang:1.18 + image: golang:1.20 environment: GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not commands: @@ -17,7 +17,7 @@ steps: - name: build pull: always - image: golang:1.18 + image: golang:1.20 environment: GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not commands: @@ -34,7 +34,7 @@ steps: - pull_request - name: unit-test - image: golang:1.18 + image: golang:1.20 commands: - make unit-test-coverage settings: @@ -49,7 +49,7 @@ steps: - pull_request - name: release-test - image: golang:1.18 + image: golang:1.20 commands: - make test settings: @@ -65,7 +65,7 @@ steps: - name: tag-test pull: always - image: golang:1.18 + image: golang:1.20 commands: - make test settings: @@ -77,7 +77,7 @@ steps: - tag - name: static - image: golang:1.18 + image: golang:1.20 environment: GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not commands: From faa9858a7e62924edd281fca7754b6a774888163 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Wed, 8 Feb 2023 05:53:05 +0800 Subject: [PATCH 2/4] use secrets for s3 info (#530) Reviewed-on: https://gitea.com/gitea/tea/pulls/530 --- .drone.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index a1148cc..60d4eb8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -110,11 +110,16 @@ steps: pull: always image: woodpeckerci/plugin-s3:latest settings: - acl: public-read - bucket: gitea-artifacts + acl: + from_secret: aws_s3_acl + region: + from_secret: aws_s3_region + bucket: + from_secret: aws_s3_bucket endpoint: - from_secret: aws_endpoint - path_style: true + from_secret: aws_s3_endpoint + path_style: + from_secret: aws_s3_path_style source: "dist/release/*" strip_prefix: dist/release/ target: "/tea/${DRONE_TAG##v}" @@ -153,10 +158,16 @@ steps: pull: always image: woodpeckerci/plugin-s3:latest settings: - acl: public-read - bucket: gitea-artifacts + acl: + from_secret: aws_s3_acl + region: + from_secret: aws_s3_region + bucket: + from_secret: aws_s3_bucket endpoint: - from_secret: aws_endpoint + from_secret: aws_s3_endpoint + path_style: + from_secret: aws_s3_path_style source: "dist/release/*" strip_prefix: dist/release/ target: /tea/main From 1a6d9b343abc5c96226c38749008658efc426bc9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 9 Feb 2023 11:05:39 +0800 Subject: [PATCH 3/4] Fix makefile vendor problem (#533) Replace #532 Co-authored-by: techknowlogick Reviewed-on: https://gitea.com/gitea/tea/pulls/533 Reviewed-by: John Olheiser Reviewed-by: techknowlogick Co-authored-by: Lunny Xiao Co-committed-by: Lunny Xiao --- .drone.yml | 7 ------- Makefile | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 60d4eb8..1298658 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,13 +7,6 @@ platform: arch: amd64 steps: -- name: vendor - pull: always - image: golang:1.20 - environment: - GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not - commands: - - make vendor # use vendor folder as cache - name: build pull: always diff --git a/Makefile b/Makefile index f616587..69960fb 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ SHASUM ?= shasum -a 256 export PATH := $($(GO) env GOPATH)/bin:$(PATH) -GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go") +GOFILES := $(shell find . -name "*.go" -type f ! -path "*/bindata.go") GOFMT ?= gofmt -s ifneq ($(DRONE_TAG),) @@ -28,9 +28,9 @@ SDK ?= $(shell $(GO) list -f '{{.Version}}' -m code.gitea.io/sdk/gitea) LDFLAGS := -X "main.Version=$(TEA_VERSION)" -X "main.Tags=$(TAGS)" -X "main.SDK=$(SDK)" -s -w # override to allow passing additional goflags via make CLI -override GOFLAGS := $(GOFLAGS) -mod=vendor -tags '$(TAGS)' -ldflags '$(LDFLAGS)' +override GOFLAGS := $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -PACKAGES ?= $(shell $(GO) list ./... | grep -v /vendor/) +PACKAGES ?= $(shell $(GO) list ./...) SOURCES ?= $(shell find . -name "*.go" -type f) # OS specific vars. @@ -48,7 +48,7 @@ all: build .PHONY: clean clean: - $(GO) clean -mod=vendor -i ./... + $(GO) clean -i ./... rm -rf $(EXECUTABLE) $(DIST) .PHONY: fmt @@ -58,14 +58,14 @@ fmt: .PHONY: vet vet: # Default vet - $(GO) vet -mod=vendor $(PACKAGES) + $(GO) vet $(PACKAGES) # Custom vet - $(GO) build -mod=vendor code.gitea.io/gitea-vet + $(GO) build code.gitea.io/gitea-vet $(GO) vet -vettool=gitea-vet $(PACKAGES) .PHONY: lint lint: install-lint-tools - revive -config .revive.toml -exclude=./vendor/... ./... || exit 1 + revive -config .revive.toml ./... || exit 1 .PHONY: misspell-check misspell-check: install-lint-tools @@ -87,15 +87,15 @@ fmt-check: .PHONY: test test: - $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES) + $(GO) test -tags='sqlite sqlite_unlock_notify' $(PACKAGES) .PHONY: unit-test-coverage unit-test-coverage: - $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 + $(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 -.PHONY: vendor -vendor: - $(GO) mod tidy && $(GO) mod vendor +.PHONY: tidy +tidy: + $(GO) mod tidy .PHONY: check check: test From 342b573d45bf87d9e13685d03f221af261ea30e5 Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Thu, 9 Feb 2023 12:41:43 +0800 Subject: [PATCH 4/4] Remove vendor docs (#534) As title, we no longer use vendoring (or dep!). Also updated the link to Discord. Co-authored-by: jolheiser Reviewed-on: https://gitea.com/gitea/tea/pulls/534 Reviewed-by: techknowlogick Co-authored-by: John Olheiser Co-committed-by: John Olheiser --- CONTRIBUTING.md | 19 ++----------------- README.md | 1 - 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 498d474..fe6e7c0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,6 @@ - [Bug reports](#bug-reports) - [Discuss your design](#discuss-your-design) - [Testing redux](#testing-redux) - - [Vendoring](#vendoring) - [Code review](#code-review) - [Styleguide](#styleguide) - [Sign-off your work](#sign-off-your-work) @@ -60,20 +59,6 @@ high-level discussions. Before sending code out for review, run all the test by executing: `make test` Since TEA is an cli tool it should be obvious to test your feature locally first. -## Vendoring - -We keep a cached copy of dependencies within the `vendor/` directory, -managing updates via [dep](https://github.com/golang/dep). - -Pull requests should only include `vendor/` updates if they are part of -the same change, be it a bugfix or a feature addition. - -The `vendor/` update needs to be justified as part of the PR description, -and must be verified by the reviewers and/or merger to always reference -an existing upstream commit. - -You can find more information on how to get started with it on the [dep project website](https://golang.github.io/dep/docs/introduction.html). - ## Code review Changes to TEA must be reviewed before they are accepted—no matter who @@ -175,7 +160,7 @@ maintainers](MAINTAINERS). Every PR **MUST** be reviewed by at least two maintainers (or owners) before it can get merged. A maintainer should be a contributor of Gitea (or Gogs) and contributed at least 4 accepted PRs. A contributor should apply as a maintainer in the -[Discord](https://discord.gg/NsatcWJ) #develop channel. The owners +[Discord](https://discord.gg/Gitea) #develop channel. The owners or the team maintainers may invite the contributor. A maintainer should spend some time on code reviews. If a maintainer has no time to do that, they should apply to leave the maintainers team @@ -208,7 +193,7 @@ https://help.github.com/articles/securing-your-account-with-two-factor-authentic After the election, the new owners should proactively agree with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the -[Discord](https://discord.gg/NsatcWJ) #general channel. Below are the +[Discord](https://discord.gg/Gitea) #general channel. Below are the words to speak: ``` diff --git a/README.md b/README.md index 6c90e05..19811e9 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,6 @@ Fork -> Patch -> Push -> Pull Request - `make test` run testsuite - `make vet` run checks (check the order of imports; preventing failure on CI pipeline beforehand) -- `make vendor` when adding new dependencies - ... (for other development tasks, check the `Makefile`) **Please** read the [CONTRIBUTING](CONTRIBUTING.md) documentation, it will tell you about internal structures and concepts.