Commit 48527d80 authored by Ahmad Sherif's avatar Ahmad Sherif

Fix application_settings JOIN condition for CiBuildsProbe

After https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29981, we cannot assume an application_settings
with ID=1 exists. But we know that there will only be one record in that table, so we can change the JOIN
condition to TRUE safely.

Fixes #71
parent ae2b3cda
PATH
remote: .
specs:
gitlab-exporter (7.0.5)
gitlab-exporter (7.0.6)
connection_pool (~> 2.2.1)
pg (~> 1.1)
quantile (~> 0.2.0)
......
......@@ -21,8 +21,7 @@ module GitLab
ON namespaces.id = projects.namespace_id
LEFT JOIN namespace_statistics
ON namespace_statistics.namespace_id = namespaces.id
JOIN application_settings
ON application_settings.id = 1
JOIN application_settings ON (TRUE)
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status = '%s'
-- The created_at filter has been introduced for performance reasons only
......@@ -95,8 +94,7 @@ module GitLab
ON namespaces.id = projects.namespace_id
LEFT JOIN namespace_statistics
ON namespace_statistics.namespace_id = namespaces.id
JOIN application_settings
ON application_settings.id = 1
JOIN application_settings ON (TRUE)
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status = 'running'
-- The created_at filter has been introduced for performance reasons only
......@@ -175,8 +173,7 @@ module GitLab
ON namespaces.id = projects.namespace_id
LEFT JOIN namespace_statistics
ON namespace_statistics.namespace_id = namespaces.id
JOIN application_settings
ON application_settings.id = 1
JOIN application_settings ON (TRUE)
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status IN ('running', 'pending')
-- The created_at filter has been introduced for performance reasons only
......
module GitLab
module Exporter
VERSION = "7.0.5".freeze
VERSION = "7.0.6".freeze
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment