S6: Configure Gitea Actions timeouts and log retention #39

Open
opened 2026-11-09 17:05:57 +00:00 by claude · 1 comment
Member

Gitea's [actions] section only sets ENABLED, so abandoned jobs and retention use defaults.

Work

  • Set ZOMBIE_TASK_TIMEOUT, ENDLESS_TASK_TIMEOUT, ABANDONED_JOB_TIMEOUT, LOG_RETENTION_DAYS, and ARTIFACT_RETENTION_DAYS in the role, with a comment explaining each value.
  • Confirm option names against Gitea 1.27's config cheat sheet.

Acceptance

  • A job orphaned by a runner restart fails within the configured time.
  • Settings appear in the rendered app.ini after deploy.

Depends on: S2. This changes the main Gitea deployment, so label ready-to-deploy and let Eric choose the time.

Gitea's `[actions]` section only sets `ENABLED`, so abandoned jobs and retention use defaults. **Work** - Set `ZOMBIE_TASK_TIMEOUT`, `ENDLESS_TASK_TIMEOUT`, `ABANDONED_JOB_TIMEOUT`, `LOG_RETENTION_DAYS`, and `ARTIFACT_RETENTION_DAYS` in the role, with a comment explaining each value. - Confirm option names against Gitea 1.27's config cheat sheet. **Acceptance** - A job orphaned by a runner restart fails within the configured time. - Settings appear in the rendered `app.ini` after deploy. Depends on: S2. This changes the main Gitea deployment, so label `ready-to-deploy` and let Eric choose the time.
claude added this to the CI/CD 0: Stabilize the runner milestone 2026-11-09 17:05:57 +00:00
claude added the cicd
priority
high
labels 2026-11-09 17:05:57 +00:00
claude added this to the CI/CD Roadmap project 2026-11-09 17:07:33 +00:00
claude moved this to To Do in CI/CD Roadmap on 2026-11-09 17:07:59 +00:00
Author
Member

Committed, ready to deploy when you choose the time. DevOps/ansible-role-gitea@5fb2d9c, bumped in 91b81e5.

Settings. Option names and defaults were checked against Gitea 1.27.0's modules/setting/actions.go. Each value is a role default with a comment.

Option Default New Why
ZOMBIE_TASK_TIMEOUT 10m 5m A running task whose runner stops reporting is failed after this long. Shorter, so a job lost with its runner fails within minutes.
ENDLESS_TASK_TIMEOUT 3h 2h30m Kept above the runner's own 2h job timeout from S4 (#37), so the runner normally fails a long job first and says why.
ABANDONED_JOB_TIMEOUT 24h 12h Cancels a job that no runner picks up, for example one that asks for macOS or Windows.
LOG_RETENTION_DAYS 365 90
ARTIFACT_RETENTION_DAYS 90 30

Rendered app.ini section (helm template of chart 12.7.0 with the role's values rendered through Ansible, stub secrets):

actions: |-
  ABANDONED_JOB_TIMEOUT=12h
  ARTIFACT_RETENTION_DAYS=30
  ENABLED=true
  ENDLESS_TASK_TIMEOUT=2h30m
  LOG_RETENTION_DAYS=90
  ZOMBIE_TASK_TIMEOUT=5m

gitea.yaml --syntax-check passes. Nothing was applied.

Deploy (main Gitea, so pick a quiet time):

ansible-playbook -i inventories/eom.dev.yml gitea.yaml --tags gitea

Add your usual vault option.

  • Effect: the inline config changes, so Gitea's single pod restarts, a short outage of the web UI, git and the API. The S2 (#35) pullPolicy: IfNotPresent change applies in the same restart. The runner isn't touched.
  • Side effects to expect: right after the restart, any job that has waited more than 12 h for a runner is cancelled, which includes Ashlar's backlog in S1 (#34). Logs older than 90 days and artifacts older than 30 days are deleted by Gitea's cleanup cron. The log deletion can't be undone, so if you want to keep older logs, raise gitea_actions_log_retention_days first.
  • Rollback: git revert 91b81e5 in the superproject, then rerun with --tags gitea. That also reverts S4's runner values in the role, so rerun --tags actions too if those were already applied, or revert only the gitea.yaml hunk in the role.

Acceptance still to check after deploy: the settings appear in the live app.ini, and an orphaned job fails within the configured time. Both go with S8 (#41).

— eom-cicd-roadmap

**Committed, ready to deploy when you choose the time.** DevOps/ansible-role-gitea@5fb2d9c, bumped in 91b81e5. **Settings.** Option names and defaults were checked against Gitea 1.27.0's `modules/setting/actions.go`. Each value is a role default with a comment. | Option | Default | New | Why | |---|---|---|---| | `ZOMBIE_TASK_TIMEOUT` | 10m | **5m** | A running task whose runner stops reporting is failed after this long. Shorter, so a job lost with its runner fails within minutes. | | `ENDLESS_TASK_TIMEOUT` | 3h | **2h30m** | Kept above the runner's own 2h job timeout from S4 (#37), so the runner normally fails a long job first and says why. | | `ABANDONED_JOB_TIMEOUT` | 24h | **12h** | Cancels a job that no runner picks up, for example one that asks for macOS or Windows. | | `LOG_RETENTION_DAYS` | 365 | **90** | | | `ARTIFACT_RETENTION_DAYS` | 90 | **30** | | **Rendered `app.ini` section** (`helm template` of chart 12.7.0 with the role's values rendered through Ansible, stub secrets): ``` actions: |- ABANDONED_JOB_TIMEOUT=12h ARTIFACT_RETENTION_DAYS=30 ENABLED=true ENDLESS_TASK_TIMEOUT=2h30m LOG_RETENTION_DAYS=90 ZOMBIE_TASK_TIMEOUT=5m ``` `gitea.yaml --syntax-check` passes. Nothing was applied. **Deploy (main Gitea, so pick a quiet time):** ``` ansible-playbook -i inventories/eom.dev.yml gitea.yaml --tags gitea ``` Add your usual vault option. - **Effect:** the inline config changes, so Gitea's single pod restarts, a short outage of the web UI, git and the API. The S2 (#35) `pullPolicy: IfNotPresent` change applies in the same restart. The runner isn't touched. - **Side effects to expect:** right after the restart, any job that has waited more than 12 h for a runner is cancelled, which includes Ashlar's backlog in S1 (#34). Logs older than 90 days and artifacts older than 30 days are deleted by Gitea's cleanup cron. **The log deletion can't be undone**, so if you want to keep older logs, raise `gitea_actions_log_retention_days` first. - **Rollback:** `git revert 91b81e5` in the superproject, then rerun with `--tags gitea`. That also reverts S4's runner values in the role, so rerun `--tags actions` too if those were already applied, or revert only the `gitea.yaml` hunk in the role. **Acceptance still to check after deploy:** the settings appear in the live `app.ini`, and an orphaned job fails within the configured time. Both go with S8 (#41). — eom-cicd-roadmap
claude added the ready-to-deploy label 2026-11-10 16:02:35 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DevOps/software-infrastructure#39