apiVersion: mission-control.flanksource.com/v1
kind: View
metadata:
name: pipelines
namespace: mc
spec:
display:
title: Pipelines
icon: github
sidebar: true
cache:
maxAge: 30m
minAge: 1m
refreshTimeout: 30s
panels:
- name: Repository
type: table
query: SELECT COUNT(*) AS value, details->'repository'->>'full_name' as repository FROM workflows GROUP BY details->'repository'->>'full_name'
- name: Average Duration
description: Create Release average duration
type: number
number:
unit: seconds
query: >
SELECT AVG(details->'duration') AS value, details->'repository'->>'full_name' as label
FROM workflows GROUP BY details->'repository'->>'full_name'
columns:
- name: id
type: string
description: The id of the pipeline.
primaryKey: true
hidden: true
- name: name
type: string
description: The name of the pipeline.
- name: repository
type: string
description: The repository of the pipeline.
- name: lastRun
type: datetime
description: The namespace name.
- name: lastRunBy
type: string
description: The chart name.
- name: duration
type: duration
description: The duration of the pipeline.
- name: status
type: status
description: The status of the pipeline.
queries:
workflows:
changes:
limit: 10
search: change_type=GitHubActionRun* @order=-created_at
types:
- GitHubAction::Workflow
mapping:
lastRun: row.details.created_at
lastRunBy: row.details.triggering_actor.login
repository: row.details.repository.full_name
status: >
has(row.details.conclusion) ? row.details.conclusion : 'pending'
duration: timestamp(row.details.updated_at) - timestamp(row.details.run_started_at)