1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-05 18:40:59 +00:00
forgejo-runner/internal/pkg/report
Earl Warren b8f8b0f674
fix: an error from a SKIPPED job does not transform it into a FAILURE (#896)
The result of a job can only be changed to FAILURE by the Close() function of the reporter under two conditions:

- If it is UNSPECIFIED
- If the context timeout

In all other cases it must be preserved. It is possible, for instance, for a job to be SKIPPED and be associated with an error message, e.g.

```
time="2025-08-20T21:02:07+02:00" level=trace msg="evaluating expression 'success()'" dryrun=false job="Test Action/job-1" jobID=job-1 matrix="map[]"
[Test Action/job-1] [DEBUG] evaluating expression 'success()'
time="2025-08-20T21:02:07+02:00" level=trace msg="expression 'success()' evaluated to 'true'" dryrun=false job="Test Action/job-1" jobID=job-1 matrix="map[]"
[Test Action/job-1] [DEBUG] expression 'success()' evaluated to 'true'
time="2025-08-20T21:02:07+02:00" level=trace msg="'runs-on' key not defined in Test Action/job-1" dryrun=false job="Test Action/job-1" jobID=job-1 matrix="map[]"
[Test Action/job-1] 'runs-on' key not defined in Test Action/job-1
[Test Action/job-1] [DEBUG] No steps found
```

Those errors show in the logs when a job is skipped, because the worflow is empty. But they are expected and to be ignored.

Refs forgejo/runner#895

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/896): <!--number 896 --><!--line 0 --><!--description Zml4OiBhbiBlcnJvciBmcm9tIGEgU0tJUFBFRCBqb2IgZG9lcyBub3QgdHJhbnNmb3JtIGl0IGludG8gYSBGQUlMVVJF-->fix: an error from a SKIPPED job does not transform it into a FAILURE<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/896
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-20 22:02:43 +00:00
..
mask.go fix(security): multline secrets trivially transformed are redacted (#845) 2025-08-11 18:56:35 +00:00
mask_test.go fix(security): multline secrets trivially transformed are redacted (#845) 2025-08-11 18:56:35 +00:00
reporter.go fix: an error from a SKIPPED job does not transform it into a FAILURE (#896) 2025-08-20 22:02:43 +00:00
reporter_test.go fix: an error from a SKIPPED job does not transform it into a FAILURE (#896) 2025-08-20 22:02:43 +00:00