Skip to content

Commit

Permalink
Update Bazel + assorted deps (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Sprague <brandon@sprague.mx>
  • Loading branch information
bcspragu authored Jul 19, 2023
1 parent 3798851 commit 599a714
Show file tree
Hide file tree
Showing 10 changed files with 638 additions and 530 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.0
6.2.1
21 changes: 11 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,45 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Start of Go + Gazelle + gRPC
http_archive(
name = "io_bazel_rules_go",
sha256 = "ae013bf35bd23234d1dea46b079f1e05ba74ac0321423830119d3e787ec73483",
sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.36.0/rules_go-v0.36.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "448e37e0dbf61d6fa8f00aaa12d191745e14f07c31cabfa731f0c8e8a4f41b97",
sha256 = "29218f8e0cebe583643cbf93cae6f971be8a2484cdcfa1e45057658df8d54002",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.28.0/bazel-gazelle-v0.28.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.32.0/bazel-gazelle-v0.32.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.32.0/bazel-gazelle-v0.32.0.tar.gz",
],
)

http_archive(
name = "com_siliconally_rules_gqlgen",
sha256 = "3d29bdcd0cee2e0b7338576ce686ac2325659701713e3256e1ff7993a51cc412",
sha256 = "a009b4e21dee897fa4b66e17e9fef9e83be966ed888f112c209184930f3aa52b",
urls = [
"https://github.com/Silicon-Ally/rules_gqlgen/releases/download/v0.0.5/rules_gqlgen-v0.0.5.zip",
"https://github.com/Silicon-Ally/rules_gqlgen/releases/download/v0.0.8/rules_gqlgen-v0.0.8.zip",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@com_siliconally_rules_gqlgen//:deps.bzl", "gqlgen_dependencies")
load("//:deps.bzl", "go_dependencies")

go_register_toolchains(
nogo = "@//:nogo",
version = "1.19.3",
version = "1.20.6",
)

# gazelle:repository_macro deps.bzl%go_dependencies
go_dependencies()

gqlgen_dependencies()
go_rules_dependencies()

gazelle_dependencies()

http_archive(
Expand Down
2 changes: 1 addition & 1 deletion db/sqldb/golden/regen/humanreadableschema/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
importpath = "github.com/Silicon-Ally/silicon-starter/db/sqldb/golden/regen/humanreadableschema",
visibility = ["//visibility:private"],
deps = [
"@com_github_jackc_pgx_v4//:pgx",
"@com_github_jackc_pgx_v4//pgxpool",
"@com_github_silicon_ally_testpgx//:testpgx",
"@com_github_silicon_ally_testpgx//migrate",
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/Silicon-Ally/testpgx"
"github.com/Silicon-Ally/testpgx/migrate"
"github.com/bazelbuild/rules_go/go/tools/bazel"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
)

func main() {
Expand All @@ -34,8 +34,8 @@ func main() {
}
}()

env.WithMigratedDB(ctx, func(db *pgx.Conn) error {
result, err := env.DumpDatabaseSchema(ctx, db.Config().Config.Database, testpgx.WithHumanReadableSchema())
env.WithMigratedDB(ctx, func(db *pgxpool.Pool) error {
result, err := env.DumpDatabaseSchema(ctx, db.Config().ConnConfig.Database, testpgx.WithHumanReadableSchema())
if err != nil {
log.Fatalf("while dumping database schema: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion db/sqldb/golden/regen/schemadump/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go_library(
importpath = "github.com/Silicon-Ally/silicon-starter/db/sqldb/golden/regen/schemadump",
visibility = ["//visibility:private"],
deps = [
"@com_github_jackc_pgx_v4//:pgx",
"@com_github_jackc_pgx_v4//pgxpool",
"@com_github_silicon_ally_testpgx//:testpgx",
"@com_github_silicon_ally_testpgx//migrate",
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
Expand Down
6 changes: 3 additions & 3 deletions db/sqldb/golden/regen/schemadump/schemadump.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/Silicon-Ally/testpgx"
"github.com/Silicon-Ally/testpgx/migrate"
"github.com/bazelbuild/rules_go/go/tools/bazel"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
)

func main() {
Expand All @@ -34,8 +34,8 @@ func main() {
}
}()

env.WithMigratedDB(ctx, func(db *pgx.Conn) error {
result, err := env.DumpDatabaseSchema(ctx, db.Config().Config.Database)
env.WithMigratedDB(ctx, func(db *pgxpool.Pool) error {
result, err := env.DumpDatabaseSchema(ctx, db.Config().ConnConfig.Database)
if err != nil {
log.Fatalf("while dumping database schema: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions db/sqldb/migrations/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestRegeneratedHumanReadableSchema(t *testing.T) {
}
ctx := context.Background()
db := sqlEnv.GetMigratedDB(ctx, t)
got, err := sqlEnv.DumpDatabaseSchema(ctx, db.Config().Config.Database, testpgx.WithHumanReadableSchema())
got, err := sqlEnv.DumpDatabaseSchema(ctx, db.Config().ConnConfig.Database, testpgx.WithHumanReadableSchema())
if err != nil {
t.Fatalf("failed to dump database schema: %v", err)
}
Expand All @@ -156,7 +156,7 @@ func TestRegeneratedDatabaseSchemaDump(t *testing.T) {
}
ctx := context.Background()
db := sqlEnv.GetMigratedDB(ctx, t)
got, err := sqlEnv.DumpDatabaseSchema(ctx, db.Config().Config.Database)
got, err := sqlEnv.DumpDatabaseSchema(ctx, db.Config().ConnConfig.Database)
if err != nil {
t.Fatalf("failed to dump database schema: %v", err)
}
Expand Down
Loading

0 comments on commit 599a714

Please sign in to comment.