Skip to content

Commit 4547525

Browse files
GiteaBotwolfogre
andauthored
Remove deprecated stuff for runners (#30930) (#30931)
Backport #30930 by @wolfogre 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`. Co-authored-by: Jason Song <[email protected]>
1 parent df55139 commit 4547525

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

routers/api/actions/runner/interceptor.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import (
2323
const (
2424
uuidHeaderKey = "x-runner-uuid"
2525
tokenHeaderKey = "x-runner-token"
26-
// Deprecated: will be removed after Gitea 1.20 released.
27-
versionHeaderKey = "x-runner-version"
2826
)
2927

3028
var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unaryFunc connect.UnaryFunc) connect.UnaryFunc {
@@ -35,9 +33,6 @@ var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unar
3533
}
3634
uuid := request.Header().Get(uuidHeaderKey)
3735
token := request.Header().Get(tokenHeaderKey)
38-
// TODO: version will be removed from request header after Gitea 1.20 released.
39-
// And Gitea will not try to read version from request header
40-
version := request.Header().Get(versionHeaderKey)
4136

4237
runner, err := actions_model.GetRunnerByUUID(ctx, uuid)
4338
if err != nil {
@@ -51,14 +46,6 @@ var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unar
5146
}
5247

5348
cols := []string{"last_online"}
54-
55-
// TODO: version will be removed from request header after Gitea 1.20 released.
56-
// And Gitea will not try to read version from request header
57-
version, _ = util.SplitStringAtByteN(version, 64)
58-
if !util.IsEmptyString(version) && runner.Version != version {
59-
runner.Version = version
60-
cols = append(cols, "version")
61-
}
6249
runner.LastOnline = timeutil.TimeStampNow()
6350
if methodName == "UpdateTask" || methodName == "UpdateLog" {
6451
runner.LastActive = timeutil.TimeStampNow()

routers/api/actions/runner/runner.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ func (s *Service) Register(
6767
}
6868

6969
labels := req.Msg.Labels
70-
// TODO: agent_labels should be removed from pb after Gitea 1.20 released.
71-
// Old version runner's agent_labels slice is not empty and labels slice is empty.
72-
// And due to compatibility with older versions, it is temporarily marked as Deprecated in pb, so use `//nolint` here.
73-
if len(req.Msg.AgentLabels) > 0 && len(req.Msg.Labels) == 0 { //nolint:staticcheck
74-
labels = req.Msg.AgentLabels //nolint:staticcheck
75-
}
7670

7771
// create new runner
7872
name, _ := util.SplitStringAtByteN(req.Msg.Name, 255)

0 commit comments

Comments
 (0)