refactor: remove unreachable runner code (#1179)

Remove inherited act APIs, configuration branches, and test seams that neither the daemon nor exec can reach. Constant-fold settings both entry points already enforce and consolidate duplicate runner paths.

Major removals:

- Unwired custom action-cache and local-repository-cache implementations.
- Legacy matrix, platform, input, container-reuse, logging, Git remote, and action-replacement configuration paths.
- Unused Docker socket, container network, tar-copy, and platform PTY wrappers.
- Single-implementation filesystem, environment, runner, and expression abstractions.
- Duplicated step-container, command-logging, credential, reusable-workflow, and execution paths.
- Generated client mock boilerplate, obsolete fixtures, test-only seams, stale wrappers, and commented-out code.

This removes 2844 net Go lines while retaining Gitea RPC, event, matrix, input, cache, artifact, action, reusable workflow, Docker, host, exec, and release behavior.

Assisted by Codex (GPT-5).

Reviewed-on: https://gitea.com/gitea/runner/pulls/1179
Reviewed-by: bircni <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
silverwind
2026-08-22 16:54:41 +00:00
committed by silverwind
parent a0c4de79f7
commit 546eca312e
71 changed files with 593 additions and 3507 deletions
+3 -11
View File
@@ -85,10 +85,7 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
rc.StepResults[rc.CurrentStep] = stepResult
}
err := setupEnv(ctx, step)
if err != nil {
return err
}
setupEnv(ctx, step)
runStep, err := isStepEnabled(ctx, ifExpression, step, stage)
if err != nil {
@@ -232,7 +229,7 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
}
}
func evaluateStepTimeout(ctx context.Context, exprEval ExpressionEvaluator, stepModel *model.Step) (context.Context, context.CancelFunc) {
func evaluateStepTimeout(ctx context.Context, exprEval *expressionEvaluator, stepModel *model.Step) (context.Context, context.CancelFunc) {
timeout := exprEval.Interpolate(ctx, stepModel.TimeoutMinutes)
if timeout != "" {
if timeOutMinutes, err := strconv.ParseInt(timeout, 10, 64); err == nil {
@@ -242,7 +239,7 @@ func evaluateStepTimeout(ctx context.Context, exprEval ExpressionEvaluator, step
return ctx, func() {}
}
func setupEnv(ctx context.Context, step step) error { //nolint:unparam // pre-existing issue from nektos/act
func setupEnv(ctx context.Context, step step) {
rc := step.getRunContext()
mergeEnv(ctx, step)
@@ -263,11 +260,6 @@ func setupEnv(ctx context.Context, step step) error { //nolint:unparam // pre-ex
(*step.getEnv())[k] = exprEval.Interpolate(ctx, v)
}
}
// For Gitea, reduce log noise
// common.Logger(ctx).Debugf("setupEnv => %v", *step.getEnv())
return nil
}
func mergeEnv(ctx context.Context, step step) {