github / github/codeql

Go autobuild tries to download module dependencies twice

Open
#11,991 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

**Description of the issue**

I noticed [in my Go project](https://github.com/CrunchyData/postgres-operator/actions/runs/3999162447/jobs/6862717663) that autobuild successfully downloads Go modules then reports `Dependencies are still not resolving after the build`.

```

2023/01/24 18:14:22 Found go.mod, enabling go modules
go: downloading k8s.io/api v0.24.2
go: downloading k8s.io/apimachinery v0.24.2
go: downloading k8s.io/client-go v0.24.2

2023/01/24 18:14:32 Import path is 'github.com/CrunchyData/postgres-operator'
2023/01/24 18:14:32 Makefile found.
2023/01/24 18:14:32 Trying build command make []

2023/01/24 18:14:33 Dependencies are still not resolving after the build, continuing to install dependencies.
2023/01/24 18:14:33 Installing dependencies using `go get -v ./...`.
2023/01/24 18:14:35 Running extractor command…

```

🤔 `go mod tidy` downloads dependencies, so I don't expect `go get` needs to be called.

🤔 Is the following code correct? It seems to print `error` exactly when `.DepsErrors` is empty.
https://github.com/github/codeql/blob/07a7a213b3bf02a3408683c18d63b8be0f0474f9/go/extractor/util/util.go#L170-L180

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.