From 6cea0423307fae0eb5b8a9058a7c6d3e74c8bd8b Mon Sep 17 00:00:00 2001 From: emil User Date: Wed, 12 Aug 2026 22:35:23 +0000 Subject: [PATCH] GRM-161: Fix register.yml service start and bump devx to v0.50.5 (#238) - Fix register.yml premature service start (removed systemctl start before unit file exists) - Replace broken inline Python in ci.yml auto-merge with devx.ci.wait_for_checks - Bump devx from v0.50.0 to v0.50.5 GRM-161 --- .gitea/workflows/ci.yml | 32 ++++--------------- CHANGELOG.md | 18 +++++++++++ ansible/roles/gitea_runner/tasks/register.yml | 16 ++-------- pyproject.toml | 4 +-- 4 files changed, 29 insertions(+), 41 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e44242f..8bc4a72 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -311,34 +311,14 @@ jobs: if: needs.validate.outputs.ansible-changed == 'true' env: CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }} - REPOSITORY: ${{ github.repository }} - PR_NUMBER: ${{ github.event.number }} run: | . .venv/bin/activate 2>/dev/null || true - # Poll Gitea API for molecule-tests job status (max 20 min) - for i in $(seq 1 120); do - all_done=$(python3 -c " - import json,urllib.request - url='https://git.oblachno.oblachno.fyi/api/v1/repos/$REPOSITORY/actions/runs?limit=5&event=pull_request' - req=urllib.request.Request(url,headers={'Authorization':'token $CI_GITEA_API_TOKEN'}) - runs=json.loads(urllib.request.urlopen(req).read()) - for r in runs[:3]: - jobs_url=f'https://git.oblachno.oblachno.fyi/api/v1/repos/$REPOSITORY/actions/runs/{r[\"id\"]}/jobs' - jreq=urllib.request.Request(jobs_url,headers={'Authorization':'token $CI_GITEA_API_TOKEN'}) - jobs=json.loads(urllib.request.urlopen(jreq).read()) - for j in (jobs if isinstance(jobs,list) else jobs.get('jobs',[])): - if j.get('name','').startswith('molecule-tests') and j.get('status')!='completed': - print('WAITING'); break - else: - continue - break - else: - print('DONE') - ") - echo "Poll $i: $all_done" - [ "$all_done" = "DONE" ] && break - sleep 10 - done + python3 -m devx.ci.wait_for_checks \ + --job-name "molecule-tests" \ + --repo "${{ github.repository }}" \ + --timeout 1200 \ + --poll-interval 10 \ + --no-require-success - name: Squash merge with task ID env: CI_GITEA_API_TOKEN: ${{ secrets.CI_GITEA_API_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 945e79d..8bc5204 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project will be documented in this file. +## [Unreleased] + +### Bug Fixes + +- Fix `register.yml` premature service start: removed step that ran + `systemctl --user start gitea-runner` before the systemd unit file was + created by `service.yml` (included after `register.yml`). First-time + installs were failing with "Unit gitea-runner.service not found". +- Fix `ci.yml` auto-merge IndentationError: replaced broken inline Python + polling script with `devx.ci.wait_for_checks` (the inline Python had + YAML run-block indentation leaking into `python3 -c` string). + +### Dependencies + +- Bump devx from v0.50.0 to v0.50.5 (adds `wait_for_checks` tool, + consolidated Ansible checks, tenacity retry in `install_tools`, + increased download retry attempts/backoff) + ## [0.20.0] - 2026-08-09 ### Features diff --git a/ansible/roles/gitea_runner/tasks/register.yml b/ansible/roles/gitea_runner/tasks/register.yml index d0a9248..105753c 100644 --- a/ansible/roles/gitea_runner/tasks/register.yml +++ b/ansible/roles/gitea_runner/tasks/register.yml @@ -44,16 +44,6 @@ ('already exists' not in gitea_runner_register_output.stdout | default('')) timeout: 60 -- name: Ensure runner service is running after registration - ansible.builtin.command: systemctl --user start gitea-runner - become: true - become_user: "{{ gitea_runner_service_user }}" - environment: - XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}" - DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ gitea_runner_uid | default(0) }}/bus" - changed_when: true - when: - - gitea_runner_systemd_available.stat.exists - - gitea_runner_docker_rootless_setup - - gitea_runner_register_output is defined - - gitea_runner_register_output.rc | default(1) == 0 +# Note: service start is handled by service.yml (included after register.yml +# in install_runner.yml). Starting here fails because the systemd unit file +# has not been created yet. diff --git a/pyproject.toml b/pyproject.toml index 3ef3fcb..ea1babe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ ci = [ "build==1.5.1", "twine==6.2.0", # Reusable CI/CD and dev tools (auto-merge, pr-review, pre-push checks, etc.) - "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.50.0", + "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.50.5", ] # Lint and type-checking tools (validate job) lint = [ @@ -56,7 +56,7 @@ molecule = [ dev = [ "grm[ci,lint,molecule]", # Reusable CI/CD and dev tools (pre-push hooks, create-task, create-pr) - "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.50.0", + "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.50.5", # Non-Python dev dependency: checkmake (Makefile linter) # Install via: go install github.com/checkmake/checkmake/cmd/checkmake@latest ]