Fix Security features tables cross-joining `ci_builds` -> Remove `[analyzer]_pipeline` metrics join to ci_builds
From !62092 (comment 626027123) we see that Security::Scan.latest_successful_by_build requires joining from non ci_*
tables to ci_*
tables. When we extract ci_*
tables to a new database this will not be possible.
As such we need to find an alternative approach.
UsageData metrics
The specific metrics are:
config/metrics/counts_28d/20210216182129_sast_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.sast_pipeline
config/metrics/counts_28d/20210216182131_secret_detection_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.secret_detection_pipeline
config/metrics/counts_28d/20210216175618_dast_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.dast_pipeline
ee/config/metrics/counts_28d/20210618125224_cluster_image_scanning_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.cluster_image_scanning_pipeline
ee/config/metrics/counts_28d/20210216175507_container_scanning_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.container_scanning_pipeline
ee/config/metrics/counts_28d/20210216175226_dependency_scanning_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.dependency_scanning_pipeline
ee/config/metrics/counts_28d/20210216180359_coverage_fuzzing_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.coverage_fuzzing_pipeline
ee/config/metrics/counts_28d/20210216180401_api_fuzzing_pipeline.yml:
key_path: usage_activity_by_stage_monthly.secure.api_fuzzing_pipeline
Proposal
These metrics should report for all scans independent of build status or build retried status. This will remove the required join on the ci_builds
table.
Edited by Cameron Swords