[management] treat ci- builds as development for remote jobs (#6436)
* fix(management): treat ci- builds as development for remote jobs CI snapshot builds use a "ci-<sha>" version string that did not match IsDevelopmentVersion, so the remote-jobs minimum-version gate rejected them. Recognize the "ci-" prefix as a development build. * fix(management): treat dev- builds as development for remote jobs Dev snapshot builds use a "dev-<sha>" version string that did not match IsDevelopmentVersion, so the remote-jobs minimum-version gate rejected them. Recognize the "dev-" prefix as a development build, alongside the existing "ci-" prefix.
This commit is contained in:
@@ -13,6 +13,14 @@ import (
|
|||||||
// string, so it must not change without coordinating those consumers.
|
// string, so it must not change without coordinating those consumers.
|
||||||
const DevelopmentVersion = "development"
|
const DevelopmentVersion = "development"
|
||||||
|
|
||||||
|
// CIVersionPrefix marks CI snapshot builds (e.g. "ci-7470fbdd"). Such builds
|
||||||
|
// are treated as development versions by IsDevelopmentVersion.
|
||||||
|
const CIVersionPrefix = "ci-"
|
||||||
|
|
||||||
|
// DevVersionPrefix marks dev snapshot builds (e.g. "dev-7470fbdd"). Such builds
|
||||||
|
// are treated as development versions by IsDevelopmentVersion.
|
||||||
|
const DevVersionPrefix = "dev-"
|
||||||
|
|
||||||
// will be replaced with the release version when using goreleaser
|
// will be replaced with the release version when using goreleaser
|
||||||
var version = DevelopmentVersion
|
var version = DevelopmentVersion
|
||||||
|
|
||||||
@@ -69,8 +77,11 @@ func NetbirdCommit() string {
|
|||||||
// comparing against the "development" literal or ad-hoc substring checks.
|
// comparing against the "development" literal or ad-hoc substring checks.
|
||||||
//
|
//
|
||||||
// Matches the bare DevelopmentVersion constant as well as any future
|
// Matches the bare DevelopmentVersion constant as well as any future
|
||||||
// extension such as "development-<sha>" or "development-<sha>-dirty",
|
// extension such as "development-<sha>" or "development-<sha>-dirty", and
|
||||||
// while excluding tagged prereleases like "v0.31.1-dev".
|
// CI/dev snapshot builds prefixed with "ci-" or "dev-", while excluding
|
||||||
|
// tagged prereleases like "v0.31.1-dev".
|
||||||
func IsDevelopmentVersion(v string) bool {
|
func IsDevelopmentVersion(v string) bool {
|
||||||
return strings.HasPrefix(v, DevelopmentVersion)
|
return strings.HasPrefix(v, DevelopmentVersion) ||
|
||||||
|
strings.HasPrefix(v, CIVersionPrefix) ||
|
||||||
|
strings.HasPrefix(v, DevVersionPrefix)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ func TestIsDevelopmentVersion(t *testing.T) {
|
|||||||
{"development", true},
|
{"development", true},
|
||||||
{"development-0823f3ff9ab1", true},
|
{"development-0823f3ff9ab1", true},
|
||||||
{"development-0823f3ff9ab1-dirty", true},
|
{"development-0823f3ff9ab1-dirty", true},
|
||||||
|
{"ci-7470fbdd", true},
|
||||||
|
{"dev-7470fbdd", true},
|
||||||
{"0.50.0", false},
|
{"0.50.0", false},
|
||||||
{"v0.31.1-dev", false},
|
{"v0.31.1-dev", false},
|
||||||
{"1.0.0-dev", false},
|
{"1.0.0-dev", false},
|
||||||
|
|||||||
Reference in New Issue
Block a user