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

go.mod: Support updating non-release git dependencies #2028

Open
alex opened this issue Feb 14, 2020 · 9 comments
Open

go.mod: Support updating non-release git dependencies #2028

alex opened this issue Feb 14, 2020 · 9 comments
Labels
L: go:modules Golang modules T: feature-request Requests for new features

Comments

@alex
Copy link

alex commented Feb 14, 2020

Empirically, dependabot only seems to send PRs to update dependencies that have tags in git. I've also got a bunch of dependencies that point at git repos, and I'd like PRs updating them as well! In other languages, git based dependencies appear to get updated.

@infin8x infin8x transferred this issue from dependabot/feedback Jun 29, 2020
@jurre jurre added L: go:modules Golang modules T: feature-request Requests for new features labels Feb 25, 2021
@jurre
Copy link
Member

jurre commented Feb 25, 2021

Just to clarify, are you referring to updating libraries that aren't go-modules compatible yet?

@alex
Copy link
Author

alex commented Feb 25, 2021

No, I'm refering to dependencies that are go-modules, but which don't have tags, so you're pinned to specific commits. https://github.com/araddon/dateparse is an example of such a dependency.

@jurre
Copy link
Member

jurre commented Feb 25, 2021

Ah I see, thanks for clarifying! Yeah it'd be good to support that, but I don't think that we'll be able to get to this soon tbh.

Note for future self: Might be enough to patch

func GetUpdatedVersion(args *Args) (interface{}, error) {
to find the right commit to point to? Might not make sense to do that in the native helper, and instead we can special-case it and reuse https://github.com/dependabot/dependabot-core/blob/ce711fc43dd8c5ed3e978366780498ee5d1f1bc4/common/lib/dependabot/git_commit_checker.rb?

@FelisiaM
Copy link

FelisiaM commented Apr 13, 2021

Is there any update as to if/when this might be available?

I have a similar scenario and it would be really useful to have Dependabot create the PRs.

@jeffwidman
Copy link
Member

Some more code notes:
The underlying code to find the latest version now uses go list:

versions_json = SharedHelpers.run_shell_command("go list -m -versions -json #{dependency.name}", env: env)

Will need to see if that can be tweaked/augmented to support finding commits. We could probably use something like go install some_module@latest, but that might be too slow...

@abdulapopoola abdulapopoola added the F: private-registries 💂‍♂️ Issues about using private registries with Dependabot; may be paired with an R: label. label Mar 31, 2023
@pierrre
Copy link

pierrre commented Apr 26, 2023

#3017 (comment)
Is this supported now ?
Is there something to add in my config ?
I'm trying to update golang.org/x/exp automatically, but it's not working (this repo doesn't use tags)
Other Go modules are updated automatically if they have tags.

@jeffwidman jeffwidman removed the F: private-registries 💂‍♂️ Issues about using private registries with Dependabot; may be paired with an R: label. label Apr 26, 2023
@ChrisHines
Copy link

We would like to track pseudo-versions for an internal project that doesn't tag our own code, just as mentioned here: #3017 (comment).

I've found that adding the -u flag to the go list command will provide the newest pseudo-version for modules that don't use tags, in the same way that go get module@latest would:

go list -m -u -versions -json #{dependency.name}

For the golang.org/x/exp module mentioned in the above comment it currently produces for me:

$ go list -m -u -versions -json golang.org/x/exp
{
        "Path": "golang.org/x/exp",
        "Version": "v0.0.0-20230522175609-2e198f4a06a1",
        "Time": "2023-05-22T17:56:09Z",
        "Update": {
                "Path": "golang.org/x/exp",
                "Version": "v0.0.0-20230817173708-d852ddb80c63",
                "Time": "2023-08-17T17:37:08Z"
        },
        "Indirect": true,
        "Dir": "/go/pkg/mod/golang.org/x/[email protected]",
        "GoMod": "/go/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230522175609-2e198f4a06a1.mod",
        "GoVersion": "1.20"
}

The command dependabot currently uses will only show the current version for a module like this.

$ go list -m -versions -json golang.org/x/exp
{
        "Path": "golang.org/x/exp",
        "Version": "v0.0.0-20230522175609-2e198f4a06a1",
        "Time": "2023-05-22T17:56:09Z",
        "Indirect": true,
        "Dir": "/go/pkg/mod/golang.org/x/[email protected]",
        "GoMod": "/go/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230522175609-2e198f4a06a1.mod",
        "GoVersion": "1.20"
}

For modules that do use tags adding the -u flag command includes all the same information as before, but adds the Update field to the results.

$ go list -m -u -versions -json github.com/json-iterator/go
{
        "Path": "github.com/json-iterator/go",
        "Version": "v1.1.8",
        "Versions": [
                "v1.1.5",
                "v1.1.6",
                "v1.1.7",
                "v1.1.8",
                "v1.1.9",
                "v1.1.10",
                "v1.1.11",
                "v1.1.12"
        ],
        "Time": "2019-10-12T13:07:04Z",
        "Update": {
                "Path": "github.com/json-iterator/go",
                "Version": "v1.1.12",
                "Time": "2021-09-11T02:17:26Z"
        },
        "Indirect": true
}

I don't know the internals of dependabot and I don't know Ruby well enough to make a code contribution here, but I am hopeful that the above information could guide one of the maintainers toward satisfying this feature request. @jeffwidman Are you still involved enough to help out here?

@kostyay
Copy link

kostyay commented Dec 12, 2023

Are there any updates on this issue?
Without supporting pseudo versions dependabot is useless to us.

@arununzer
Copy link

Are there any updates on this as dependabot is unable to update the action-runner version to : v2.318.0-ubuntu-22.04 from v2.317.0-ubuntu-22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: go:modules Golang modules T: feature-request Requests for new features
Projects
None yet
Development

No branches or pull requests

10 participants