Skip to content

Commit

Permalink
Remove vendor
Browse files Browse the repository at this point in the history
- Remove the vendor directory
- Update bot to stop accounting for vendor
- Update linter config
- Remove update-vendor make target
  • Loading branch information
zmb3 committed Jan 7, 2022
1 parent 4e324e7 commit d0eb861
Show file tree
Hide file tree
Showing 5,950 changed files with 12 additions and 2,376,218 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 0 additions & 3 deletions .github/workflows/robot/internal/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ func (b *Bot) parseChanges(ctx context.Context) (bool, bool, error) {
}

func hasDocs(filename string) bool {
if strings.HasPrefix(filename, "vendor/") {
return false
}
return strings.HasPrefix(filename, "docs/") ||
strings.HasSuffix(filename, ".md") ||
strings.HasSuffix(filename, ".mdx") ||
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/robot/internal/bot/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ func (b *Bot) labels(ctx context.Context) ([]string, error) {
}

for _, file := range files {
// Special case: skip vendor until it is removed in #9545.
if strings.HasPrefix(file, "vendor/") {
continue
}

for k, v := range prefixes {
if strings.HasPrefix(file, k) {
log.Printf("Label: Found prefix %v, attaching labels: %v.", k, v)
Expand Down
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ output:
uniq-by-line: false

run:
skip-dirs:
- vendor
skip-dirs-use-default: false
timeout: 5m
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ If your patch depends on new packages, the dependencies must:

- be licensed via Apache2 license
- be approved by core Teleport contributors ahead of time
- a dependency package must be vendored as a [Go module](https://blog.golang.org/using-go-modules)
- a dependency package must be a [Go module](https://blog.golang.org/using-go-modules)
33 changes: 3 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ test: test-sh test-api test-go
test-go: ensure-webassets bpf-bytecode roletester rdpclient $(RENDER_TESTS)
test-go: FLAGS ?= '-race'
test-go: PACKAGES := $(shell go list ./... | grep -v integration)
test-go: CHAOS_FOLDERS := $(shell find . -type f -name '*chaos*.go' -not -path '*/vendor/*' | xargs dirname | uniq)
test-go: CHAOS_FOLDERS := $(shell find . -type f -name '*chaos*.go' | xargs dirname | uniq)
test-go: $(VERSRC)
$(CGOFLAG) go test -cover -json -tags "$(PAM_TAG) $(FIPS_TAG) $(BPF_TAG) $(ROLETESTER_TAG) $(RDPCLIENT_TAG)" $(PACKAGES) $(FLAGS) $(ADDFLAGS) \
| ${RENDER_TESTS}
Expand Down Expand Up @@ -560,7 +560,7 @@ lint-api:
.PHONY: lint-sh
lint-sh: SH_LINT_FLAGS ?=
lint-sh:
find . -type f -name '*.sh' | grep -v vendor | xargs \
find . -type f -name '*.sh' | xargs \
shellcheck \
--exclude=SC2086 \
$(SH_LINT_FLAGS)
Expand Down Expand Up @@ -620,7 +620,6 @@ ADDLICENSE_ARGS := -c 'Gravitational, Inc' -l apache \
-ignore 'e/**' \
-ignore 'gitref.go' \
-ignore 'lib/web/build/**' \
-ignore 'vendor/**' \
-ignore 'version.go' \
-ignore 'webassets/**' \
-ignore 'ignoreme' \
Expand Down Expand Up @@ -661,7 +660,6 @@ $(VERSRC): Makefile
.PHONY: update-api-module-path
update-api-module-path:
go run build.assets/update_api_module_path/main.go -tags "bpf fips pam roletester desktop_access_rdp"
$(MAKE) update-vendor
$(MAKE) grpc

# make tag - prints a tag to use with git for the current version
Expand Down Expand Up @@ -711,7 +709,7 @@ profile:

.PHONY: sloccount
sloccount:
find . -path ./vendor -prune -o -name "*.go" -print0 | xargs -0 wc -l
find . -o -name "*.go" -print0 | xargs -0 wc -l

.PHONY: remove-temp-files
remove-temp-files:
Expand Down Expand Up @@ -942,31 +940,6 @@ init-submodules-e: init-webapps-submodules-e
git submodule init e
git submodule update

# Update go.mod and vendor files.
.PHONY: update-vendor
update-vendor:
# update modules in api/
cd api && go mod tidy
# update modules in root directory
go mod tidy
go mod vendor
$(MAKE) vendor-api

# When teleport vendors its dependencies, Go also vendors the local api sub module. To get
# around this issue, we replace the vendored api package with a symlink to the
# local module. The symlink should be in vendor/.../api or vendor/.../api/vX if X >= 2.
.PHONY: vendor-api
vendor-api: API_VENDOR_PATH := vendor/$(shell head -1 api/go.mod | awk '{print $$2;}')
vendor-api:
rm -rf vendor/github.com/gravitational/teleport/api
mkdir -p $(shell dirname $(API_VENDOR_PATH))
# make a relative link to the true api dir (without using `ln -r` for non-linux OS compatibility)
if [ -d $(shell dirname $(API_VENDOR_PATH))/../../../../../api/ ]; then \
ln -s ../../../../../api $(API_VENDOR_PATH); \
else \
ln -s ../../../../api $(API_VENDOR_PATH); \
fi;

# update-webassets updates the minified code in the webassets repo using the latest webapps
# repo and creates a PR in the teleport repo to update webassets submodule.
.PHONY: update-webassets
Expand Down
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

## Introduction

Teleport is the easiest, most secure way to access all your infrastructure.
Teleport is the easiest, most secure way to access all your infrastructure.
Teleport is an identity-aware, multi-protocol access proxy which understands
SSH, HTTPS, RDP, Kubernetes API, MySQL, MongoDB and PostgreSQL wire protocols.

Expand Down Expand Up @@ -209,43 +209,27 @@ Latest version:
go get github.com/new/dependency
```

Update the source to use this dependency, then run:
and update the source to use this dependency.

```bash
make update-vendor
```

Specific version:

```bash
go get github.com/new/dependency@version
```

Update the source to use this dependency, then run:

```bash
make update-vendor
```
To get a specific version, use `go get github.com/new/dependency@version` instead.

#### Set dependency to a specific version

```bash
go get github.com/new/dependency@version
make update-vendor
```

#### Update dependency to the latest version

```bash
go get -u github.com/new/dependency
make update-vendor
```

#### Update all dependencies

```bash
go get -u all
make update-vendor
```

#### Debugging dependencies
Expand Down Expand Up @@ -297,5 +281,5 @@ You can find the latest stable Teleport build on our [Releases](https://gotelepo
## Who Built Teleport?

Teleport was created by [Gravitational Inc](https://goteleport.com). We have
built Teleport by borrowing from our previous experiences at Rackspace. [Learn more
built Teleport by borrowing from our previous experiences at Rackspace. [Learn more
about Teleport and our history](https://goteleport.com/about/).
4 changes: 1 addition & 3 deletions build.assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ RUN (git clone https://github.com/gogo/protobuf.git ${GOPATH}/src/github.com/gog
git reset --hard ${GOGO_PROTO_TAG} && \
make install)

# Note: protoc reads the proto files from /vendor/.../teleport/api/vX rather than
# /api because protoc does not understand go modules, and reads vX as a directory.
ENV PROTO_INCLUDE "/usr/local/include":"/go/src/github.com/gravitational/teleport/vendor":"/go/src/github.com/gogo/protobuf/protobuf":"${GOGOPROTO_ROOT}":"${GOGOPROTO_ROOT}/protobuf"
ENV PROTO_INCLUDE "/usr/local/include":"/go/src":"/go/src/github.com/gogo/protobuf/protobuf":"${GOGOPROTO_ROOT}":"${GOGOPROTO_ROOT}/protobuf"

# Install PAM module and policies for testing.
COPY pam/ /opt/pam_teleport/
Expand Down
4 changes: 1 addition & 3 deletions build.assets/Dockerfile-devbox
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ RUN (git clone https://github.com/gogo/protobuf.git ${GOPATH}/src/github.com/gog
git reset --hard ${GOGO_PROTO_TAG} && \
make install)

# Note: protoc reads the proto files from /vendor/.../teleport/api/vX rather than
# /api because protoc does not understand go modules, and reads vX as a directory.
ENV PROTO_INCLUDE "/usr/local/include":"/go/src/github.com/gravitational/teleport/vendor":"/go/src/github.com/gogo/protobuf/protobuf":"${GOGOPROTO_ROOT}":"${GOGOPROTO_ROOT}/protobuf"
ENV PROTO_INCLUDE "/usr/local/include":"/go/src":"/go/src/github.com/gogo/protobuf/protobuf":"${GOGOPROTO_ROOT}":"${GOGOPROTO_ROOT}/protobuf"

USER root
VOLUME ["/go/src/github.com/gravitational/teleport"]
4 changes: 2 additions & 2 deletions docs/preflight.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This checklist is to be run prior to cutting the release branch.

- [ ] Bump Golang vendor dependencies
- [ ] Bump Golang dependencies
- [ ] Review forked dependencies for upstream security patches
- [ ] Bump Web UI vendor dependencies
- [ ] Bump Web UI dependencies
- [ ] Make a new docs/VERSION folder
- [ ] Update VERSION in Makefile to next dev tag
- [ ] Update TELEPORT_VERSION in assets/aws/Makefile
Expand Down
11 changes: 0 additions & 11 deletions vendor/cloud.google.com/go/.gitignore

This file was deleted.

Loading

0 comments on commit d0eb861

Please sign in to comment.