feat: add connections to Runner configuration #1378

Merged
mfenniak merged 1 commit from aahlenst/runner:server-settings into main 2026-02-16 03:32:04 +00:00
Member

Introduce a new configuration element called server that can hold one or more connections. It enables connecting Forgejo Runner to multiple Forgejo instances (not implemented yet). It is planned that server.connections fully replaces the runnner file .runner.

See forgejo/forgejo-actions-feature-requests#88 for background and design considerations.

  • features
    • PR: feat: add connections to Runner configuration
Introduce a new configuration element called `server` that can hold one or more `connections`. It enables connecting Forgejo Runner to multiple Forgejo instances (not implemented yet). It is planned that `server.connections` fully replaces the runnner file `.runner`. See https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/88 for background and design considerations. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - features - [PR](https://code.forgejo.org/forgejo/runner/pulls/1378): <!--number 1378 --><!--line 0 --><!--description ZmVhdDogYWRkIGNvbm5lY3Rpb25zIHRvIFJ1bm5lciBjb25maWd1cmF0aW9u-->feat: add connections to Runner configuration<!--description--> <!--end release-notes-assistant-->
refactor: separate Config from on-disk format
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 37s
checks / Build Forgejo Runner (pull_request) Successful in 43s
checks / validate mocks (pull_request) Successful in 46s
checks / Build unsupported platforms (pull_request) Successful in 20s
checks / runner exec tests (pull_request) Successful in 34s
checks / integration tests (docker-latest) (pull_request) Successful in 8m17s
checks / integration tests (docker-stable) (pull_request) Successful in 10m35s
issue-labels / release-notes (pull_request_target) Successful in 6s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 7s
cascade / forgejo (pull_request_target) Successful in 1m41s
ebb0c4f52a
feat: add connections to Runner configuration
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 1m0s
checks / Build Forgejo Runner (pull_request) Successful in 1m21s
checks / validate mocks (pull_request) Successful in 1m30s
checks / runner exec tests (pull_request) Successful in 48s
checks / Build unsupported platforms (pull_request) Successful in 1m14s
issue-labels / release-notes (pull_request_target) Successful in 5s
checks / integration tests (docker-latest) (pull_request) Successful in 12m41s
checks / integration tests (docker-stable) (pull_request) Successful in 15m2s
803834ba3f
Author
Member

Attention: stacked on top of #1377.

Questions/notes:

  • Connections is a map. Helps generating better diagnostics if multiple connections are present and one is invalid. Advantage of the map: YAML enforces that names are unqiue.
  • Labels are present on each connection, thereby matching .runner. The Runner administrator might not want to make every label available on every connection. Furthermore, different Forgejo instances might have labels with different meanings.
  • Same question regarding naming as in #1377.
  • Should label be an object? Could help if plan on expanding the configuration options for labels. I lean towards no.
  • The connections aren't used yet. I think it makes more sense to switch over while implementing polling of multiple Forgejo instances.
Attention: stacked on top of https://code.forgejo.org/forgejo/runner/pulls/1377. Questions/notes: * `Connections` is a map. Helps generating better diagnostics if multiple connections are present and one is invalid. Advantage of the map: YAML enforces that names are unqiue. * Labels are present on each connection, thereby matching `.runner`. The Runner administrator might not want to make every label available on every connection. Furthermore, different Forgejo instances might have labels with different meanings. * Same question regarding naming as in https://code.forgejo.org/forgejo/runner/pulls/1377. * Should `label` be an object? Could help if plan on expanding the configuration options for labels. I lean towards no. * The connections aren't used yet. I think it makes more sense to switch over while implementing polling of multiple Forgejo instances.
Owner

@aahlenst wrote in #1378 (comment):

* Should `label` be an object? Could help if plan on expanding the configuration options for labels. I lean towards no.

Sure, simple. 👍 I feel this is coming at some point but if we can avoid it, I'm happy.

* The connections aren't used yet. I think it makes more sense to switch over while implementing polling of multiple Forgejo instances.

Sounds good.

@aahlenst wrote in https://code.forgejo.org/forgejo/runner/pulls/1378#issuecomment-78074: > * Should `label` be an object? Could help if plan on expanding the configuration options for labels. I lean towards no. Sure, simple. 👍 I feel this is coming at some point but if we can avoid it, I'm happy. > * The connections aren't used yet. I think it makes more sense to switch over while implementing polling of multiple Forgejo instances. Sounds good.
mfenniak approved these changes 2026-02-16 02:28:11 +00:00
@ -42,0 +85,4 @@
// Connection defines a connection to a Forgejo instance.
type Connection struct {
URL *url.URL // URL of the Forgejo instance to connect to. Mandatory value.
Owner

Why a pointer for this field?

Why a pointer for this field?
Owner

Ah, never mind -- all the methods on url.URL take a pointer receiver. 👍

Ah, never mind -- all the methods on `url.URL` take a pointer receiver. 👍
mfenniak marked this conversation as resolved
mfenniak force-pushed server-settings from 803834ba3f
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 1m0s
checks / Build Forgejo Runner (pull_request) Successful in 1m21s
checks / validate mocks (pull_request) Successful in 1m30s
checks / runner exec tests (pull_request) Successful in 48s
checks / Build unsupported platforms (pull_request) Successful in 1m14s
issue-labels / release-notes (pull_request_target) Successful in 5s
checks / integration tests (docker-latest) (pull_request) Successful in 12m41s
checks / integration tests (docker-stable) (pull_request) Successful in 15m2s
to 7a7aedc9c7
All checks were successful
issue-labels / release-notes (pull_request_target) Successful in 7s
checks / Build Forgejo Runner (pull_request) Successful in 1m45s
checks / validate pre-commit-hooks file (pull_request) Successful in 1m8s
checks / validate mocks (pull_request) Successful in 1m49s
checks / runner exec tests (pull_request) Successful in 43s
checks / Build unsupported platforms (pull_request) Successful in 46s
checks / Run integration tests with Docker (docker-latest) (pull_request) Successful in 16m8s
checks / Run integration tests with Docker (docker-stable) (pull_request) Successful in 18m48s
checks / Run integration tests with Podman (pull_request) Successful in 23m52s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 4s
cascade / forgejo (pull_request_target) Successful in 1m17s
2026-02-16 02:54:11 +00:00
Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner!1378
No description provided.