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

GO: Return latest version from GCS that is a full release #172

Merged
merged 3 commits into from
Oct 1, 2020
Merged

Conversation

fweikert
Copy link
Member

If latest-n was requested, Bazelisk previously only examined the most recent version to see whether it had a release (and not just candidates).
If there was no release, Bazelisk simply returned the second-to-last one without checking whether that version had a release, too.

Now Bazelisk checks the latest versions until it finds one with a release.

Fixes #170
Progress towards #171

If `latest-n` was requested, Bazelisk previously only examined the most recent version to see whether it had a release (and not just candidates).
If there was no release, Bazelisk simply returned the second-to-last without checking whether that version had a release, too.

Now Bazelisk checks the latest versions until it finds one with a release.

Fixes #170
Progress towards #171
@fweikert fweikert requested a review from philwo September 27, 2020 21:04
repositories/gcs.go Outdated Show resolved Hide resolved
_, isRelease, err := listDirectoriesInReleaseBucket(latestVersion + "/release/")
if err != nil {
return []string{}, fmt.Errorf("could not list release candidates for latest release: %v", err)
// TODO(#171): This algorithm is incorrect if version == 'latest-n' and any of the last n versions (except the last one) does not have a release yet.
Copy link
Member

Choose a reason for hiding this comment

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

Just for my understanding, what we would actually want to do here is to basically filter the sorted array and remove all entries for which no release version exists, right? But we don't do that, because you think it's too slow due to the number of HTTP requests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's the problem. But we can work around this by specifying how many of the latest releases we need: #171

@fweikert
Copy link
Member Author

fweikert commented Oct 1, 2020

PTAL

@fweikert fweikert merged commit 948ac45 into master Oct 1, 2020
@fweikert fweikert deleted the gcs branch October 1, 2020 16: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.

Bazelisk is pulling a non existing release ( 3.5.1 ) when invoked w/o .bazelversion
2 participants