Skip to content

Commit

Permalink
support/db: upgrade github.com/go-sql-driver/mysql from 2e00b5cd7039 …
Browse files Browse the repository at this point in the history
…to v1.4.0 (#1652)

Upgrade dependency `github.com/go-sql-driver/mysql` from `2e00b5cd7039` (Dec
24, 2016), which is a couple commits after `v1.3.0`, to `v1.4.0` (Jun 3rd,
2018).

This is part of making the transition to Modules (#1634).

The `mysql` module is used directly by this repositories `support/db`
package. The `mysql` module is also used indirectly via the
`github.com/jmoiron/sqlx` module which we have pinned to `v1.2.0`. We
use the `sqlx` package in `services/ticker`, `services/horizon` and
`support/db`. The `sqlx` package's tests have a dependency on `mysql`
`v1.4.0` and even though it is only their tests, Modules carries that
minimum requirement to our project, even though we are not dependent on
the tests.

```
                 +-----------------------------+
                 | +------+      +-----------+ |
      +----------->+ sqlx +<-----+ sqlx.test | |
      |   v1.2.0 | +------+      +-----------+ |
      |          +-----------------------------+
+-----+------+                         |
| stellar/go |                         |
+-----+------+                         |
      |                                |
      |            +-------+           |
      +----------->+ mysql +<----------+
                   +-------+ v1.4.0
```

This isn't ideal for us because we don't particularly care about
dependencies of our dependencies tests, but the perspective of the Go
team has been that a dependencies test dependencies are a signal to
compatability of the module in general. e.g. If the sqlx devs say that
to test sqlx they need at least mysql v1.4.0, there's a good chance sqlx
is only compatible with v1.4.0+.

I considered two approaches to resolve this.
1. Upgrade `mysql` to `v1.4.0`, which is this change.
2. Downgrade `sqlx` two commits to drop it's `go.mod` file. The last two
commits on the version we have are only the addition of a `go.mod` file.
Without it we can pin the version of `mysql` that we have today. This
isn't a good long term plan though, as sooner or later we're going to
need to be bumped.

I've gone with this change because it better embraces the best practices
from the perspective of the core Go developers and it will probably
cause us less problems long term. The diff in the mysql dependency is 69
commits, 38 changed files, 4,928 additions, 797 deletions, 12 new
features, 12 bug fixes, and numerous other changes. It's not
insignificant and is probably not possible for one of us to review and
be able to meaningful identify if upgrading would be harmful. The best
thing we can do is rely on our tests here.
  • Loading branch information
leighmcculloch authored Aug 27, 2019
1 parent d6ce089 commit e39f70c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e39f70c

Please sign in to comment.