dependabot / dependabot/dependabot-core

Go mod update fails too early

Open
#10,656 0 comments 0 reactions 0 assignees View on GitHub
L: docker L: go:modules T: bug 🐞
Dominant language
Ruby
Stars
5.8k
Forks
1.5k
Avg merge
2d 18h
Merged PRs (30d)
149

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Package ecosystem

Go mod

### Package manager version

_No response_

### Language version

Go 1.23.0

### Manifest location and content before the Dependabot update

`go.mod`

### dependabot.yml content

```
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
```

### Updated dependency

Module `sigs.k8s.io/cluster-api-provider-azure` cannot be updated because the `main.go` file in the root imports version `2.8.0` of `github.com/Azure/azure-service-operator`, and it references a package which was deprecated.

See issue https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/5141

### What you expected to see, versus what you actually saw

I expected Dependabot to ignore the broken import, since it is not consequential to the other packages which have newer versions available

Instead I received a fatal error:
```
Dependabot can't resolve your Go dependency files
Dependabot failed to update your dependencies because there was an error resolving your Go dependency files.

Dependabot encountered the following error:
[...]
go: sigs.k8s.io/cluster-api-provider-azure imports
github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230202preview: cannot find module providing package github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230202preview
[...]
```

### Native package manager behavior

Bumping the version manually in `go.mod` to
```
sigs.k8s.io/cluster-api-provider-azure v1.17.0
```
and then running `go mod tidy` works as expected

### Images of the diff or a link to the PR, issue, or logs

_No response_

### Smallest manifest that reproduces the issue

```
go 1.23

require (
github.com/Azure/azure-service-operator/v2 v2.9.0
sigs.k8s.io/cluster-api-provider-azure v1.16.0
)
```

Contributor guide

Open the contributing guide

Research direction

Start with the smallest manifest in the issue and reproduce the Go module resolution failure using Go 1.23. Compare Dependabot's result with manually setting sigs.k8s.io/cluster-api-provider-azure to v1.17.0 and running go mod tidy. Done means the broken import no longer prevents unrelated available dependency updates, while the reported dependency is handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.