fix(configs): enable temporary branch push + dispatch on it
Brencher now mirrors the auto-deploy-via-temp-branch pattern Alex described: instead of triggering the workflow on the default branch, brencher pushes the merge commit to `auto-<sha>` via CheckoutMerged's existing push=True logic, then dispatches the workflow on that new branch. The branch acts as a review point between build and deploy: after trigger_build and await_build complete, the deploy step still runs on the same local merge, but the workflow's provenance lives on a remote branch Alex can inspect or revert before merging back to default. - checkoutMerged.push = True (was False). CheckoutMerged already builds the branch name as `auto-<commit1>-<commit2>...` from the sorted merges and force-pushes it to `origin` (see backend/steps/git.py ~line 311). - trigger_build ref pulls `checkoutMerged.progress().remote_branch_name` instead of a hard-coded "master". This makes the workflow run on the auto-branch brencher just pushed.
This commit is contained in:
@@ -21,7 +21,7 @@ state = SharedStateHolderInMemory(unmerge=unmerge)
|
||||
checkoutMerged = CheckoutMerged(
|
||||
clone,
|
||||
desired_branches=state,
|
||||
push=False,
|
||||
push=True,
|
||||
git_user_email="rudolfss13@gmail.com",
|
||||
git_user_name="brencher_bot",
|
||||
)
|
||||
@@ -32,7 +32,6 @@ GITEA_TOKEN = os.environ.get("GITEA_TOKEN", "")
|
||||
WORKFLOW_OWNER = "hermes"
|
||||
WORKFLOW_REPO = "ansible"
|
||||
WORKFLOW_FILE = "release.yml"
|
||||
WORKFLOW_REF = "master"
|
||||
|
||||
def _inputs() -> dict:
|
||||
return {"tag": "auto-" + checkoutMerged.progress().version}
|
||||
@@ -42,7 +41,7 @@ trigger_build = GiteaActionsTrigger(
|
||||
owner=WORKFLOW_OWNER,
|
||||
repo=WORKFLOW_REPO,
|
||||
workflow_file=WORKFLOW_FILE,
|
||||
ref=WORKFLOW_REF,
|
||||
ref=checkoutMerged.progress().remote_branch_name or "master",
|
||||
token=GITEA_TOKEN,
|
||||
inputs=_inputs,
|
||||
wd=checkoutMerged,
|
||||
|
||||
Reference in New Issue
Block a user