fix(actions): widen workflow_payload to MEDIUMBLOB — Actions creates no run (#815) #816
Reference in New Issue
Block a user
Delete Branch "feature/815-workflow-payload"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #815 — Gitea Actions accepted
workflow_dispatch(HTTP 204) but created no run.Root cause
The async
InsertRunfailed with MySQL1406 Data too long for column 'workflow_payload'(evidenced in prodgitea.log,notifier_helper.go:349).ActionRunJob.WorkflowPayloadwas an untyped[]byte→ plain BLOB (64 KiB) on MySQL/MariaDB (upstream Gitea gets LONG/MEDIUM). At run creation the wholeSingleWorkflowis 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. Theconcurrency:block tipped payloads over the edge (the intermittent flap).Fix
models/actions/run_job.go: tagWorkflowPayloadxorm:"MEDIUMBLOB"(16 MiB) → new installs get a wide column.models/migrations/v1_27/v372.go):ALTER action_run_job.workflow_payload BLOB→MEDIUMBLOBon 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)
go build ./...greenSHOW COLUMNS FROM action_run_jobshowsmediumblobdeploy-dev.ymlin MokoAI → a run is created (no 1406 in gitea.log)Verified locally: gofmt clean; follows the existing v110.go dialect-switch idiom. Refs #815.
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