-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Prune matching replace directives in staging repos more effectively #77753
Conversation
/approve good to see that the unnecessary |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
As more of our dependencies add go.mod files, it exposed a gap in the part of update-vendor.sh that prunes replace directives from staging go.mod files.
As a reminder:
#77370 exposed a gap in the way we detected the naturally preferred version was the same as our pinned version.
go mod tidy
will completely drop require directives for transitive dependencies we don't actually use any packages from. After those require directives are dropped,go list -m -json all
will report the version of those transitive dependencies our direct dependencies prefer (even though it doesn't really matter for purposes of the build, since we're not using any packages from that dependency).Moving the pruning step before
go mod tidy
allows us to drop unneeded replace directives for these unused transitive dependencies correctly.Does this PR introduce a user-facing change?:
/cc @dims @apelisse