Remove deprecated stuff for runners (#30930)

It's time (maybe somewhat late) to remove some deprecated stuff for the
runner.

- `x-runner-version`: runners needn't to report version in every
request, they will call `Declare`.
- `AgentLabels`: runners will report them as `Labels`.

(cherry picked from commit b9396a9b852e4fea0e2c39ef3ef2fdfbc9ea248a)

Conflicts:
	routers/api/actions/runner/interceptor.go
	trivial conflict because
	  e80466f734 Resolve lint for unused parameter and unnecessary type arguments (#30750)
	was not cherry-picked
This commit is contained in:
Jason Song 2024-05-10 16:23:47 +08:00 committed by Earl Warren
parent 1a250c7b2b
commit 38ea77ebbe
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 0 additions and 19 deletions

View file

@ -69,12 +69,6 @@ func (s *Service) Register(
}
labels := req.Msg.Labels
// TODO: agent_labels should be removed from pb after Gitea 1.20 released.
// Old version runner's agent_labels slice is not empty and labels slice is empty.
// And due to compatibility with older versions, it is temporarily marked as Deprecated in pb, so use `//nolint` here.
if len(req.Msg.AgentLabels) > 0 && len(req.Msg.Labels) == 0 { //nolint:staticcheck
labels = req.Msg.AgentLabels //nolint:staticcheck
}
// create new runner
name, _ := util.SplitStringAtByteN(req.Msg.Name, 255)