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

chore: Add a bit more logs to the release controller #756

Merged
merged 6 commits into from
Aug 22, 2024
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
11 changes: 8 additions & 3 deletions release-controller/git_repo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import pathlib
import subprocess
Expand Down Expand Up @@ -321,7 +322,7 @@ def push_release_tags(repo: GitRepo, release: Release):
stderr=subprocess.DEVNULL,
cwd=repo.dir,
)
if (
tag_version = (
subprocess.check_output(
[
"git",
Expand All @@ -333,8 +334,12 @@ def push_release_tags(repo: GitRepo, release: Release):
)
.decode("utf-8")
.strip()
.split(" ")[0] != v.version
):
.split(" ")[0]
)
if tag_version == v.version:
logging.info("RC %s: tag %s already exists on origin", release.rc_name, tag)
else:
logging.info("RC %s: pushing tag %s to the origin", release.rc_name, tag)
subprocess.check_call(
[
"git",
Expand Down
14 changes: 12 additions & 2 deletions release-controller/reconciler.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ def version_proposal(self, version: str) -> int | None:

def proposal_submitted(self, version: str) -> bool:
"""Check if a proposal has been submitted for the given version."""
return self._version_path(version).exists()
if self._version_path(version).exists():
proposal_id = self.version_proposal(version)
if proposal_id:
logging.info("version %s: proposal %s already submitted", version, proposal_id)
else:
logging.warning("version %s: earlier proposal submission attempted but failed, will not retry", version)
return True
return False

def mark_submitted(self, version: str):
"""Mark a proposal as submitted."""
Expand Down Expand Up @@ -212,7 +219,10 @@ def reconcile(self):
# returns a result only if changelog is published
changelog = self.loader.proposal_summary(v.version)
if changelog:
if not self.state.proposal_submitted(v.version):
if self.state.proposal_submitted(v.version):
logging.info("RC %s: proposal already submitted for version %s", rc.rc_name, v.version)
else:
logging.info("RC %s: submitting proposal for version %s", rc.rc_name, v.version)
unelect_versions = []
if v_idx == 0:
unelect_versions.extend(
Expand Down
Loading