Do not block apt publishing if there is a more current pre-release (#10804)

We do not publish pre-releases to apt repos, but we do publish them to
github.  That means we need to filter them out when considering if an
apt release should be published.  We don't want v8.3.3 to be blocked by
v9.0.0-dev.1, only by v9.0.0.

Honestly, this is a bit of a mess, but it only needs to hold out a bit
longer until https://github.com/gravitational/teleport/pull/10746 lands.

Contributes to https://github.com/gravitational/teleport/issues/10800
This commit is contained in:
Walt 2022-03-03 22:46:27 -08:00 committed by GitHub
parent d246dec8a0
commit eae66c0ed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -90,6 +90,12 @@ func checkLatest(ctx context.Context, tag string, gh github.GitHub) error {
if r.GetDraft() {
continue
}
// Because pre-releases are not published to apt, we do not want to
// consider them when making apt publishing decisions.
// see: https://github.com/gravitational/teleport/issues/10800
if semver.Prerelease(r.GetTagName()) != "" {
continue
}
tags = append(tags, r.GetTagName())
}

View file

@ -105,6 +105,15 @@ func TestCheckLatest(t *testing.T) {
},
wantErr: require.NoError,
},
{ // see https://github.com/gravitational/teleport/issues/10800
desc: "pass-pre-release",
tag: "v8.3.3",
releases: []string{
"v9.0.0-beta.1",
"v8.3.2",
},
wantErr: require.NoError,
},
}
for _, test := range tests {
t.Run(test.desc, func(t *testing.T) {