Add more ci_builds columns to export to CH ci_finished_builds
The following discussion from !132010 (merged) should be addressed:
-
@vshushlin started a discussion: Follow-up: let's open another issue to investigate what fields we want to add to this database.
It would be nice to add them before we actually sync the data, then we'll have fewer problems in the future.
🔍 Current ClickHouse table definition
CREATE TABLE gitlab_clickhouse_development.ci_finished_builds
(
-- ci_builds
`id` UInt64 DEFAULT 0,
`project_id` UInt64 DEFAULT 0,
`pipeline_id` UInt64 DEFAULT 0,
`status` LowCardinality(String) DEFAULT '',
`created_at` DateTime64(6, 'UTC') DEFAULT now(),
`queued_at` DateTime64(6, 'UTC') DEFAULT now(),
`finished_at` DateTime64(6, 'UTC') DEFAULT now(),
`started_at` DateTime64(6, 'UTC') DEFAULT now(),
-- ci_runners
`runner_id` UInt64 DEFAULT 0,
`runner_manager_system_xid` String DEFAULT '',
`runner_run_untagged` Bool DEFAULT false,
`runner_type` UInt8 DEFAULT 0,
-- ci_runner_machines
`runner_manager_version` LowCardinality(String) DEFAULT '',
`runner_manager_revision` LowCardinality(String) DEFAULT '',
`runner_manager_platform` LowCardinality(String) DEFAULT '',
`runner_manager_architecture` LowCardinality(String) DEFAULT '',
-- computed fields
`duration` Int64 MATERIALIZED age('second', started_at, finished_at),
`queueing_duration` Int64 MATERIALIZED age('second', queued_at, started_at)
)
ENGINE = ReplacingMergeTree
PARTITION BY toYear(finished_at)
ORDER BY (status, runner_type, project_id, finished_at, id)
This table definition powers the graph in #390921[new.png].
Edited by Pedro Pombeiro