From 0c3b0fcf175c0e3440b59bc5dd5439c69abbffec Mon Sep 17 00:00:00 2001 From: Christopher Homberger <christopher.homberger@web.de> Date: Wed, 5 Mar 2025 12:59:13 +0100 Subject: [PATCH] notifier ==> notify_service to align with the codebase --- routers/api/actions/runner/runner.go | 4 ++-- routers/web/repo/actions/view.go | 8 ++++---- services/actions/clear_tasks.go | 6 +++--- services/actions/job_emitter.go | 4 ++-- services/actions/notifier_helper.go | 4 ++-- services/actions/schedule_tasks.go | 4 ++-- services/actions/task.go | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/routers/api/actions/runner/runner.go b/routers/api/actions/runner/runner.go index 0b8219e7ea..27a0317942 100644 --- a/routers/api/actions/runner/runner.go +++ b/routers/api/actions/runner/runner.go @@ -15,7 +15,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/util" actions_service "code.gitea.io/gitea/services/actions" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "code.gitea.io/actions-proto-go/runner/v1/runnerv1connect" @@ -221,7 +221,7 @@ func (s *Service) UpdateTask( } if task.Status.IsDone() { - notifier.WorkflowJobStatusUpdate(ctx, task.Job.Run.Repo, task.Job.Run.TriggerUser, task.Job, task) + notify_service.WorkflowJobStatusUpdate(ctx, task.Job.Run.Repo, task.Job.Run.TriggerUser, task.Job, task) } if req.Msg.State.Result != runnerv1.Result_RESULT_UNSPECIFIED { diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index ca48714507..41f0d2d0ec 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -33,7 +33,7 @@ import ( "code.gitea.io/gitea/modules/web" actions_service "code.gitea.io/gitea/services/actions" context_module "code.gitea.io/gitea/services/context" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" "github.com/nektos/act/pkg/model" "xorm.io/builder" @@ -460,7 +460,7 @@ func rerunJob(ctx *context_module.Context, job *actions_model.ActionRunJob, shou actions_service.CreateCommitStatus(ctx, job) _ = job.LoadAttributes(ctx) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) return nil } @@ -559,7 +559,7 @@ func Cancel(ctx *context_module.Context) { for _, job := range updatedjobs { _ = job.LoadAttributes(ctx) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) } ctx.JSON(http.StatusOK, struct{}{}) @@ -605,7 +605,7 @@ func Approve(ctx *context_module.Context) { for _, job := range updatedjobs { _ = job.LoadAttributes(ctx) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) } ctx.JSON(http.StatusOK, struct{}{}) diff --git a/services/actions/clear_tasks.go b/services/actions/clear_tasks.go index 4939afb25d..cf3e99a3ad 100644 --- a/services/actions/clear_tasks.go +++ b/services/actions/clear_tasks.go @@ -14,7 +14,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/timeutil" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" ) // StopZombieTasks stops the task which have running status, but haven't been updated for a long time @@ -71,7 +71,7 @@ func stopTasks(ctx context.Context, opts actions_model.FindTaskOptions) error { CreateCommitStatus(ctx, jobs...) for _, job := range jobs { _ = job.LoadAttributes(ctx) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) } return nil } @@ -103,7 +103,7 @@ func CancelAbandonedJobs(ctx context.Context) error { CreateCommitStatus(ctx, job) if updated { _ = job.LoadAttributes(ctx) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) } } diff --git a/services/actions/job_emitter.go b/services/actions/job_emitter.go index a837998188..c11bb5875f 100644 --- a/services/actions/job_emitter.go +++ b/services/actions/job_emitter.go @@ -12,7 +12,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/queue" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" "github.com/nektos/act/pkg/jobparser" "xorm.io/builder" @@ -76,7 +76,7 @@ func checkJobsOfRun(ctx context.Context, runID int64) error { CreateCommitStatus(ctx, jobs...) for _, job := range updatedjobs { _ = job.LoadAttributes(ctx) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil) } return nil } diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go index 259904261a..800539133c 100644 --- a/services/actions/notifier_helper.go +++ b/services/actions/notifier_helper.go @@ -27,7 +27,7 @@ import ( api "code.gitea.io/gitea/modules/structs" webhook_module "code.gitea.io/gitea/modules/webhook" "code.gitea.io/gitea/services/convert" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" "github.com/nektos/act/pkg/jobparser" "github.com/nektos/act/pkg/model" @@ -365,7 +365,7 @@ func handleWorkflows( } CreateCommitStatus(ctx, alljobs...) for _, job := range alljobs { - notifier.WorkflowJobStatusUpdate(ctx, input.Repo, input.Doer, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, input.Repo, input.Doer, job, nil) } } return nil diff --git a/services/actions/schedule_tasks.go b/services/actions/schedule_tasks.go index a6fe438325..e75941bf71 100644 --- a/services/actions/schedule_tasks.go +++ b/services/actions/schedule_tasks.go @@ -15,7 +15,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/timeutil" webhook_module "code.gitea.io/gitea/modules/webhook" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" "github.com/nektos/act/pkg/jobparser" ) @@ -158,7 +158,7 @@ func CreateScheduleTask(ctx context.Context, cron *actions_model.ActionSchedule) log.Error("LoadAttributes: %v", err) } for _, job := range allJobs { - notifier.WorkflowJobStatusUpdate(ctx, run.Repo, run.TriggerUser, job, nil) + notify_service.WorkflowJobStatusUpdate(ctx, run.Repo, run.TriggerUser, job, nil) } // Return nil if no errors occurred diff --git a/services/actions/task.go b/services/actions/task.go index 610bcbccd7..1feeb67a80 100644 --- a/services/actions/task.go +++ b/services/actions/task.go @@ -10,7 +10,7 @@ import ( actions_model "code.gitea.io/gitea/models/actions" "code.gitea.io/gitea/models/db" secret_model "code.gitea.io/gitea/models/secret" - notifier "code.gitea.io/gitea/services/notify" + notify_service "code.gitea.io/gitea/services/notify" runnerv1 "code.gitea.io/actions-proto-go/runner/v1" "google.golang.org/protobuf/types/known/structpb" @@ -77,7 +77,7 @@ func PickTask(ctx context.Context, runner *actions_model.ActionRunner) (*runnerv } CreateCommitStatus(ctx, job) - notifier.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, actionTask) + notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, actionTask) return task, true, nil }