fix(actions): widen workflow_payload to MEDIUMBLOB — Actions creates no run (#815) #816

Merged
jmiller merged 1 commits from feature/815-workflow-payload into dev 2026-07-19 00:05:33 +00:00
Owner

Fixes #815 — Gitea Actions accepted workflow_dispatch (HTTP 204) but created no run.

Root cause

The async InsertRun failed with MySQL 1406 Data too long for column 'workflow_payload' (evidenced in prod gitea.log, notifier_helper.go:349). ActionRunJob.WorkflowPayload was an untyped []byte → plain BLOB (64 KiB) on MySQL/MariaDB (upstream Gitea gets LONG/MEDIUM). At run creation the whole SingleWorkflow is interpolated (every ${{ vars.* }} + git context) and marshaled into that column, so large single-job workflows (deploy-*.yml: big inline SSH heredoc + ~40 vars) overflow 64 KiB — and since 204 returns before the async insert, the run is silently dropped. The concurrency: block tipped payloads over the edge (the intermittent flap).

Fix

  • models/actions/run_job.go: tag WorkflowPayload xorm:"MEDIUMBLOB" (16 MiB) → new installs get a wide column.
  • migration 371 (models/migrations/v1_27/v372.go): ALTER action_run_job.workflow_payload BLOB→MEDIUMBLOB on MySQL/MariaDB; no-op on Postgres (bytea) / SQLite (BLOB), both unbounded.

Permanently unblocks all deploy tiers, independent of the concurrency workaround.

Testing checklist (pre-merge — do not close on impl alone)

  • CI go build ./... green
  • migration 371 runs on prod (MySQL) → SHOW COLUMNS FROM action_run_job shows mediumblob
  • dispatch deploy-dev.yml in MokoAI → a run is created (no 1406 in gitea.log)
  • existing runs unaffected

Verified locally: gofmt clean; follows the existing v110.go dialect-switch idiom. Refs #815.

Fixes #815 — Gitea Actions accepted `workflow_dispatch` (HTTP 204) but created **no run**. ## Root cause The async `InsertRun` failed with MySQL `1406 Data too long for column 'workflow_payload'` (evidenced in prod `gitea.log`, `notifier_helper.go:349`). `ActionRunJob.WorkflowPayload` was an **untyped `[]byte`** → plain **BLOB (64 KiB)** on MySQL/MariaDB (upstream Gitea gets LONG/MEDIUM). At run creation the whole `SingleWorkflow` is interpolated (every `${{ vars.* }}` + git context) and marshaled into that column, so large single-job workflows (`deploy-*.yml`: big inline SSH heredoc + ~40 vars) overflow 64 KiB — and since 204 returns before the async insert, the run is silently dropped. The `concurrency:` block tipped payloads over the edge (the intermittent flap). ## Fix - `models/actions/run_job.go`: tag `WorkflowPayload` `xorm:"MEDIUMBLOB"` (16 MiB) → new installs get a wide column. - **migration 371** (`models/migrations/v1_27/v372.go`): `ALTER action_run_job.workflow_payload BLOB→MEDIUMBLOB` on MySQL/MariaDB; no-op on Postgres (bytea) / SQLite (BLOB), both unbounded. Permanently unblocks all deploy tiers, independent of the concurrency workaround. ## Testing checklist (pre-merge — do not close on impl alone) - [ ] CI `go build ./...` green - [ ] migration 371 runs on prod (MySQL) → `SHOW COLUMNS FROM action_run_job` shows `mediumblob` - [ ] dispatch `deploy-dev.yml` in MokoAI → a run is created (no 1406 in gitea.log) - [ ] existing runs unaffected Verified locally: gofmt clean; follows the existing v110.go dialect-switch idiom. Refs #815.
jmiller added 1 commit 2026-07-18 22:04:47 +00:00
fix(actions): widen action_run_job.workflow_payload to MEDIUMBLOB (#815)
Universal: Auto Version Bump / Version Bump (push) Successful in 21s
Generic: Project CI / Lint & Validate (pull_request) Has been cancelled
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Universal: PR Check / Secret Scan (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 3s
c7507377c7
Gitea Actions accepted workflow_dispatch (HTTP 204) but created no run: the async
InsertRun failed with MySQL 1406 "Data too long for column 'workflow_payload'".
ActionRunJob.WorkflowPayload was an untyped []byte -> plain BLOB (64 KiB) on
MySQL/MariaDB. At run creation the whole SingleWorkflow is interpolated (every
${{ vars.* }} / git context) and marshaled into that column, so large single-job
workflows (deploy-*.yml with big inline scripts + many vars) overflowed it and
the run was silently dropped.

- run_job.go: tag WorkflowPayload `xorm:"MEDIUMBLOB"` (16 MiB) so NEW installs get
  a wide column.
- migration 371 (v372.go): ALTER existing action_run_job.workflow_payload
  BLOB -> MEDIUMBLOB on MySQL/MariaDB; no-op on Postgres/SQLite (unbounded).

Permanently unblocks all deploy tiers regardless of the concurrency-block
workaround. Fixes #815.

Authored-by: Moko Consulting
jmiller merged commit 1d334abc33 into dev 2026-07-19 00:05:33 +00:00
jmiller deleted branch feature/815-workflow-payload 2026-07-19 00:05:35 +00:00
Sign in to join this conversation.