MCPcopy Index your code
hub / github.com/apache/tvm / merge

Method merge

ci/scripts/github/github_tvmbot.py:424–448  ·  view source on GitHub ↗

Request a merge of this PR via the GitHub API

(self)

Source from the content-addressed store, hash-verified

422 return body
423
424 def merge(self) -> None:
425 """
426 Request a merge of this PR via the GitHub API
427 """
428 url = f"pulls/{self.number}/merge"
429
430 title = self.raw["title"] + f" (#{self.number})"
431 body = self.body_with_co_authors()
432 logging.info(f"Full commit:\n{title}\n\n{body}")
433
434 data = {
435 "commit_title": title,
436 "commit_message": body,
437 # The SHA is necessary in case there was an update right when this
438 # script ran, GitHub will sort out who won
439 "sha": self.head_oid(),
440 "merge_method": "squash",
441 }
442 if self.dry_run:
443 logging.info(f"Dry run, would have merged with url={url} and data={to_json_str(data)}")
444 return
445
446 r = self.github.put(url, data=data)
447 logging.info(f"GitHub merge response: {r}")
448 return r
449
450 def author(self) -> str:
451 return self.raw["author"]["login"]

Callers 1

Calls 5

body_with_co_authorsMethod · 0.95
head_oidMethod · 0.95
to_json_strFunction · 0.85
infoMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected