gitforge/models/actions
Andreas Ahlenstorf 85d38e354d fix: ensure runners either belong to owner or repo when updated (#13262)
A runner can either belong to an owner (user, organization) or a repository, not both. While `CreateRunner()` enforces that, `UpdateRunner()` does not, which leads to bugs. With this change, `UpdateRunner()` rejects runners that have _both_ fields set to prevent unexpected ownership changes.

Resolves https://codeberg.org/forgejo/forgejo/issues/12106 and makes https://codeberg.org/forgejo/forgejo/pulls/12117 obsolete.

### Tests for Go changes

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

### Documentation

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

### Release notes

- [x] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change.
- [ ] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13262
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-07-01 03:49:07 +02:00
..
TestActionTask_GetAvailableJobsForRunner feat: enable manual prioritization of workflow runs (#13045) 2026-06-18 00:58:33 +02:00
TestActionTask_GetTasksByRunnerRequestKey
TestRunner_FindRunnerOptionsToConds
TestRunner_GetVisibleRunnerByID
artifact.go feat: make it possible to remove workflow runs (#12478) 2026-05-11 16:02:36 +02:00
forgejo.go
forgejo_test.go fix: ensure runners either belong to owner or repo when updated (#13262) 2026-07-01 03:49:07 +02:00
main_test.go
pre_execution_errors.go
pre_execution_errors_test.go
pre_execution_warnings.go feat: add warnings for usage of unsupported permissions: in Actions workflows (#13164) 2026-06-23 21:30:19 +02:00
pre_execution_warnings_test.go feat: add warnings for usage of unsupported permissions: in Actions workflows (#13164) 2026-06-23 21:30:19 +02:00
run.go feat: add warnings for usage of unsupported permissions: in Actions workflows (#13164) 2026-06-23 21:30:19 +02:00
run_job.go fix: do not hide previous attempts without task for latest attempt (#12779) 2026-05-28 15:16:48 +02:00
run_job_list.go chore: flag suspicious OwnerID comparisons (#12184) 2026-04-19 04:24:09 +02:00
run_job_list_test.go
run_job_status_test.go
run_job_test.go fix: do not hide previous attempts without task for latest attempt (#12779) 2026-05-28 15:16:48 +02:00
run_list.go chore: flag suspicious OwnerID comparisons (#12184) 2026-04-19 04:24:09 +02:00
run_list_test.go
run_priority.go feat: enable manual prioritization of workflow runs (#13045) 2026-06-18 00:58:33 +02:00
run_priority_test.go feat: enable manual prioritization of workflow runs (#13045) 2026-06-18 00:58:33 +02:00
run_test.go feat: enable manual prioritization of workflow runs (#13045) 2026-06-18 00:58:33 +02:00
runner.go fix: ensure runners either belong to owner or repo when updated (#13262) 2026-07-01 03:49:07 +02:00
runner_list.go chore: flag suspicious OwnerID comparisons (#12184) 2026-04-19 04:24:09 +02:00
runner_test.go fix: ensure runners either belong to owner or repo when updated (#13262) 2026-07-01 03:49:07 +02:00
runner_token.go
runner_token_test.go
schedule.go chore: flag suspicious OwnerID comparisons (#12184) 2026-04-19 04:24:09 +02:00
schedule_spec.go chore: replace github.com/robfig/cron/v3 (#12365) 2026-05-01 22:07:22 +02:00
schedule_spec_list.go
schedule_spec_test.go
schedule_test.go fix: use proper ${{ forgejo.ref }} in scheduled workflows (#13081) 2026-06-15 04:15:07 +02:00
status.go
task.go fix: prevent server error when multiple runners fetch same job concurrently on MariaDB 11.8+ (#13204) 2026-06-26 14:55:06 +02:00
task_list.go chore: flag suspicious OwnerID comparisons (#12184) 2026-04-19 04:24:09 +02:00
task_output.go
task_step.go
task_test.go feat: enable manual prioritization of workflow runs (#13045) 2026-06-18 00:58:33 +02:00
tasks_version.go
user.go
user_test.go
utils.go
utils_test.go
variable.go