mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
The annoying error of `Invalid Semantic Version` tells us nothing and makes troubleshooting the issue difficult with lots of churn. I have update Executor usage of `semvar.NewVersion` to wrap the error with a message that include the actual version that causes the error. This will help us understand the specific version string that is causing the error and more quickly determine _why_ the version is getting injected. ## Test plan Update/add Go tests.
26 lines
638 B
Python
26 lines
638 B
Python
load("//dev:go_defs.bzl", "go_test")
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|
|
|
go_library(
|
|
name = "api",
|
|
srcs = ["version_check.go"],
|
|
importpath = "github.com/sourcegraph/sourcegraph/lib/api",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"@com_github_grafana_regexp//:regexp",
|
|
"@com_github_masterminds_semver//:semver",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "api_test",
|
|
timeout = "short",
|
|
srcs = ["version_check_test.go"],
|
|
embed = [":api"],
|
|
deps = [
|
|
"//lib/errors",
|
|
"@com_github_stretchr_testify//assert",
|
|
"@com_github_stretchr_testify//require",
|
|
],
|
|
)
|