Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore beta releases #226

Merged
merged 6 commits into from
Dec 27, 2023
Merged

Ignore beta releases #226

merged 6 commits into from
Dec 27, 2023

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Dec 27, 2023

Fixes pulumi/ci-mgmt#749

When looking up the latest version of an upstream provider, we should skip beta releases.
This PR achieves this by getting the list of the latest 30 releases and then iterating over them until it finds a non-beta release when looking up latest.

Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, but otherwise LGTM.

@@ -511,18 +511,25 @@ var getExpectedTargetLatest = stepv2.Func21E("From Upstream Releases", func(ctx
name, upstreamOrg string) (*UpstreamUpgradeTarget, error) {
latest := stepv2.Cmd(ctx, "gh", "release", "list",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use --json when possible. Tracking issue is cli/cli#4572.

upgrade/steps_helpers.go Outdated Show resolved Hide resolved
@@ -292,3 +290,50 @@ func TestGetExpectedTargetFromTarget(t *testing.T) {
"GHIssues": null
}`))
}

func TestFromUpstreamReleasesBetaIgnored(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a test here!

@VenelinMartinov VenelinMartinov enabled auto-merge (squash) December 27, 2023 14:17
@VenelinMartinov VenelinMartinov merged commit b9893a3 into main Dec 27, 2023
1 check passed
@VenelinMartinov VenelinMartinov deleted the vvm/ignore_beta_releases branch December 27, 2023 14:17
guineveresaenger added a commit that referenced this pull request Jan 2, 2024
…rgetLatest (#220)

See #218 for details.

Uses the full json repo info payload to determine the latest upstream
release.

See pulumi/pulumi-minio#251 for the fix
applying to pulumi-minio specifically.

Fixes #218.
Fixes pulumi/pulumi-f5bigip#345
Fixes pulumi/pulumi-venafi#244


~**Reviewer Note**: This functionality overrides the changes in #226.
Note that we're returning an empty UpgradeTargetVersion in the case of a
non-stable release, so that the nil check on `Plan Provider Upgrade`
reports that we are up to date. A `latest` version with a beta tag
should not fail the upgrade process; we should ignore it.~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't create upgrade issues for beta releases
2 participants