From e8129798ac230ac818c99accd59050e9335532cb Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Fri, 22 Nov 2024 10:04:10 +0100 Subject: [PATCH] bisect: always override oldCommit to the merge base commit (#633) This would resolve branch name like `release-8.0.0rc2` to an actual commit hash, which is then a valid Bazel version for Bazelisk. This avoids error like: ``` # bazel --bisect=release-8.0.0rc2..e18aad1be363fe40bad2cc67462a6389f381096b test //... --- Getting the list of commits between release-8.0.0rc2 and e18aad1be363fe40bad2cc67462a6389f381096b Found 54 commits between (release-8.0.0rc2, e18aad1be363fe40bad2cc67462a6389f381096b] --- Verifying if the given good Bazel commit (release-8.0.0rc2) is actually good 2024/11/18 12:58:03 could not run Bazel: could not download Bazel: could not resolve the version 'release-8.0.0rc2' to an actual version number: Invalid version 'release-8.0.0rc2' ``` --- core/core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.go b/core/core.go index 79534f43..45536b8e 100644 --- a/core/core.go +++ b/core/core.go @@ -824,9 +824,9 @@ func getBazelCommitsBetween(oldCommit string, newCommit string, config config.Co } mergeBaseCommit := compResp.MergeBaseCommit.SHA + oldCommit = mergeBaseCommit if mergeBaseCommit != compResp.BaseCommit.SHA { fmt.Printf("The old Bazel commit is not an ancestor of the new Bazel commit, overriding the old Bazel commit to the merge base commit %s\n", mergeBaseCommit) - oldCommit = mergeBaseCommit } for _, commit := range compResp.Commits {