chore(torrserv_proxy): revert push_branch_template, use auto-{version}
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 39s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 41s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 34s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 30s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 40s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 48s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Failing after 1m47s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Failing after 2m7s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Failing after 2m2s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 45s
Python package / build (pip list, 3.13) (pull_request) Successful in 45s
Python package / build (pip list, 3.14) (pull_request) Successful in 43s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Successful in 33s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Successful in 33s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Successful in 38s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 39s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 41s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 34s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 30s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 40s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 48s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Failing after 1m47s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Failing after 2m7s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Failing after 2m2s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 45s
Python package / build (pip list, 3.13) (pull_request) Successful in 45s
Python package / build (pip list, 3.14) (pull_request) Successful in 43s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Successful in 33s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Successful in 33s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Successful in 38s
Per Alex's feedback: the original push logic in CheckoutMerged that
auto-generates a branch named 'auto-{version}' from the merged commit
hashes is the convention we keep. Drop the push_branch_template knob
and the matching push_branch field on CheckoutAndMergeResult that
were introduced in the previous commit, so downstream steps get the
standard remote_branch_name back instead.
GitHubActionTrigger uses the merge commit_hash directly (commit_hash
field on CheckoutAndMergeResult, which is unaffected) for the
workflow ref, so we don't need a dedicated push_branch field.
This commit is contained in:
@@ -19,8 +19,6 @@ state = SharedStateHolderInMemory(unmerge=unmerge)
|
||||
|
||||
checkoutMerged = CheckoutMerged(clone,
|
||||
desired_branches=state,
|
||||
push=True,
|
||||
push_branch_template="auto-deploy/torrserv_proxy/{commit_sha}",
|
||||
git_user_email="rudolfss13@gmail.com",
|
||||
git_user_name="brencher_bot"
|
||||
)
|
||||
|
||||
+3
-17
@@ -149,7 +149,6 @@ class CheckoutAndMergeResult:
|
||||
remote_branch_name: str | None
|
||||
commit_hash: str
|
||||
version: str
|
||||
push_branch: str | None = None
|
||||
|
||||
|
||||
def _commits_childs(repo: git.Repo) -> Dict[Commit, List[Commit]]:
|
||||
@@ -185,7 +184,6 @@ class CheckoutMerged(AbstractStep[CheckoutAndMergeResult]):
|
||||
git_user_email: str,
|
||||
git_user_name: str,
|
||||
push: bool = True,
|
||||
push_branch_template: str | None = None,
|
||||
**kwargs: Any):
|
||||
super().__init__(**kwargs)
|
||||
self.wd = wd
|
||||
@@ -193,7 +191,6 @@ class CheckoutMerged(AbstractStep[CheckoutAndMergeResult]):
|
||||
self.git_user_email = git_user_email
|
||||
self.git_user_name = git_user_name
|
||||
self.push = push
|
||||
self.push_branch_template = push_branch_template
|
||||
|
||||
def _find_merge_childs(self, tree: Dict[Commit, List[Commit]], commit: Commit) -> List[Commit]:
|
||||
|
||||
@@ -310,29 +307,18 @@ class CheckoutMerged(AbstractStep[CheckoutAndMergeResult]):
|
||||
remote_branch_name = branch_name if remote_name == 'origin' else ref.name
|
||||
break
|
||||
if self.push and remote_branch_name is None:
|
||||
if self.push_branch_template:
|
||||
auto_branch_name = self.push_branch_template.format(
|
||||
commit_sha=repo.head.commit.hexsha,
|
||||
commit_sha_short=repo.head.commit.hexsha[:8],
|
||||
version=version,
|
||||
)
|
||||
else:
|
||||
auto_branch_hash = hashlib.sha1(''.join([x.hexsha for x in sorted_commits]).encode()).hexdigest()
|
||||
auto_branch_name = f"auto-{version}"
|
||||
auto_branch_hash = hashlib.sha1(''.join([x.hexsha for x in sorted_commits]).encode()).hexdigest()
|
||||
auto_branch_name = f"auto-{version}"
|
||||
|
||||
logger.info(f"Pushing {repo.head.commit.hexsha} -> {auto_branch_name}")
|
||||
repo.git.push('-f', 'origin', f"HEAD:refs/heads/{auto_branch_name}")
|
||||
remote_branch_name = auto_branch_name
|
||||
push_branch = auto_branch_name
|
||||
else:
|
||||
push_branch = None
|
||||
|
||||
return CheckoutAndMergeResult(
|
||||
wd=repo_path,
|
||||
remote_branch_name=remote_branch_name,
|
||||
commit_hash=repo.head.commit.hexsha,
|
||||
version=version,
|
||||
push_branch=push_branch,
|
||||
version=version
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user