Skip to content

fix(actions): keep runner_name after ephemeral runner removal - #39725

Merged
silverwind merged 13 commits into
go-gitea:mainfrom
kirmanak:missing-runner-name-in-completed-workflow
Nov 13, 2026
Merged

silverwind merged 13 commits into
go-gitea:mainfrom
kirmanak:missing-runner-name-in-completed-workflow

Conversation

@kirmanak

@kirmanak kirmanak commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Jobs that ran on ephemeral runners lose runner_name in the workflow_job completed webhook and the jobs API, because the runner row is deleted when the task finishes. GitHub keeps both runner_id and runner_name, and GARM ignores completed jobs without a name, holding the runner slot until its periodic cleanup.

The name is now stored on the task when claimed, and a migration backfills tasks whose runner row still exists.

An ephemeral runner is deleted as soon as its task is done, before the
completed workflow_job webhook is built, so the job was reported without
runner_name as if it had never been assigned. Store the runner name on
the task when the job is claimed and read it from there.

Assisted-by: Claude Code:claude-opus-5-5
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 10, 2026
kirmanak and others added 3 commits October 10, 2026 12:37
Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
… tasks

Assisted-by: Claude Code:claude-opus-5-5
@kirmanak
kirmanak marked this pull request as ready for review October 10, 2026 12:26
@github-actions github-actions Bot added topic/gitea-actions related to the actions of Gitea type/bug labels Oct 10, 2026
@bircni
bircni requested a lite review from Copilot October 10, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The fallback lookup error is discarded, allowing transient database failures to produce an empty runner_name.

0 open findings

What changed in this PR

Preserves runner names for completed Actions jobs after ephemeral runners are removed.

Changes:

  • Stores runner names when tasks are claimed.
  • Adds migration and legacy fallback lookup.
  • Adds conversion, unit, and integration tests.
File Summary
tests/​integration/​actions_job_test.go Tests completed jobs after runner removal.
services/​convert/​convert.go Uses stored or legacy runner names.
services/​convert/​action_test.go Tests runner-name conversion.
models/​actions/​task.go Persists runner names on tasks.
models/​actions/​task_test.go Tests runner-name persistence.
modelmigration/​v29/​v358.go Adds the runner-name database column.
modelmigration/​migrations.go Registers migration 358.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

kirmanak and others added 6 commits October 12, 2026 21:57
Renumber the action_task runner_name migration from 358 to 359, since
main took 358 for the remember-me token hash migration.
Copy the runner name into existing action_task rows during the
migration, so older tasks keep it after the runner row is purged.
Make the column NOT NULL DEFAULT '' and have the integration test
purge the ephemeral runner before checking the reported name.
Renumber the action_task runner_name migration from 359 to 361, since
main took 359 and 360.
Renumber the action_task runner_name migration from 361 to 362, since
main took 361.

Assisted-by: Claude Code:claude-opus-5-5
…-runner-name-in-completed-workflow

# Conflicts:
#	modelmigration/migrations.go
#	modelmigration/v29/v362.go
#	services/convert/convert.go
Every claimed task stores the runner name and the migration backfills
existing ones, so converting jobs no longer needs to load runners.

Assisted-by: Claude Code:claude-opus-5-5
@silverwind

Copy link
Copy Markdown
Member

Pushed 507c75b with small cleanups:

  1. Removed the live runner fallback and runner loading from the converters, and the now unused GetRunnersMapByIDs. Every claimed task stores the name, and the migration backfills the rest.
  2. Folded the converter test into the existing one, and reduced the migration test to one ordered query.
  3. Trimmed comments and dropped the runner purge step from the integration test.

Written by Claude.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 18, 2026
…-runner-name-in-completed-workflow

Renumber the action_task runner_name migration from 363 to 365, since main took 363 and 364.

Assisted-by: Claude Code:claude-opus-5-5
…n-completed-workflow

* origin/main: (139 commits)
  refactor: use ExclusiveFetch to simplify AbortController (go-gitea#40312)
  fix: handle task list items checked with uppercase X (go-gitea#40334)
  test: add e2e tests for comments, file tree, actions and branch protection (go-gitea#40313)
  enhance(lfs): report status and body on non-JSON LFS error responses (go-gitea#40331)
  feat(ssh)!: remove SSH DSA key support (go-gitea#40332)
  refactor(git): parse git stdout correctly (go-gitea#40326)
  [skip ci] Updated translations via Crowdin
  fix(repo): rank exact repository name matches first (go-gitea#39038)
  fix(web): avoid compare output route collisions (go-gitea#40307)
  refactor: clean up error system (go-gitea#40328)
  fix(markup): keep list items on separate lines in quote replies (go-gitea#40329)
  fix(repo): require the unit in AccessibleRepositoryCondition (go-gitea#40059)
  fix(ui): consistent spacing between labels (go-gitea#40261)
  [skip ci] Updated translations via Crowdin
  test: fix the login tab order e2e test in macOS WebKit (go-gitea#40316)
  fix(api): keep webhook settings that are omitted in an edit request (go-gitea#40282)
  fix(indexer): reindex issues when their projects change (go-gitea#40299)
  chore(deps): update go toolchain directive to v1.27.4 (go-gitea#40315)
  chore(css): remove dead CSS (go-gitea#40314)
  fix(packages): generic package deletion ignores terraform state lock and latest version (go-gitea#40302)
  ...

Assisted-by: Claude Code:claude-opus-5-5

# Conflicts:
#	modelmigration/migrations.go
#	modelmigration/v29/v365.go
#	modelmigration/v29/v365_test.go
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 12, 2026
@silverwind
silverwind enabled auto-merge November 12, 2026 18:29
@silverwind
silverwind added this pull request to the merge queue Nov 13, 2026
Merged via the queue into go-gitea:main with commit dc9a2ae Nov 13, 2026
21 checks passed
@GiteaBot GiteaBot added this to the 29.0.0 milestone Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/gitea-actions related to the actions of Gitea type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants