Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

test with go1.15, use go modules #450

Merged
merged 3 commits into from Feb 18, 2021
Merged

test with go1.15, use go modules #450

merged 3 commits into from Feb 18, 2021

Conversation

amonks
Copy link
Contributor

@amonks amonks commented Feb 16, 2021

Some issue creators noted that we only test thunder in go 1.10. Since we use go 1.15
in production, this seems unwise. This commit sets the go version to 1.15. It
also makes a change to use go modules rather than the vendor folder. I don't
think we can make one change without the other, but I know very little about go
modules and I'd love to be mistaken.

XXX: I know our setup is a bit weird, and I'm a bit concerned that we'll have
to make changes to internal repos next time we revendor thunder. Maybe we can
add it as a module? That would be neat. I'm inclined to merge this change, then
figure that out.


commands:

go mod init     // This signaled an error wrt. an "appengine" thing in vendor.json
                // I made the changes below to vendor.json, then tried again.
go mod vendor
rm -rf vendor

vendor.json:

"ignore": "appengine appenginevm test",         // I removed appengine and appenginevm.
"package": [
	{                                       // I removed this whole package entry.
		"path": "appengine/cloudsql",
		"revision": ""
	},

There are also two commits that fix small build/test errors present when
running with go1.15.

@coveralls
Copy link

coveralls commented Feb 16, 2021

Pull Request Test Coverage Report for Build 3353

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 65.955%

Files with Coverage Reduction New Missed Lines %
graphql/schemabuilder/input.go 8 60.4%
Totals Coverage Status
Change from base Build 3338: -0.03%
Covered Lines: 5932
Relevant Lines: 8994

💛 - Coveralls

As of go 1.11, sql _does_ return context errors in this case, so this test no
longer provides value.

golang/go@16f32a0
In previous go versions, `string(1)` happily produced the rune, "\x01". Now, it
produces this compiler warning:

    [stringintconv] [W] conversion from untyped int to string yields a string of
    one rune, not a string of digits (did you mean fmt.Sprint(x)?)

I updated this test data to use strings closer to what one might expect, ("1"
rather than "\x01").
Some issue creators noted that we only thunder in go 1.10. Since we use go 1.15
in production, this seems unwise. This commit sets the go version to 1.15. It
also makes a change to use go modules rather than the vendor folder. I don't
think we can make one change without the other, but I know very little about go
modules and I'd love to be mistaken.

XXX: I know our setup is a bit weird, and I'm a bit concerned that we'll have
to make changes to internal repos next time we revendor thunder. Maybe we can
add it as a module? That would be neat. I'm inclined to merge this change, then
figure that out.

**********************************************************************************

commands:
```bash
go mod init     // This signaled an error wrt. an "appengine" thing in vendor.json
                // I made the changes below to vendor.json, then tried again.
go mod vendor
rm -rf vendor
```

vendor.json:
```
"ignore": "appengine appenginevm test",         // I removed appengine and appenginevm.
"package": [
	{                                       // I removed this whole package entry.
		"path": "appengine/cloudsql",
		"revision": ""
	},
```
@amonks amonks changed the title .travis.yml: use go 1.15 in thunder CI test with go1.15, use go modules Feb 16, 2021
@amonks
Copy link
Contributor Author

amonks commented Feb 16, 2021

@denbeigh2000

Pinging you as resident go-modules knower, particularly w.r.t the note under XXX in the PR description.

@amonks amonks marked this pull request as ready for review February 16, 2021 06:10
@amonks
Copy link
Contributor Author

amonks commented Feb 16, 2021

@CodeBrew28

Pinging you as thunder maintainer apparent. I think testing in 1.15 should be uncontroversial, and the test changes should be uncontroversial, but I don't know what to make of the go modules change. See the note under XXX in the PR description.

@denbeigh2000
Copy link

We shouldn't have to do anything special with Thunder for internal use, we should be able to make use of the package regardless of whether it is module-ised (modularised?) or not. The core code hasn't changed, and currently performs fine with all our vendored dependencies, so I don't think upgrading would be a headache.


Removing the strange appengine vendoring LGTM. It seems this dependency was only present for the mysql driver:

$ rg 'appengine|cloudsql'
vendor/vendor.json
3:	"ignore": "appengine appenginevm test",
6:			"path": "appengine/cloudsql",

vendor/github.com/davecgh/go-spew/spew/bypass.go
19:// +build !js,!appengine,!safe,!disableunsafe

vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
19:// +build js appengine safe disableunsafe

vendor/github.com/go-sql-driver/mysql/appengine.go
9:// +build appengine
14:	"appengine/cloudsql"
18:	RegisterDial("cloudsql", cloudsql.Dial)

vendor/github.com/go-sql-driver/mysql/README.md
387:user@cloudsql(project-id:instance-name)/dbname
392:user@cloudsql(project-id:regionname:instance-name)/dbname

vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
29:// +build purego appengine js

vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
32:// +build purego appengine js

vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
29:// +build !purego,!appengine,!js

vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
32:// +build !purego,!appengine,!js

This was dependency removed in go-sql-driver/mysql#1007, and was apparently only needed for Go <=1.9, so this should be totally fine to remove.

Copy link

@denbeigh2000 denbeigh2000 left a comment

Choose a reason for hiding this comment

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

I approve this message

@amonks amonks merged commit 4bdd318 into master Feb 18, 2021
@amonks amonks deleted the amonks/1.15-ci branch February 18, 2021 00:53
@amonks amonks mentioned this pull request Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants