gitea/services
Nicolas afcd11c77f
BUG: Fix workflow run jobs API returning null steps (#36603)
## Problem

`GET /api/v1/repos/{owner}/{repo}/actions/runs/{runId}/jobs` was always
returning `steps: null` for each job.

## Cause

In `convert.ToActionWorkflowJob`, when the job had a `TaskID` we loaded
the task with `db.GetByID` but never loaded `task.Steps`.
`ActionTask.Steps` is not stored in the task row (`xorm:"-"`); it comes
from `action_task_step` and is only filled by `task.LoadAttributes()` /
`GetTaskStepsByTaskID()`. So the conversion loop over `task.Steps`
always saw nil and produced no steps in the API response.

## Solution

After resolving the task (by ID when the caller passes `nil`), we now
load its steps with `GetTaskStepsByTaskID(ctx, task.ID)` and set
`task.Steps` before building the API steps slice. No other behavior is
changed.

## Testing

- New integration test `TestAPIListWorkflowRunJobsReturnsSteps`: calls
the runs/{runId}/jobs endpoint, inserts a task step for a fixture job,
and asserts that the response includes non-null, non-empty `steps` with
the expected step data.
- `make test-sqlite#TestAPIListWorkflowRunJobsReturnsSteps` passes with
this fix.

---------

Co-authored-by: Manav <mdave0905@gmail.com>
2026-02-13 08:16:43 +00:00
..
actions Bugfix: Potential incorrect runID in run status update (#36437) 2026-01-23 11:11:56 +00:00
agit Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
asymkey Some refactors about GetMergeBase (#36186) 2026-01-17 11:22:09 -08:00
attachment fix attachment file size limit in server backend (#35519) 2025-10-21 15:07:11 +00:00
auth Refactor Nuget Auth to reuse Basic Auth Token Validation (#36558) 2026-02-08 14:43:05 +00:00
automerge Remove unnecessary function parameter (#35765) 2025-10-31 21:56:08 -07:00
automergequeue Fix various trivial problems (#35714) 2025-10-21 13:19:29 +08:00
context Allow configuring default PR base branch (fixes #36412) (#36425) 2026-02-07 01:34:29 +00:00
contexttest Fix diff view style handling (#36324) 2026-01-09 04:37:16 +00:00
convert BUG: Fix workflow run jobs API returning null steps (#36603) 2026-02-13 08:16:43 +00:00
cron Refactor git command context & pipeline (#36406) 2026-01-21 01:35:14 +00:00
doctor Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
externalaccount Refactor OpenIDConnect to support SSH/FullName sync (#34978) 2025-07-10 18:35:59 +00:00
feed Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
forms Allow configuring default PR base branch (fixes #36412) (#36425) 2026-02-07 01:34:29 +00:00
git Fix bug when list pull request commits (#36485) 2026-01-30 18:46:34 +00:00
gitdiff Refactor highlight and diff (#36599) 2026-02-13 00:15:46 +00:00
indexer Update issue indexer after merging a PR (#30715) 2024-05-08 14:45:15 +00:00
issue Don't create self-references in merged PRs (#36490) 2026-01-30 20:12:24 +00:00
lfs Refactor ActionsTaskID (#36503) 2026-01-31 22:01:08 -08:00
mailer Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
markup Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
migrations Update to go 1.26.0 and golangci-lint 2.9.0 (#36588) 2026-02-11 18:37:13 +01:00
mirror Fix mirror sync parser and fix mirror messages (#36504) 2026-02-11 00:16:05 +00:00
notify Don't send trigger for a pending review's comment create/update/delete (#34928) 2025-07-03 10:35:45 +08:00
oauth2_provider Make OAuth2 issuer configurable (#35915) 2025-11-10 23:45:01 +08:00
org Add more check for stopwatch read or list (#36340) 2026-01-13 13:13:39 +00:00
packages Refactor merge conan and container auth preserve actions taskID (#36560) 2026-02-09 03:04:56 +00:00
projects Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
pull Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
release Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
repository Fix bug when do LFS GC (#36500) 2026-02-12 15:27:19 -08:00
secrets Fix various bugs (#35684) 2025-10-19 00:37:50 +08:00
task Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
uinotification Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
user Release attachments must belong to the intended repo (#36347) 2026-01-14 11:37:53 -08:00
versioned_migration Remove wrong "git.DefaultContext" (#35364) 2025-08-27 16:31:21 +00:00
webhook Refactor ActionsTaskID (#36503) 2026-01-31 22:01:08 -08:00
webtheme Support rendering OpenAPI spec (#36449) 2026-01-26 10:34:38 +08:00
wiki Unify repo names in system notices (#36491) 2026-02-01 17:06:57 +08:00