Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(release-controller): remove suppression of stdout and stderr in Git commands #1172

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading