Add an instruction for fetching the gerrit source (#1983)
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index b4d9952..128a06e 100755
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -3071,9 +3071,9 @@
host = re.search(r"https://(.+?)\.googlesource", git_repository).group(1)
if not host:
raise BuildkiteException("Couldn't get host name from %s" % git_repository)
- text = "The transformed code used in this pipeline can be found under https://{}-review.googlesource.com/q/{}".format(
- host, os.getenv("BUILDKITE_COMMIT")
- )
+ commit = os.getenv("BUILDKITE_COMMIT")
+ text = f"The transformed code used in this pipeline can be found under https://{host}-review.googlesource.com/q/{commit}\n" \
+ f"Fetch the source with `git fetch https://{host}.googlesource.com/bazel {commit} && git checkout FETCH_HEAD`"
commands = ["buildkite-agent annotate --style=info --context 'gerrit' '{}'".format(text)]
pipeline_steps.append(
create_step(