mirror of https://github.com/go-gitea/gitea
Support changing labels of Actions runner without re-registration (#24806)
close #24540 related: - Protocol: https://gitea.com/gitea/actions-proto-def/pulls/9 - Runner side: https://gitea.com/gitea/act_runner/pulls/201 changes: - Add column of `labels` to table `action_runner`, and combine the value of `agent_labels` and `custom_labels` column to `labels` column. - Store `labels` when registering `act_runner`. - Update `labels` when `act_runner` starting and calling `Declare`. - Users cannot modify the `custom labels` in edit page any more. other changes: - Store `version` when registering `act_runner`. - If runner is latest version, parse version from `Declare`. But older version runner still parse version from request header.pull/25231/head^2
parent
6bbccdd177
commit
8228751c55
@ -0,0 +1,14 @@ |
||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_21 //nolint
|
||||
|
||||
import ( |
||||
"testing" |
||||
|
||||
"code.gitea.io/gitea/models/migrations/base" |
||||
) |
||||
|
||||
func TestMain(m *testing.M) { |
||||
base.MainTest(m) |
||||
} |
@ -0,0 +1,26 @@ |
||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_21 //nolint
|
||||
|
||||
import ( |
||||
"code.gitea.io/gitea/models/migrations/base" |
||||
|
||||
"xorm.io/xorm" |
||||
) |
||||
|
||||
func DropCustomLabelsColumnToActRunner(x *xorm.Engine) error { |
||||
sess := x.NewSession() |
||||
defer sess.Close() |
||||
|
||||
if err := sess.Begin(); err != nil { |
||||
return err |
||||
} |
||||
|
||||
// drop "custom_labels" cols
|
||||
if err := base.DropTableColumns(sess, "action_runner", "custom_labels"); err != nil { |
||||
return err |
||||
} |
||||
|
||||
return sess.Commit() |
||||
} |
Loading…
Reference in new issue