mirror of
1
Fork 0
forgejo/cmd/forgejo
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.go feat(cli): add `--keep-labels` flag to `forgejo actions register` (#4610) 2024-07-22 07:33:45 +00:00
actions_test.go feat(cli): add `--keep-labels` flag to `forgejo actions register` (#4610) 2024-07-22 07:33:45 +00:00
f3.go fix(f3): do not run the F3 CLI if F3 is disabled 2024-06-16 13:33:33 +02:00
forgejo.go feat(F3): CLI: f3 mirror to convert to/from Forgejo 2024-06-14 12:52:12 +02:00