pipelineName -> workflowName

This commit is contained in:
pat-s 2025-01-06 09:44:47 +01:00
parent 5a0c941d34
commit 182051790e
No known key found for this signature in database
GPG key ID: 3C6318841EF78925
2 changed files with 6 additions and 6 deletions

View file

@ -72,7 +72,7 @@ func (r *Runner) Run(runnerCtx, shutdownCtx context.Context) error { //nolint:co
repoName := extractRepositoryName(workflow.Config) // hack
pipelineNumber := extractPipelineNumber(workflow.Config) // hack
pipelineName := extractPipelineName(workflow.Config) // hack
workflowName := extractWorkflowName(workflow.Config) // hack
r.counter.Add(
workflow.ID,
@ -150,7 +150,7 @@ func (r *Runner) Run(runnerCtx, shutdownCtx context.Context) error { //nolint:co
"workflow_id": workflow.ID,
"repo": repoName,
"pipeline_number": pipelineNumber,
"pipeline_name": pipelineName,
"workflowName": workflowName,
}),
).Run(runnerCtx)
@ -200,6 +200,6 @@ func extractPipelineNumber(config *backend.Config) string {
return config.Stages[0].Steps[0].Environment["CI_PIPELINE_NUMBER"]
}
func extractPipelineName(config *backend.Config) string {
func extractWorkflowName(config *backend.Config) string {
return config.Stages[0].Steps[0].Environment["CI_WORKFLOW_NAME"]
}

View file

@ -109,13 +109,13 @@ func (r *Runtime) Run(runnerCtx context.Context) error {
if ctx.Err() != nil {
ctx = GetShutdownCtx()
}
if err := r.engine.DestroyWorkflow(ctx, r.spec, r.taskUUID, r.Description["pipeline_name"]); err != nil {
if err := r.engine.DestroyWorkflow(ctx, r.spec, r.taskUUID, r.Description["workflowName"]); err != nil {
logger.Error().Err(err).Msg("could not destroy engine")
}
}()
r.started = time.Now().Unix()
if err := r.engine.SetupWorkflow(runnerCtx, r.spec, r.taskUUID, r.Description["pipeline_name"]); err != nil {
if err := r.engine.SetupWorkflow(runnerCtx, r.spec, r.taskUUID, r.Description["workflowName"]); err != nil {
return err
}
@ -123,7 +123,7 @@ func (r *Runtime) Run(runnerCtx context.Context) error {
select {
case <-r.ctx.Done():
return ErrCancel
case err := <-r.execAll(stage.Steps, r.Description["pipeline_name"]):
case err := <-r.execAll(stage.Steps, r.Description["workflowName"]):
if err != nil {
r.err = err
}