forgejo/services/actions
Earl Warren c922ac5f38 fix: de-duplicate Forgejo Actions job names when needed (#8864)
The status of two jobs by the same name shadow each other, they need to be distinct. If two jobs by the same name are found, they are made distinct by adding a `-<occurence number>` suffix.

Resolves forgejo/forgejo#8648

For a given workflow, `jobparser.Parse` will generate one "single" (as opposed to a workflow that can be interpreted to generate multiple jobs)  workflow for each job and then insert them (marshalled as yaml) in the database.

e3bfa5133f/models/actions/run.go (L237-L260)

The name associated with this single workflow is what the runner will receive and it is what will be used to associate the job status with a commit.

Resolves forgejo/forgejo#8648

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.

### Documentation

- [x] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [ ] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/8864): <!--number 8864 --><!--line 0 --><!--description ZGUtZHVwbGljYXRlIEZvcmdlam8gQWN0aW9ucyBqb2IgbmFtZXMgd2hlbiBuZWVkZWQ=-->de-duplicate Forgejo Actions job names when needed<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8864
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-13 06:52:44 +02:00
..
auth.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
auth_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
cleanup.go feat: auto cleanup of offline runners (#7803) 2025-06-08 00:13:37 +02:00
cleanup_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
clear_tasks.go Actions Done Notification (#7491) 2025-04-24 15:15:24 +00:00
commit_status.go chore: github.com/nektos/act is now at code.forgejo.org/forgejo/runner/v9 (#8742) 2025-07-31 13:41:59 +02:00
context.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
context_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
init.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
interface.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
job_emitter.go chore: github.com/nektos/act is now at code.forgejo.org/forgejo/runner/v9 (#8742) 2025-07-31 13:41:59 +02:00
job_emitter_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
job_parser.go fix: de-duplicate Forgejo Actions job names when needed (#8864) 2025-08-13 06:52:44 +02:00
job_parser_test.go fix: de-duplicate Forgejo Actions job names when needed (#8864) 2025-08-13 06:52:44 +02:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
notifier.go fix: disable Forgejo Actions email notifications on recovery (#8374) 2025-07-02 19:23:07 +02:00
notifier_helper.go fix: de-duplicate Forgejo Actions job names when needed (#8864) 2025-08-13 06:52:44 +02:00
notifier_helper_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
rerun.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
rerun_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
schedule_tasks.go fix: de-duplicate Forgejo Actions job names when needed (#8864) 2025-08-13 06:52:44 +02:00
schedule_tasks_test.go bug: Forgejo Actions email notifications are opt-in (#8242) 2025-06-21 13:11:01 +02:00
task.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
variables.go fix: allow Forgejo Actions environment variables starting with CI (#8850) 2025-08-10 22:56:16 +02:00
variables_test.go fix: allow Forgejo Actions environment variables starting with CI (#8850) 2025-08-10 22:56:16 +02:00
workflows.go fix: de-duplicate Forgejo Actions job names when needed (#8864) 2025-08-13 06:52:44 +02:00