forgejo/models
Emmanuel BENOÎT fdb1874ada feat(cli): add --keep-labels flag to forgejo actions register (#4610)
This commit adds a new flag, `--keep-labels`, to the runner registration CLI command. If this flag is present and the runner being registered already exists, it will prevent the runners' labels from being reset.

In order to accomplish this, the signature of the `RegisterRunner` function from the `models/actions` package has been modified so that the labels argument can be nil. If it is, the part of the function that updates the record will not change the runner.

Various tests have been added for this function, for the following cases: new runner with labels, new runner without label, existing runner with labels, existing runner without labels.

The flag has been added to the CLI command, the action function has been updated to read the labels parameters through a separate function (`getLabels`), and test cases for this function have been added.

<!--
Before submitting a PR, please read the contributing guidelines:
https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CONTRIBUTING.md
-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4610
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Emmanuel BENOÎT <tseeker@nocternity.net>
Co-committed-by: Emmanuel BENOÎT <tseeker@nocternity.net>
2024-07-22 07:33:45 +00:00
..
actions feat(cli): add --keep-labels flag to forgejo actions register (#4610) 2024-07-22 07:33:45 +00:00
activities Fix web notification icon not updated once you read all notifications (#31447) 2024-06-29 07:33:37 +02:00
admin
asymkey [CHORE] Use github.com/ProtonMail/go-crypto 2024-07-15 17:27:37 +02:00
auth
avatars
db Enable multiStatements for MySQL 2024-07-16 23:16:03 +02:00
dbfs
fixtures feat(cli): add --keep-labels flag to forgejo actions register (#4610) 2024-07-22 07:33:45 +00:00
forgefed
forgejo/semver
forgejo_migrations [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
git Add tag protection via rest api #17862 (#31295) 2024-06-16 13:42:59 +02:00
issues Optimization of labels handling in issue_search (#4228) 2024-06-28 05:11:57 +00:00
migrations Enable multiStatements for MySQL 2024-07-16 23:16:03 +02:00
organization
packages
perm
project
pull
repo Add support for workflow_dispatch (#3334) 2024-06-28 05:17:11 +00:00
secret
shared/types
system
unit
unittest
user [PORT] Use FullName in Emails to address the recipient if possible (gitea#31527) (#4516) 2024-07-17 05:13:59 +00:00
webhook
error.go
fixture_generation.go
fixture_test.go
main_test.go
org.go
org_team.go
org_team_test.go
org_test.go
repo.go
repo_test.go
repo_transfer.go
repo_transfer_test.go