Skip to content

Commit

Permalink
fix(release-controller): remove suppression of stdout and stderr in G…
Browse files Browse the repository at this point in the history
…it commands (#1172)
  • Loading branch information
sasa-tomic authored Jan 3, 2025
1 parent 8483556 commit 63753dc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
18 changes: 0 additions & 18 deletions release-controller/git_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,13 @@ def ensure_branches(self, branches: list[str]):
subprocess.check_call(
["git", "checkout", branch],
cwd=self.dir,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
except subprocess.CalledProcessError:
print("Branch {} does not exist".format(branch))

subprocess.check_call(
["git", "checkout", self.main_branch],
cwd=self.dir,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)

def show(self, obj: str) -> Commit | None:
Expand Down Expand Up @@ -146,14 +142,10 @@ def fetch(self):
subprocess.check_call(
["git", "fetch"],
cwd=self.dir,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
subprocess.check_call(
["git", "reset", "--hard", f"origin/{self.main_branch}"],
cwd=self.dir,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
else:
os.makedirs(self.dir, exist_ok=True)
Expand All @@ -164,17 +156,13 @@ def fetch(self):
self.repo,
self.dir,
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
subprocess.check_call(
[
"git",
"fetch",
"--all",
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
cwd=self.dir,
)

Expand Down Expand Up @@ -397,8 +385,6 @@ def push_release_tags(repo: GitRepo, release: Release):
"origin",
f"{v.version}:refs/remotes/origin/{v.version}-commit",
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
cwd=repo.dir,
)
tag = version_name(release.rc_name, v.name)
Expand All @@ -410,8 +396,6 @@ def push_release_tags(repo: GitRepo, release: Release):
v.version,
"-f",
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
cwd=repo.dir,
)
tag_version = (
Expand Down Expand Up @@ -441,8 +425,6 @@ def push_release_tags(repo: GitRepo, release: Release):
tag,
"-f",
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
cwd=repo.dir,
)

Expand Down
6 changes: 0 additions & 6 deletions scripts/host-os-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,11 @@ def main():
subprocess.check_call(
["git", "fetch"],
cwd=ic_repo_path,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
print("Resetting HEAD to latest origin/master.")
subprocess.check_call(
["git", "reset", "--hard", "origin/master"],
cwd=ic_repo_path,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
else:
print("Cloning IC repo to {}".format(ic_repo_path))
Expand All @@ -353,8 +349,6 @@ def main():
"https://github.com/dfinity/ic.git",
ic_repo_path,
],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)

if last_commit == "":
Expand Down

0 comments on commit 63753dc

Please sign in to comment.