Merge remote-tracking branch 'origin/main' into blank_patch
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 34s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 38s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 36s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 34s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 34s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 40s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Successful in 1m40s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Successful in 1m43s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Successful in 1m42s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 32s
Python package / build (pip list, 3.13) (pull_request) Successful in 32s
Python package / build (pip list, 3.14) (pull_request) Successful in 32s
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 29s
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 36s
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 33s
Python package / tests (pytest, 3.12.3) (pull_request) Canceled after 0s
Python package / tests (pytest, 3.13) (pull_request) Canceled after 0s
Python package / tests (pytest, 3.14) (pull_request) Canceled after 0s

This commit is contained in:
GitHub Actions
2026-08-12 19:09:18 +00:00
7 changed files with 86 additions and 4 deletions
+59
View File
@@ -0,0 +1,59 @@
from enironment import Environment
from steps.checks import SimpleLog, UrlCheck
from steps.docker import DockerSwarmCheck, DockerSwarmDeploy
from steps.git import GitClone, CheckoutMerged, GitUnmerge
from steps.shared_state import SharedStateHolderInMemory
clone = GitClone(url="https://github.com/rudolf1/uber_backup.git", branchNamePrefix="ansible")
dockerSwarmCheck = DockerSwarmCheck(
stack_name="gitea",
)
unmerge = GitUnmerge(clone, dockerSwarmCheck)
state = SharedStateHolderInMemory(unmerge=unmerge)
checkoutMerged = CheckoutMerged(clone,
desired_branches=state,
push=False,
git_user_email="rudolfss13@gmail.com",
git_user_name="brencher_bot"
)
deployDocker = DockerSwarmDeploy(
wd=clone,
buildDocker=None,
stackChecker=dockerSwarmCheck,
envs=lambda: {
"version": "auto-" + checkoutMerged.progress().version,
},
stack_name="gitea",
docker_compose_path="poc/gitea/stack-compose.yml",
)
# checkPing1 = UrlCheck(
# url="http://100.70.193.97:8087/api/status",
# expected=lambda obj: obj['gateway_running'] == 'true' and obj['auth_required'] == 'true',
# )
logUrls = SimpleLog(message={
"userLinks": {
"App": "https://gitea.rudolf.keenetic.link",
}
})
__all__ = ["gitea"]
gitea = Environment(
id="gitea",
state=state,
pipeline=[
clone,
state,
checkoutMerged,
dockerSwarmCheck,
unmerge,
deployDocker,
# checkPing1,
logUrls
]
)
+5 -2
View File
@@ -42,8 +42,11 @@ class SharedStateHolderInMemory(AbstractStep[SharedState], SharedStateHolder):
def progress(self) -> SharedState:
if len(self.state.branches) == 0:
if self.unmerge:
unmerge = self.unmerge.progress()
self.state = replace(self.state, branches=unmerge.branches, token=uuid.uuid4().hex)
try:
unmerge = self.unmerge.progress()
self.state = replace(self.state, branches=unmerge.branches, token=uuid.uuid4().hex)
except BaseException as e:
logger.error("Unmerge failed: %s", e)
return self.state
+9 -1
View File
@@ -129,6 +129,7 @@ class WebApp:
async def broadcast_environments(self, data: Any) -> None:
await self.broadcast("environments", data)
await self.broadcast("version", self.get_version())
async def broadcast_error(self, data: Any) -> None:
await self.broadcast("error", data)
@@ -140,11 +141,16 @@ class WebApp:
# --- Routes ---
def get_version(self) -> str:
return os.getenv('VERSION', 'unknown') or 'unknown'
async def serve_index(self) -> FileResponse:
return FileResponse(os.path.join(FRONTEND_DIR, 'index.html'))
async def serve_state(self) -> Response:
return Response(content=custom_json_dumps(self.get_global_envs_to_emit()), media_type="application/json")
state = self.get_global_envs_to_emit()
state['version'] = self.get_version()
return Response(content=custom_json_dumps(state), media_type="application/json")
async def serve_branches_route(self) -> Response:
return Response(content=custom_json_dumps(self.get_global_branches_to_emit()), media_type="application/json")
@@ -163,6 +169,8 @@ class WebApp:
# Send initial state on connect and record it so duplicate broadcasts are suppressed
branches_payload = custom_json_dumps({"branches": self.get_global_branches_to_emit()})
envs_payload = custom_json_dumps({"environments": self.get_global_envs_to_emit()})
version_payload = custom_json_dumps({"version": self.get_version()})
await websocket.send_text(version_payload)
await websocket.send_text(branches_payload)
self.ws_connections[websocket]["branches"] = branches_payload
await websocket.send_text(envs_payload)
+2 -1
View File
@@ -16,7 +16,8 @@ services:
- PYTHONUNBUFFERED=1
- VIRTUAL_HOST=brencher.rudolf.keenetic.link
- LETSENCRYPT_HOST=brencher.rudolf.keenetic.link
- PROFILES=brencher2,torrserv_proxy,immich,gmail_mcp,hermes,hermes_infra
- VERSION=${version}
- PROFILES=brencher2,torrserv_proxy,immich,gmail_mcp,hermes,hermes_infra,gitea
- SECONDARY_BRENCHER=http://host.docker.internal:5002
deploy:
replicas: 1
+3
View File
@@ -13,6 +13,7 @@ const closeStatus = document.getElementById('close-status');
const refreshBranchesBtn = document.getElementById('refresh-branches');
const applyChangesBtn = document.getElementById('apply-changes');
const branchFilter = document.getElementById('branch-filter');
const appVersion = document.getElementById('app-version');
// Branches list (flattened) for UI rendering: [{ envId, envName, branch, commits: [] }]
let branches = [];
@@ -477,6 +478,8 @@ function setupWebSockets() {
filterBranches();
renderJobs();
showStatus('Environments updated.');
} else if ('version' in message) {
appVersion.textContent = `Version: ${message.version || 'unknown'}`;
} else if ('error' in message) {
console.error('Error from server:', message.error);
if (message.error && message.error.code === 'BRANCH_STATE_CONFLICT' && message.error.envId) {
+1
View File
@@ -10,6 +10,7 @@
<div class="container">
<header>
<h1>Brencher - Branch Merger</h1>
<p class="version" id="app-version">Version: loading...</p>
<div id="status-bar" class="status-bar hidden">
<span id="status-message"></span>
<button id="close-status">×</button>
+7
View File
@@ -15,6 +15,13 @@ body {
padding: 32px;
}
.version {
color: #6c757d;
font-family: monospace;
font-size: 0.85rem;
margin-top: -12px;
}
.primary-button {
background: #007bff;
color: #fff;