• Home
  • Raw
  • Download

Lines Matching +full:commit +full:- +full:message +full:- +full:check

3 # Use of this source code is governed by a BSD-style license that can be
9 # account (and are enabled with --is-bot).
11 # See `./tools/chromeos/merge_bot -h` for details.
32 git_log = git("log --decorate=no --color=never")
33 curl = cmd("curl --silent --fail")
36 mkdir = cmd("mkdir -p")
44 MERGE_TAG = "testing-crosvm-merge"
45 DRY_RUN_TAG = "testing-crosvm-merge-dry-run"
47 MERGE_TAG = "crosvm-merge" # type: ignore
48 DRY_RUN_TAG = "crosvm-merge-dry-run" # type: ignore
51 LUCI_EMAIL = "chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com"
79 f"-age:{age}",
85 "Returns a string with all BUG=... lines of the specified commit range."
89 for line in git_log(commit_range, "--pretty=%b").lines()
97 git("fetch -q cros", tracking).fg()
99 git("branch -D", branch_name).fg(quiet=True, check=False)
100 git("checkout -b", branch_name, "--track", f"cros/{tracking}").fg()
107 old_head = git("symbolic-ref -q --short HEAD").stdout(check=False)
109 old_head = git("rev-parse HEAD").stdout()
119 if git("remote get-url cros").fg(check=False) != 0:
122 actual_remote = git("remote get-url cros").stdout()
126 # Install gerrit Change-Id hook
127 hook_path = CROSVM_ROOT / ".git/hooks/commit-msg"
130 curl(f"{GERRIT_URL}/tools/hooks/commit-msg").write_to(hook_path)
136 extra_params = ("r=crosvm-uprev@google.com", *extra_params)
179 "./tools/build_release --build-profile release --profile-generate /workspace/" + tmpdirname
186 dev_container("mkdir -p /var/empty").fg()
195 … f"cargo profdata -- merge -o /workspace/profiles/benchmarks.profdata /workspace/{tmpdirname}"
197 dev_container("xz -f -9e -T 0 /workspace/profiles/benchmarks.profdata").fg()
207 "Merges `revision` into HEAD, creating merge commits including at most `max-size` commits."
211 commits = git_log(f"HEAD..{revision}", "--pretty=%H").lines()
216 commit_authors = git_log(f"HEAD..{revision}", "--pretty=%an").lines()
217 if all(map(lambda x: x == "recipe-roller", commit_authors)):
221 # Create a merge commit for each batch
226 previous_rev = git(f"rev-parse {batch[-1]}^").stdout()
229 # Put together a message containing info about what's in the merge.
232 message = "\n\n".join(
235 git_log(commit_range, "--oneline").stdout(),
242 trailers = "Commit: False" if create_dry_run or TESTING else ""
245 code = git("merge --no-ff", target, "-m", quoted(message), "-m", quoted(trailers)).fg(
246 check=False
251 print("Merge has conflicts. Creating commit with conflict markers.")
252 git("add --update .").fg()
253 message = f"(CONFLICT) {message}"
254 git("commit", "-m", quoted(message), "-m", quoted(trailers)).fg()
257 # TODO: b/181105093 - Re-evaluate throttling strategy after sometime
261 git("commit --amend --no-edit").fg()
285 parsed_revision = git("rev-parse", revision).stdout()
295 with tracking_branch_context("merge-bot-branch", target_branch):
303 labels.append("l=Commit-Queue+1")
305 labels.append("l=Bot-Commit+1")
320 parsed_revision = git("rev-parse", revision).stdout()
325 cq_votes = dry_run.get_votes("Commit-Queue")
330 # Check for luci results and add V+-1 votes to make it easier to identify failed dry runs.
336 last_luci_message = luci_messages[-1]
344 "Bot-Commit": 0,
353 "Verified": -1,
354 "Bot-Commit": 0,
374 with tracking_branch_context("merge-bot-branch", target_branch):
382 *(["l=Commit-Queue+1"] if not TESTING else []),
383 *(["l=Bot-Commit+1"] if is_bot else []),
387 print("Not uploading dry-run with conflicts.")