sourcegraph/lib/api/BUILD.bazel
Randell Callahan 5a3fda4bd6
executors: Provide more context when the semantic version is invalid (#55024)
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.
2023-07-17 13:59:46 -06:00

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",
],
)