Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions server/api/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,24 @@ func processQueueTasks(store store.Store, tasks []*model.Task, agentNameMap map[
Task: *task,
}

if task.AgentID == 0 {
result = append(result, taskResponse)
continue
}
if task.AgentID != 0 {
name, ok := getAgentName(store, agentNameMap, task.AgentID)
if !ok {
return nil, fmt.Errorf("agent not found for task %s", task.ID)
}

name, ok := getAgentName(store, agentNameMap, task.AgentID)
if !ok {
return nil, fmt.Errorf("agent not found for task %s", task.ID)
taskResponse.AgentName = name
}

taskResponse.AgentName = name
if task.PipelineID != 0 {
p, err := store.GetPipeline(task.PipelineID)
if err != nil {
return nil, fmt.Errorf("pipeline not found for task %s", task.ID)
}

p, err := store.GetPipeline(task.PipelineID)
if err != nil {
return nil, err
taskResponse.PipelineNumber = p.Number
}

taskResponse.PipelineNumber = p.Number

result = append(result, taskResponse)
}
return result, nil
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/admin/AdminQueue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</div>
<div class="ml-2 flex items-center gap-2">
<IconButton
v-if="task.agent_name"
v-if="task.pipeline_number"
icon="chevron-right"
:title="$t('repo.pipeline.view')"
class="h-8 w-8"
Expand Down