-
Notifications
You must be signed in to change notification settings - Fork 114
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/build pipeline: Move go mod tidy
after cd
to modroot
dir AND Validate existence of go.mod
in modroot
#1716
base: main
Are you sure you want to change the base?
Conversation
…le exiest in modroot dir to ensure modroot is set correctly Previously if in a go/build pipeline we set both modroot and tidy=true, go mod tidy command was running in the home dir instead of running into the modroot dir Checking the go.mod exist inside modroot make sure we set the modroot correctly, thish will help with the go/bump automation Signed-off-by: Debasish Biswas <[email protected]>
go mod tidy
after cd
to modroot
dir AND Validate existence of go.mod
in modroot
go mod tidy
after cd
to modroot
dir AND Validate existence of go.mod
in modroot
Signed-off-by: Debasish Biswas <[email protected]>
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.
I cannot see the need for these changes, if go mod is not found go mod tidy
or go/bump
will fail anyway.
The default error is also pretty descriptive today telling us that there is not a go.mod file on the specified location. |
@hectorj2f You're correct that Since See the fix here, where previously, an incorrectly set modroot didn’t cause any build failure. Slack conversation link |
I believe this change is needed! It enforces correct setup of the But I'm concern about how breaking of a change this could be at the outset. @debasishbsws have you looked at which of our packages this might break the build for? This could be a disruptive change that brings our build system to a halt, if we're not careful. |
👍🏻 |
@luhring I was thinking of identifying packages this might break but that need looking into the source code or try to build all the go package which use go/build pipeline. But I don't think this could be very disruptive. As we don't build every package every day. We will encounter this build failure with clear message in the package updates or CVE rem PR. And at that time we have to look and try to fix the package. |
Right, I think once this causes a build to fail, we can put the time into to fix it once and for all. And then things will be awesome for that package. But for me at least, I don't have a good sense of the total time that will require, and how soon we'll need to invest it. For example, if it's just an occasional extra 5 minutes, a few times a week for the next few months, then I agree that's not too bad. But if it starts block all our CVE fixes and requires dozens of hours a day from multiple staff members for the foreseeable future, that would be terrible, of course. So my thinking is that we don't know where on that spectrum this would fall. Does that make sense? Do you have a better sense than I do about how this will play out for us if we merge this today? |
fix: Move
go mod tidy
aftercd
tomodroot
dirgo/build
pipeline, ifmodroot
was set andtidy=true
, thego mod tidy
command ran in the home directory instead of themodroot
directory.feat: Validate existence of
go.mod
inmodroot
go.mod
exists in themodroot
directory, ensuringmodroot
is set correctly. This will help the reliability ofgo/bump
automation as it also set its modroot by looking into thego/build
pipeline modroot.