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

Bump the go directive to 1.16 #3578

Merged
merged 2 commits into from
Apr 28, 2021
Merged

Bump the go directive to 1.16 #3578

merged 2 commits into from
Apr 28, 2021

Conversation

jeffwidman
Copy link
Member

@jeffwidman jeffwidman commented Apr 28, 2021

This isn't strictly required, but it makes life simpler in some edge
cases... and also later someone is considering updating, it's easier if
this has been kept up to date all along so the delta is smaller down the
road. I ran go mod tidy and it didn't update the go.sum file here
(sometimes it does when you bump this directive).

Note: This depends on #3576, as that reduced the number of go.mod files that needed this update.
If that is rejected, then this change should be applied to the other go.mod files that weren't removed.

Since `go.mod` in the root of helpers declares itself as:
```
module github.com/dependabot/dependabot-core/go_modules/helpers
```

then my understanding is there's no need to have custom replace
directives... `go` is smart enough to realize that these are local pkgs
and should be imported locally.

As a result, we also no longer need a custom `go.mod` file within the
subpackage.

Which makes life easier as this subpackage declared an older version of
the extracted go modules repo... which works, but can be confusing since
there are two `go.mod` files with slightly different minimum supported
versions. Avoid all that by treating this as a package of the parent
modules rather than a standalone module.
This isn't strictly required, but it makes life simpler in some edge
cases... and also later someone is considering updating, it's easier if
this has been kept up to date all along so the delta is smaller down the
road.
@jeffwidman jeffwidman requested a review from a team as a code owner April 28, 2021 07:42
Copy link
Contributor

@thepwagner thepwagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 can you expand on the affected edge cases for posterity?

As the go directive refers to the minimum-go-version, it's tempting to leave as-is (the helpers code base is theoretically compatible with go1.13, right?).

But we only compile and test with go1.16 - I like the idea of aligning the directive with what we're testing to prevent regressions!

@thepwagner thepwagner self-assigned this Apr 28, 2021
@thepwagner thepwagner merged commit cd9fb41 into dependabot:main Apr 28, 2021
@jeffwidman
Copy link
Member Author

@thepwagner so I'm actually ignorant of the specific edge cases, but when I was investigating some other stuff, I've seen comments from bcmills and others saying that in every version of go they've fixed bugs in how go mod tidy works, so the behavior on some edge cases is very version-specific.

That was enough for me and I didn't dig further, because IMO if you've got CI already running at go 1.16 then even though technically the helpers code bases is compatible with older go versions, this short-circuits risks of users reporting bugs that are specific to older versions of go (which you wouldn't realize until you've spent a lot of time investigating).

Additionally, as I mentioned, this makes it simpler when you later upgrade to some newer go version where you absolutely have to bump because you only have to check the delta between 1.16 behavior and the newer behavior, not from 1.13 onwards. Small thing, but I've found things like that cut down on maintenance time in other projects I maintain.

Anyway, sorry it's not a smoking gun, but esp the edge cases idea left me saying "I think it's simpler/less time going forward to keep this in lock step with CI for now".

@jeffwidman jeffwidman deleted the bump-go-mod-to-116-directive branch April 28, 2021 17:08
@thepwagner thepwagner mentioned this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants