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

Filter out ignored dependencies before fetching #1959

Closed
disposedtrolley opened this issue Jun 19, 2020 · 7 comments
Closed

Filter out ignored dependencies before fetching #1959

disposedtrolley opened this issue Jun 19, 2020 · 7 comments
Labels
core 🍏 Relates to the dependabot-core library itself L: go:modules Golang modules T: feature-request Requests for new features

Comments

@disposedtrolley
Copy link

Package manage/ecosystem
gomod
Manifest contents prior to update
N/A
Updated dependency
N/A
What you expected to see, versus what you actually saw
Attempting to ignore private Go modules using a wildcard name, e.g.

ignore:
      - dependency-name: "*github.com/myorg*"

still results in an error when Dependabot attempts to fetch the entire dependency list -- Dependabot can't resolve your Go dependency files.

The docs note that GitHub Dependabot checks for all allowed dependencies and then filters out any ignored dependencies or versions. which explains why the fetching fails when it hits a private dependency midway through.

Would it make sense to filter out ignored dependencies prior to performing the fetch?

Images of the diff or a link to the PR, issue or logs
N/A

@feelepxyz
Copy link
Contributor

Would it make sense to filter out ignored dependencies prior to performing the fetch?

Unfortunately not with the way it works currently. Dependabot will exclude the ignored dependency when checking for new versions but as soon as it attempts to update any other dependency it will try to resolve all dependencies in your manifest/lockfile. This is usually done by the package manager and we don't have much control over it. We have some ideas to improve this by stubbing out packages but going to be a while before we can look at this.

We're working on adding private git repository support over the next few months. For now, I would recommend you keep using Dependabot Preview which does support private git repos if you add these to the app installation. You can install the Preview app from here: https://app.dependabot.com/ and configure it using a config file: https://dependabot.com/docs/config-file/

@disposedtrolley
Copy link
Author

Thanks for the clarification @feelepxyz!

That makes sense; fetching new dependencies would be delegated to the package manager so there would be no easy method of ignoring them from the get-go.

With Go Modules, there's an option to set a GOPROXY environment variable to point go mod to a private modules source, such as Artifactory. Would something like this be included in the private git repository support?

@feelepxyz
Copy link
Contributor

With Go Modules, there's an option to set a GOPROXY environment variable to point go mod to a private modules source, such as Artifactory. Would something like this be included in the private git repository support?

Yep, we're looking at adding support for environment variables.

@infin8x infin8x transferred this issue from dependabot/feedback Jun 29, 2020
@lseppala lseppala added L: go:modules Golang modules T: feature-request Requests for new features core 🍏 Relates to the dependabot-core library itself labels Dec 8, 2021
@jeffwidman
Copy link
Member

Support for private registries was added a bit ago: https://github.blog/2021-03-15-dependabot-private-dependencies/

So I'm closing this, as it looks like the root cause for why the OP needed to filter out ignored dependencies is resolved.

@Okeanos
Copy link

Okeanos commented Aug 25, 2022

Please re-open this issue. Just because a workaround exists for some use cases doesn't mean this is actually solved. In particular please check my comment in #1884 . Having Dependabot fetch ignored dependencies before discarding them causes it to fail without being able to recover reproducibly and unnecessarily.

@owenhaynes
Copy link

@jeffwidman Do you have docs anywhere on how to set GOPROXY, as private registries say they are supported but no docs about limitations etc.
image

As things like Jfrog Artifactory, Artefact registry etc need GOPROXY setting to work.

@jeffwidman
Copy link
Member

jeffwidman commented Jan 25, 2023

@owenhaynes please file a new issue, this is related to filtering ignored deps, not GOPROXY.

Speaking of filtering ignored deps before fetch, I looked at this a little more, and I think this isn't something we will do anytime for the forseeable future.

As @feelepxyz said above:

Dependabot will exclude the ignored dependency when checking for new versions but as soon as it attempts to update any other dependency it will try to resolve all dependencies in your manifest/lockfile. This is usually done by the package manager and we don't have much control over it. We have some ideas to improve this by stubbing out packages but going to be a while before we can look at this.

I don't think we'll very likely to go the route of stubbing out packages. We'd rather move Dependabot toward being the glue code between the native package manager and your repo, where Dependabot handles the cron, wiring up the native package manager, and then opening the PR. But move away from "re-implementation of native package manager behavior in Ruby, but poorly"... So I just don't see us doing pre-filtering in a way that doesn't force us to be pretty invasive in the native package manager... post-filtering is much easier.

I realize that means some deps will continue to break things, and I wish there were a better answer. Some package managers allow substitution or replacing deps within their manifest files, so it is something that can be supported at the package manager level. And if your preferred package manager doesn't support it, you can always file an upstream issue request / PR.

@jeffwidman jeffwidman closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core 🍏 Relates to the dependabot-core library itself L: go:modules Golang modules T: feature-request Requests for new features
Projects
None yet
Development

No branches or pull requests

6 participants