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

🐛 Ensure all GitHub releases are fetched when searching provider versions #8240

Merged

Conversation

abhay-krishna
Copy link
Contributor

@abhay-krishna abhay-krishna commented Mar 6, 2023

What this PR does / why we need it:
This PR improves the logic of fetching GitHub releases when looking for versions in provider repositories. The ListReleases API call is paginated and returns only the latest 30 releases. So we need to issue multiple calls in series to fetch all releases for a repository.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #8233 (NOTE: This PR handles only GitHub, it doesn't include a GitLab fix.)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 6, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @abhay-krishna. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 7, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2023
@abhay-krishna abhay-krishna force-pushed the fetch-all-gh-releases branch 2 times, most recently from 4b6c891 to b24dbc9 Compare March 7, 2023 03:57
@sbueringer
Copy link
Member

/assign @ykakarap @Jont828

@abhay-krishna abhay-krishna force-pushed the fetch-all-gh-releases branch 4 times, most recently from 2e01f37 to ba7016e Compare March 7, 2023 05:53
@abhay-krishna abhay-krishna force-pushed the fetch-all-gh-releases branch 2 times, most recently from 2dcfdd5 to cd146bf Compare March 7, 2023 17:41
@abhay-krishna
Copy link
Contributor Author

abhay-krishna commented Mar 20, 2023

@sbueringer @ykakarap If I rebase and push, it'll remove the lgtm label, and I'll need to 🐛 the maintainers again, so holding off on doing so. There are no conflicts here (yet), so should be a clean merge either way.

@ykakarap
Copy link
Contributor

I don't see any conflicts and looks like all the commits are squashed. Is there a need to rebase?

@sbueringer
Copy link
Member

/assign @fabriziopandini
If you have some time, would be great if you can take over the final review/approval

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 20, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8970ad2 into kubernetes-sigs:main Mar 20, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Mar 20, 2023
@sbueringer
Copy link
Member

@CecileRobertMichon @ykakarap Does it make sense to backport this as a bug fix?

@jackfrancis
Copy link
Contributor

@sbueringer You didn't ask for my opinion, but here it is anyways :)

@killianmuldoon said in the issue description:

This should be fixed in supported versions of Cluster API as we don't control the number of releases done by providers and different approaches e.g. many published pre-releases, could result in an older supported version not being installable.

That suggests a backport to the set of branches that can cut patch releases for "supported versions", right?

@sbueringer
Copy link
Member

sbueringer commented Mar 21, 2023

@sbueringer You didn't ask for my opinion, but here it is anyways :)

Always appreciated :)

Sounds good

@sbueringer
Copy link
Member

/cherry-pick release-1.4

@sbueringer
Copy link
Member

/cherry-pick release-1.3

@sbueringer
Copy link
Member

/cherry-pick release-1.2

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #8329

In response to this:

/cherry-pick release-1.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@sbueringer: #8240 failed to apply on top of branch "release-1.3":

Applying: Ensure all GitHub releases are fetched when searching provider versions
Using index info to reconstruct a base tree...
M	cmd/clusterctl/client/repository/repository_github.go
M	cmd/clusterctl/client/repository/repository_github_test.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/clusterctl/client/repository/repository_github_test.go
CONFLICT (content): Merge conflict in cmd/clusterctl/client/repository/repository_github_test.go
Auto-merging cmd/clusterctl/client/repository/repository_github.go
CONFLICT (content): Merge conflict in cmd/clusterctl/client/repository/repository_github.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Ensure all GitHub releases are fetched when searching provider versions
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@sbueringer: #8240 failed to apply on top of branch "release-1.2":

Applying: Ensure all GitHub releases are fetched when searching provider versions
Using index info to reconstruct a base tree...
M	cmd/clusterctl/client/repository/repository_github.go
M	cmd/clusterctl/client/repository/repository_github_test.go
Falling back to patching base and 3-way merge...
Auto-merging cmd/clusterctl/client/repository/repository_github_test.go
CONFLICT (content): Merge conflict in cmd/clusterctl/client/repository/repository_github_test.go
Auto-merging cmd/clusterctl/client/repository/repository_github.go
CONFLICT (content): Merge conflict in cmd/clusterctl/client/repository/repository_github.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Ensure all GitHub releases are fetched when searching provider versions
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sbueringer
Copy link
Member

Would be great if someone can create cherry-picks for 1.3 and 1.2

@sbueringer
Copy link
Member

1.3 is merging now, this leaves 1.2

@ykakarap
Copy link
Contributor

I can do the release-1.2 cherry-pick.

@johannesfrey
Copy link
Contributor

/area clusterctl

@k8s-ci-robot k8s-ci-robot added the area/clusterctl Issues or PRs related to clusterctl label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/clusterctl Issues or PRs related to clusterctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clusterctl only considers 30 github releases