-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[gomod] Support updating indirect dependencies #6361
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mctofu
force-pushed
the
mctofu/go-transitive-security-updates
branch
from
December 23, 2022 22:37
3f7b8c8
to
3727e08
Compare
mctofu
changed the title
Mctofu/go transitive security updates
[gomod] Support updating indirect dependencies
Dec 23, 2022
jakecoffman
approved these changes
Jan 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me!
We previously prevented updating replaced dependencies by treating them as indirect dependencies which we didn't support updating. Now that indirect updates are supported we still don't want to update replaced dependencies till we can properly support them.
mctofu
force-pushed
the
mctofu/go-transitive-security-updates
branch
from
January 4, 2023 19:56
bdb3ae3
to
cddd02a
Compare
This was referenced Jan 4, 2023
👍 Thanks for clarifying this, it was my one question after looking at the PR. |
1 task
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an improved take on an earlier spike I did to support updating indirect dependencies in a security update. This allows updating indirect dependencies that are listed in the
go.mod
file in either version or security updates. Dependencies that are only included in thego.sum
and not thego.mod
still can't be updated but using the go 1.17+go.mod
file any used indirect dependencies should be contained in thego.mod
.For version updates, the default allow filter is to only update direct dependencies so indirect dependencies will only be updated if a user configures their
dependabot.yml
to do so.A benefit over my previous attempt is that this approach maintains the indirect dependency distinction so using the https://github.com/dependabot/fetch-metadata to inspect the commit metadata for the PR will correctly indicate an indirect dependency is being updated.
Another edge case I ran into with bdb3ae3 is that we previously parsed "replaced" dependencies but removed their requirements. That caused us to treat them as indirect dependencies and not attempt to update them. I've preserved the behavior of not updating replaced dependencies (until we can implement a way to properly update them) by skipping them during the file parsing step.
The go smoke test is currently failing but that's expected. It needs to be updated to: