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

Fix GetLatestRelease #1330

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Fix GetLatestRelease #1330

merged 1 commit into from
Jul 26, 2024

Conversation

nprokopic
Copy link
Contributor

This PR fixes the GetLatestRelease in the Releases SDK to correctly return the latest release according to semver, and not the latest published GitHub release. The function now searches for the latest release in the releases GitHub repo and not in GitHub releases.

After merging and releasing this, we should then bump the Releases SDK version that we use in e2e tests, in order to fix the currently broken CAPA tests.

@nprokopic nprokopic requested a review from a team as a code owner July 26, 2024 00:18
@nprokopic nprokopic requested a review from a team July 26, 2024 00:18
}
if clusterAppPreReleaseString {
return preReleaseBuildFunc(), nil
if b.clusterApp != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated fix, as the nil pointer panic got uncovered here as I updated the unit tests.

@@ -36,7 +36,7 @@ var _ = Describe("Builder", func() {
// set a cluster app override where the pre-release is different
const preReleasePrefix = "test"
releasesBuilder = releasesBuilder.
WithClusterApp("0.76.1-efdaba18e6e9866d62f3214f3d898b21c21e8b48", "").
WithClusterApp("1.0.0-efdaba18e6e9866d62f3214f3d898b21c21e8b48", "").
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating the test here and in other places below, as now in unit tests the latest release is v25.0.0 (and it used to be v25.1.0-demo.0), so cluster-aws version is different in the base release.

@nprokopic
Copy link
Contributor Author

I have updated the unit tests and unit tests work as expected now. Also I have tested this in a small go program to try to get really published latest releases for CAPA and CAPZ from the releases repo - and it works, now it is correctly returning v28.0.0 for CAPA and v25.0.0 for CAPZ.

Will merge and release this with a ping here, for the sake of fixing e2e tests as soon as possible tomorrow (when I am AFK, hence fixing this now).

@nprokopic nprokopic merged commit d81572c into master Jul 26, 2024
5 of 6 checks passed
@nprokopic nprokopic deleted the sdk-fix-get-latest-release branch July 26, 2024 00:39
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.

1 participant