Skip to content

Commit

Permalink
Do not block apt publishing if there is a more current pre-release
Browse files Browse the repository at this point in the history
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 #10746 lands.

Contributes to #10800
  • Loading branch information
wadells committed Mar 3, 2022
1 parent 32457df commit 08bc483
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.assets/tooling/cmd/check/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
9 changes: 9 additions & 0 deletions build.assets/tooling/cmd/check/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 08bc483

Please sign in to comment.