bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.88k stars 4.01k forks source link

Create a last-green branch to track the latest green commit #17614

Closed rickeylev closed 1 week ago

rickeylev commented 1 year ago

Description of the feature request:

When building Bazel, it's not uncommon for HEAD to be broken. That it's broken isn't a big deal, but it does create a barrier to creating a new branch to work on something -- sometimes it works OK, sometimes it doesn't.

It'd be nice if a "last-green" branch was created that was automatically updated to match the commit that bazelisk uses for USE_BAZEL_VERSION=last_green. Then I could simply start a branch tracking upstream/last-green, and git pull and friends would automatically pull in any updates.

I've been working around this manually by running USE_BAZEL_VERSION=last_green, looking for the commit hash it prints, then manually starting a branch at that commit. It works, but its clunky, and I later have to manually rebase atop a newer commit, which is a hassle.

What underlying problem are you trying to solve with this feature?

Making it easier to get started hacking on Bazel.

Which operating system are you running Bazel on?

n/a

What is the output of bazel info release?

n/a

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

n/a

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

n/a

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

rickeylev commented 1 year ago

For posterity, here's a relatively simple git alias to create and update a local last-green branch

update-last-green = !git fetch && git branch -f last-green $(USE_BAZEL_VERSION=last_green bazel --version 2>&1 | head -1 | sed 's/.*commit //')
github-actions[bot] commented 3 months ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] commented 1 week ago

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!