Multiple stop actions for an environment introduces N+1 DB queries in Environment serializer
Multi stop_action for an environment feature implemented in !84922 (merged) introduces N+1 database queries in Environment Serializer.
Related discussion from review !83024 (comment 904048370)
1) EE::EnvironmentSerializer behaves like avoid N+1 on environments serialization avoids N+1 database queries with grouping
Failure/Error: expect { serialize(grouping: true) }.not_to exceed_query_limit(control.count)
Expected a maximum of 68 queries, got 82:
SELECT COUNT(*) AS count_all, COALESCE(environment_type, name) AS coalesce_environment_type_name FROM "environments" WHERE "environments"."project_id" = 371 GROUP BY COALESCE(environment_type, name) LIMIT 10001 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT COALESCE(environment_type, name) AS folder, COUNT(*) AS size, MAX(id) AS last_id FROM "environments" WHERE "environments"."project_id" = 371 GROUP BY COALESCE(environment_type, name) ORDER BY folder ASC LIMIT 20 OFFSET 0 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "environments".* FROM "environments" WHERE "environments"."project_id" = 371 AND "environments"."id" IN (395, 396, 397) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" = 848 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "alert_management_alerts".* FROM "alert_management_alerts" WHERE ("alert_management_alerts"."status" IN (0,1)) AND "alert_management_alerts"."environment_id" IN (395, 396, 397) ORDER BY "alert_management_alerts"."severity" ASC, "alert_management_alerts"."started_at" DESC /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "prometheus_alerts".* FROM "prometheus_alerts" WHERE "prometheus_alerts"."id" IN (10, 9, 8) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "deployments".* FROM ((SELECT "deployments".* FROM "deployments" WHERE "deployments"."environment_id" = 395 AND "deployments"."status" = 2 ORDER BY "deployments"."finished_at" DESC LIMIT 1) UNION (SELECT "deployments".* FROM "deployments" WHERE "deployments"."environment_id" = 396 AND "deployments"."status" = 2 ORDER BY "deployments"."finished_at" DESC LIMIT 1) UNION (SELECT "deployments".* FROM "deployments" WHERE "deployments"."environment_id" = 397 AND "deployments"."status" = 2 ORDER BY "deployments"."finished_at" DESC LIMIT 1)) deployments /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "users".* FROM "users" WHERE "users"."id" = 478 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."id" IN (259, 261, 263) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds_metadata"."project_id", "ci_builds_metadata"."timeout", "ci_builds_metadata"."timeout_source", "ci_builds_metadata"."interruptible", "ci_builds_metadata"."config_options", "ci_builds_metadata"."config_variables", "ci_builds_metadata"."has_exposed_artifacts", "ci_builds_metadata"."environment_auto_stop_in", "ci_builds_metadata"."expanded_environment_name", "ci_builds_metadata"."secrets", "ci_builds_metadata"."build_id", "ci_builds_metadata"."id", "ci_builds_metadata"."runtime_runner_features" FROM "ci_builds_metadata" WHERE "ci_builds_metadata"."build_id" IN (259, 261, 263) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (214, 216, 218) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'manual' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'manual') AND "ci_builds"."commit_id" IN (214, 216, 218) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'delayed' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'scheduled') AND "ci_builds"."commit_id" IN (214, 216, 218) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" = 848 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "deployment_approvals".* FROM "deployment_approvals" WHERE "deployment_approvals"."deployment_id" IN (210, 212, 214) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "deployments".* FROM ((SELECT DISTINCT ON (environment_id) deployments.* FROM "deployments" WHERE "deployments"."environment_id" = 395 AND "deployments"."status" IN (6, 1) ORDER BY environment_id, deployments.id DESC LIMIT 1) UNION (SELECT DISTINCT ON (environment_id) deployments.* FROM "deployments" WHERE "deployments"."environment_id" = 396 AND "deployments"."status" IN (6, 1) ORDER BY environment_id, deployments.id DESC LIMIT 1) UNION (SELECT DISTINCT ON (environment_id) deployments.* FROM "deployments" WHERE "deployments"."environment_id" = 397 AND "deployments"."status" IN (6, 1) ORDER BY environment_id, deployments.id DESC LIMIT 1)) deployments /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "users".* FROM "users" WHERE "users"."id" = 478 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."id" IN (264, 260, 262) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds_metadata"."project_id", "ci_builds_metadata"."timeout", "ci_builds_metadata"."timeout_source", "ci_builds_metadata"."interruptible", "ci_builds_metadata"."config_options", "ci_builds_metadata"."config_variables", "ci_builds_metadata"."has_exposed_artifacts", "ci_builds_metadata"."environment_auto_stop_in", "ci_builds_metadata"."expanded_environment_name", "ci_builds_metadata"."secrets", "ci_builds_metadata"."build_id", "ci_builds_metadata"."id", "ci_builds_metadata"."runtime_runner_features" FROM "ci_builds_metadata" WHERE "ci_builds_metadata"."build_id" IN (260, 262, 264) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (215, 217, 219) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'manual' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'manual') AND "ci_builds"."commit_id" IN (215, 217, 219) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'delayed' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'scheduled') AND "ci_builds"."commit_id" IN (215, 217, 219) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" = 848 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "deployment_approvals".* FROM "deployment_approvals" WHERE "deployment_approvals"."deployment_id" IN (215, 211, 213) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "users".* FROM "users" WHERE "users"."id" IN (479, 481, 483) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 371 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 371 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
WITH RECURSIVE "base_and_ancestors" AS ((SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 848)
UNION
(SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = "base_and_ancestors"."parent_id")) SELECT "id" FROM "base_and_ancestors" AS "namespaces" /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 AND "protected_environments"."name" IN ('environment1', 'environment2', 'environment3') /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "protected_environment_deploy_access_levels".* FROM "protected_environment_deploy_access_levels" WHERE "protected_environment_deploy_access_levels"."protected_environment_id" IN (8, 9, 10) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
WITH RECURSIVE "clusters_cte" AS ((SELECT "clusters".*, NULL AS group_parent_id, 0 AS depth FROM "clusters" INNER JOIN "cluster_projects" ON "cluster_projects"."cluster_id" = "clusters"."id" INNER JOIN "projects" ON "projects"."id" = "cluster_projects"."project_id" WHERE "clusters"."management_project_id" = 371 AND "clusters"."cluster_type" = 3 AND "projects"."namespace_id" = 848)
UNION
(SELECT "clusters".*, "projects"."namespace_id" AS group_parent_id, 1 AS depth FROM "projects" LEFT OUTER JOIN "cluster_projects" ON "cluster_projects"."project_id" = "projects"."id" LEFT OUTER JOIN "clusters" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "projects"."id" = 371)
UNION
(SELECT "clusters".*, "namespaces"."parent_id" AS group_parent_id, ("clusters_cte"."depth" + 1) FROM "clusters_cte", "namespaces" LEFT OUTER JOIN cluster_groups ON cluster_groups.group_id = namespaces.id LEFT OUTER JOIN clusters ON cluster_groups.cluster_id = clusters.id WHERE "namespaces"."id" = "clusters_cte"."group_parent_id")) SELECT "clusters".* FROM "clusters_cte" "clusters" WHERE "clusters"."id" IS NOT NULL AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment1') OR
'environment1' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY (CASE clusters.management_project_id
WHEN 371 THEN 0
ELSE depth
END) ASC
, CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment1' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "clusters".* FROM "clusters" WHERE "clusters"."cluster_type" = 1 AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment1') OR
'environment1' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment1' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "integrations"."id", "integrations"."project_id", "integrations"."created_at", "integrations"."updated_at", "integrations"."active", "integrations"."properties", "integrations"."push_events", "integrations"."issues_events", "integrations"."merge_requests_events", "integrations"."tag_push_events", "integrations"."note_events", "integrations"."category", "integrations"."wiki_page_events", "integrations"."pipeline_events", "integrations"."confidential_issues_events", "integrations"."commit_events", "integrations"."job_events", "integrations"."confidential_note_events", "integrations"."deployment_events", "integrations"."comment_on_event_enabled", "integrations"."instance", "integrations"."comment_detail", "integrations"."inherit_from_id", "integrations"."alert_events", "integrations"."group_id", "integrations"."type_new", "integrations"."vulnerability_events", "integrations"."archive_trace_events", "integrations"."encrypted_properties", "integrations"."encrypted_properties_iv" FROM "integrations" WHERE "integrations"."project_id" = 371 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "integrations"."id", "integrations"."project_id", "integrations"."created_at", "integrations"."updated_at", "integrations"."active", "integrations"."properties", "integrations"."push_events", "integrations"."issues_events", "integrations"."merge_requests_events", "integrations"."tag_push_events", "integrations"."note_events", "integrations"."category", "integrations"."wiki_page_events", "integrations"."pipeline_events", "integrations"."confidential_issues_events", "integrations"."commit_events", "integrations"."job_events", "integrations"."confidential_note_events", "integrations"."deployment_events", "integrations"."comment_on_event_enabled", "integrations"."instance", "integrations"."comment_detail", "integrations"."inherit_from_id", "integrations"."alert_events", "integrations"."group_id", "integrations"."type_new", "integrations"."vulnerability_events", "integrations"."archive_trace_events", "integrations"."encrypted_properties", "integrations"."encrypted_properties_iv" FROM "integrations" WHERE "integrations"."instance" = TRUE AND "integrations"."type_new" IN ('Integrations::Asana', 'Integrations::Assembla', 'Integrations::Bamboo', 'Integrations::Bugzilla', 'Integrations::Buildkite', 'Integrations::Campfire', 'Integrations::Confluence', 'Integrations::CustomIssueTracker', 'Integrations::Datadog', 'Integrations::Discord', 'Integrations::DroneCi', 'Integrations::EmailsOnPush', 'Integrations::Ewm', 'Integrations::ExternalWiki', 'Integrations::Flowdock', 'Integrations::HangoutsChat', 'Integrations::Harbor', 'Integrations::Irker', 'Integrations::Jira', 'Integrations::Mattermost', 'Integrations::MattermostSlashCommands', 'Integrations::MicrosoftTeams', 'Integrations::Packagist', 'Integrations::PipelinesEmail', 'Integrations::Pivotaltracker', 'Integrations::Prometheus', 'Integrations::Pushover', 'Integrations::Redmine', 'Integrations::Slack', 'Integrations::SlackSlashCommands', 'Integrations::Teamcity', 'Integrations::UnifyCircuit', 'Integrations::WebexTeams', 'Integrations::Youtrack', 'Integrations::Zentao') /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 848 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 259 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 259 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 214 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 259 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 259 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 214 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "deployments".* FROM "deployments" WHERE "deployments"."status" = 2 AND "deployments"."environment_id" = 395 AND "deployments"."deployable_id" = 259 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 848 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
WITH RECURSIVE "clusters_cte" AS ((SELECT "clusters".*, NULL AS group_parent_id, 0 AS depth FROM "clusters" INNER JOIN "cluster_projects" ON "cluster_projects"."cluster_id" = "clusters"."id" INNER JOIN "projects" ON "projects"."id" = "cluster_projects"."project_id" WHERE "clusters"."management_project_id" = 371 AND "clusters"."cluster_type" = 3 AND "projects"."namespace_id" = 848)
UNION
(SELECT "clusters".*, "projects"."namespace_id" AS group_parent_id, 1 AS depth FROM "projects" LEFT OUTER JOIN "cluster_projects" ON "cluster_projects"."project_id" = "projects"."id" LEFT OUTER JOIN "clusters" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "projects"."id" = 371)
UNION
(SELECT "clusters".*, "namespaces"."parent_id" AS group_parent_id, ("clusters_cte"."depth" + 1) FROM "clusters_cte", "namespaces" LEFT OUTER JOIN cluster_groups ON cluster_groups.group_id = namespaces.id LEFT OUTER JOIN clusters ON cluster_groups.cluster_id = clusters.id WHERE "namespaces"."id" = "clusters_cte"."group_parent_id")) SELECT "clusters".* FROM "clusters_cte" "clusters" WHERE "clusters"."id" IS NOT NULL AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment2') OR
'environment2' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY (CASE clusters.management_project_id
WHEN 371 THEN 0
ELSE depth
END) ASC
, CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment2' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "clusters".* FROM "clusters" WHERE "clusters"."cluster_type" = 1 AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment2') OR
'environment2' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment2' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 261 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 261 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 216 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 261 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 261 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 216 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "deployments".* FROM "deployments" WHERE "deployments"."status" = 2 AND "deployments"."environment_id" = 396 AND "deployments"."deployable_id" = 261 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
WITH RECURSIVE "clusters_cte" AS ((SELECT "clusters".*, NULL AS group_parent_id, 0 AS depth FROM "clusters" INNER JOIN "cluster_projects" ON "cluster_projects"."cluster_id" = "clusters"."id" INNER JOIN "projects" ON "projects"."id" = "cluster_projects"."project_id" WHERE "clusters"."management_project_id" = 371 AND "clusters"."cluster_type" = 3 AND "projects"."namespace_id" = 848)
UNION
(SELECT "clusters".*, "projects"."namespace_id" AS group_parent_id, 1 AS depth FROM "projects" LEFT OUTER JOIN "cluster_projects" ON "cluster_projects"."project_id" = "projects"."id" LEFT OUTER JOIN "clusters" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "projects"."id" = 371)
UNION
(SELECT "clusters".*, "namespaces"."parent_id" AS group_parent_id, ("clusters_cte"."depth" + 1) FROM "clusters_cte", "namespaces" LEFT OUTER JOIN cluster_groups ON cluster_groups.group_id = namespaces.id LEFT OUTER JOIN clusters ON cluster_groups.cluster_id = clusters.id WHERE "namespaces"."id" = "clusters_cte"."group_parent_id")) SELECT "clusters".* FROM "clusters_cte" "clusters" WHERE "clusters"."id" IS NOT NULL AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment3') OR
'environment3' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY (CASE clusters.management_project_id
WHEN 371 THEN 0
ELSE depth
END) ASC
, CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment3' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "clusters".* FROM "clusters" WHERE "clusters"."cluster_type" = 1 AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment3') OR
'environment3' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment3' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 263 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 263 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 218 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 263 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 263 LIMIT 1) LIMIT 1 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 218 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:ci*/
SELECT "deployments".* FROM "deployments" WHERE "deployments"."status" = 2 AND "deployments"."environment_id" = 397 AND "deployments"."deployable_id" = 263 /*application:test,correlation_id:c36713b8dcad8649dbfdf0f629b3750d,db_config_name:main*/
Shared Example Group: "avoid N+1 on environments serialization" called from ./ee/spec/serializers/ee/environment_serializer_spec.rb:17
# ./spec/support/shared_examples/serializers/environment_serializer_shared_examples.rb:11:in `block (2 levels) in <main>'
# ./spec/spec_helper.rb:422:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:413:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:409:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:48:in `with_raw_context'
# ./spec/spec_helper.rb:409:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:387:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/with_request_store.rb:17:in `enabling_request_store'
# ./lib/gitlab/with_request_store.rb:10:in `with_request_store'
# ./spec/spec_helper.rb:387:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:267:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
2) EE::EnvironmentSerializer behaves like avoid N+1 on environments serialization avoids N+1 database queries without grouping
Failure/Error: expect { serialize(grouping: false) }.not_to exceed_query_limit(control.count)
Expected a maximum of 67 queries, got 81:
SELECT COUNT(*) FROM (SELECT 1 AS one FROM "environments" WHERE "environments"."project_id" = 371 LIMIT 10001) subquery_for_count /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "environments".* FROM "environments" WHERE "environments"."project_id" = 371 ORDER BY "environments"."id" ASC LIMIT 20 OFFSET 0 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" = 848 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "alert_management_alerts".* FROM "alert_management_alerts" WHERE ("alert_management_alerts"."status" IN (0,1)) AND "alert_management_alerts"."environment_id" IN (398, 399, 400) ORDER BY "alert_management_alerts"."severity" ASC, "alert_management_alerts"."started_at" DESC /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "prometheus_alerts".* FROM "prometheus_alerts" WHERE "prometheus_alerts"."id" IN (13, 12, 11) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "deployments".* FROM ((SELECT "deployments".* FROM "deployments" WHERE "deployments"."environment_id" = 398 AND "deployments"."status" = 2 ORDER BY "deployments"."finished_at" DESC LIMIT 1) UNION (SELECT "deployments".* FROM "deployments" WHERE "deployments"."environment_id" = 399 AND "deployments"."status" = 2 ORDER BY "deployments"."finished_at" DESC LIMIT 1) UNION (SELECT "deployments".* FROM "deployments" WHERE "deployments"."environment_id" = 400 AND "deployments"."status" = 2 ORDER BY "deployments"."finished_at" DESC LIMIT 1)) deployments /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "users".* FROM "users" WHERE "users"."id" = 478 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."id" IN (267, 265, 269) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds_metadata"."project_id", "ci_builds_metadata"."timeout", "ci_builds_metadata"."timeout_source", "ci_builds_metadata"."interruptible", "ci_builds_metadata"."config_options", "ci_builds_metadata"."config_variables", "ci_builds_metadata"."has_exposed_artifacts", "ci_builds_metadata"."environment_auto_stop_in", "ci_builds_metadata"."expanded_environment_name", "ci_builds_metadata"."secrets", "ci_builds_metadata"."build_id", "ci_builds_metadata"."id", "ci_builds_metadata"."runtime_runner_features" FROM "ci_builds_metadata" WHERE "ci_builds_metadata"."build_id" IN (265, 267, 269) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (220, 222, 224) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'manual' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'manual') AND "ci_builds"."commit_id" IN (220, 222, 224) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'delayed' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'scheduled') AND "ci_builds"."commit_id" IN (220, 222, 224) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" = 848 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "deployment_approvals".* FROM "deployment_approvals" WHERE "deployment_approvals"."deployment_id" IN (218, 216, 220) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "deployments".* FROM ((SELECT DISTINCT ON (environment_id) deployments.* FROM "deployments" WHERE "deployments"."environment_id" = 398 AND "deployments"."status" IN (6, 1) ORDER BY environment_id, deployments.id DESC LIMIT 1) UNION (SELECT DISTINCT ON (environment_id) deployments.* FROM "deployments" WHERE "deployments"."environment_id" = 399 AND "deployments"."status" IN (6, 1) ORDER BY environment_id, deployments.id DESC LIMIT 1) UNION (SELECT DISTINCT ON (environment_id) deployments.* FROM "deployments" WHERE "deployments"."environment_id" = 400 AND "deployments"."status" IN (6, 1) ORDER BY environment_id, deployments.id DESC LIMIT 1)) deployments /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "users".* FROM "users" WHERE "users"."id" = 478 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."id" IN (268, 266, 270) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds_metadata"."project_id", "ci_builds_metadata"."timeout", "ci_builds_metadata"."timeout_source", "ci_builds_metadata"."interruptible", "ci_builds_metadata"."config_options", "ci_builds_metadata"."config_variables", "ci_builds_metadata"."has_exposed_artifacts", "ci_builds_metadata"."environment_auto_stop_in", "ci_builds_metadata"."expanded_environment_name", "ci_builds_metadata"."secrets", "ci_builds_metadata"."build_id", "ci_builds_metadata"."id", "ci_builds_metadata"."runtime_runner_features" FROM "ci_builds_metadata" WHERE "ci_builds_metadata"."build_id" IN (266, 268, 270) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (221, 223, 225) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'manual' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'manual') AND "ci_builds"."commit_id" IN (221, 223, 225) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND "ci_builds"."when" = 'delayed' AND "ci_builds"."status" IN ('success', 'failed', 'canceled', 'skipped', 'scheduled') AND "ci_builds"."commit_id" IN (221, 223, 225) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" = 848 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "deployment_approvals".* FROM "deployment_approvals" WHERE "deployment_approvals"."deployment_id" IN (219, 217, 221) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "users".* FROM "users" WHERE "users"."id" IN (485, 487, 489) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 371 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 371 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
WITH RECURSIVE "base_and_ancestors" AS ((SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 848)
UNION
(SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = "base_and_ancestors"."parent_id")) SELECT "id" FROM "base_and_ancestors" AS "namespaces" /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "protected_environments".* FROM "protected_environments" WHERE "protected_environments"."project_id" = 371 AND "protected_environments"."name" IN ('environment4', 'environment5', 'environment6') /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "protected_environment_deploy_access_levels".* FROM "protected_environment_deploy_access_levels" WHERE "protected_environment_deploy_access_levels"."protected_environment_id" IN (11, 12, 13) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
WITH RECURSIVE "clusters_cte" AS ((SELECT "clusters".*, NULL AS group_parent_id, 0 AS depth FROM "clusters" INNER JOIN "cluster_projects" ON "cluster_projects"."cluster_id" = "clusters"."id" INNER JOIN "projects" ON "projects"."id" = "cluster_projects"."project_id" WHERE "clusters"."management_project_id" = 371 AND "clusters"."cluster_type" = 3 AND "projects"."namespace_id" = 848)
UNION
(SELECT "clusters".*, "projects"."namespace_id" AS group_parent_id, 1 AS depth FROM "projects" LEFT OUTER JOIN "cluster_projects" ON "cluster_projects"."project_id" = "projects"."id" LEFT OUTER JOIN "clusters" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "projects"."id" = 371)
UNION
(SELECT "clusters".*, "namespaces"."parent_id" AS group_parent_id, ("clusters_cte"."depth" + 1) FROM "clusters_cte", "namespaces" LEFT OUTER JOIN cluster_groups ON cluster_groups.group_id = namespaces.id LEFT OUTER JOIN clusters ON cluster_groups.cluster_id = clusters.id WHERE "namespaces"."id" = "clusters_cte"."group_parent_id")) SELECT "clusters".* FROM "clusters_cte" "clusters" WHERE "clusters"."id" IS NOT NULL AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment4') OR
'environment4' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY (CASE clusters.management_project_id
WHEN 371 THEN 0
ELSE depth
END) ASC
, CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment4' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "clusters".* FROM "clusters" WHERE "clusters"."cluster_type" = 1 AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment4') OR
'environment4' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment4' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "integrations"."id", "integrations"."project_id", "integrations"."created_at", "integrations"."updated_at", "integrations"."active", "integrations"."properties", "integrations"."push_events", "integrations"."issues_events", "integrations"."merge_requests_events", "integrations"."tag_push_events", "integrations"."note_events", "integrations"."category", "integrations"."wiki_page_events", "integrations"."pipeline_events", "integrations"."confidential_issues_events", "integrations"."commit_events", "integrations"."job_events", "integrations"."confidential_note_events", "integrations"."deployment_events", "integrations"."comment_on_event_enabled", "integrations"."instance", "integrations"."comment_detail", "integrations"."inherit_from_id", "integrations"."alert_events", "integrations"."group_id", "integrations"."type_new", "integrations"."vulnerability_events", "integrations"."archive_trace_events", "integrations"."encrypted_properties", "integrations"."encrypted_properties_iv" FROM "integrations" WHERE "integrations"."project_id" = 371 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "integrations"."id", "integrations"."project_id", "integrations"."created_at", "integrations"."updated_at", "integrations"."active", "integrations"."properties", "integrations"."push_events", "integrations"."issues_events", "integrations"."merge_requests_events", "integrations"."tag_push_events", "integrations"."note_events", "integrations"."category", "integrations"."wiki_page_events", "integrations"."pipeline_events", "integrations"."confidential_issues_events", "integrations"."commit_events", "integrations"."job_events", "integrations"."confidential_note_events", "integrations"."deployment_events", "integrations"."comment_on_event_enabled", "integrations"."instance", "integrations"."comment_detail", "integrations"."inherit_from_id", "integrations"."alert_events", "integrations"."group_id", "integrations"."type_new", "integrations"."vulnerability_events", "integrations"."archive_trace_events", "integrations"."encrypted_properties", "integrations"."encrypted_properties_iv" FROM "integrations" WHERE "integrations"."instance" = TRUE AND "integrations"."type_new" IN ('Integrations::Asana', 'Integrations::Assembla', 'Integrations::Bamboo', 'Integrations::Bugzilla', 'Integrations::Buildkite', 'Integrations::Campfire', 'Integrations::Confluence', 'Integrations::CustomIssueTracker', 'Integrations::Datadog', 'Integrations::Discord', 'Integrations::DroneCi', 'Integrations::EmailsOnPush', 'Integrations::Ewm', 'Integrations::ExternalWiki', 'Integrations::Flowdock', 'Integrations::HangoutsChat', 'Integrations::Harbor', 'Integrations::Irker', 'Integrations::Jira', 'Integrations::Mattermost', 'Integrations::MattermostSlashCommands', 'Integrations::MicrosoftTeams', 'Integrations::Packagist', 'Integrations::PipelinesEmail', 'Integrations::Pivotaltracker', 'Integrations::Prometheus', 'Integrations::Pushover', 'Integrations::Redmine', 'Integrations::Slack', 'Integrations::SlackSlashCommands', 'Integrations::Teamcity', 'Integrations::UnifyCircuit', 'Integrations::WebexTeams', 'Integrations::Youtrack', 'Integrations::Zentao') /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 848 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 265 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 265 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 220 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 265 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 265 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 220 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "deployments".* FROM "deployments" WHERE "deployments"."status" = 2 AND "deployments"."environment_id" = 398 AND "deployments"."deployable_id" = 265 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "namespaces"."id", "namespaces"."name", "namespaces"."path", "namespaces"."owner_id", "namespaces"."created_at", "namespaces"."updated_at", "namespaces"."type", "namespaces"."description", "namespaces"."avatar", "namespaces"."membership_lock", "namespaces"."share_with_group_lock", "namespaces"."visibility_level", "namespaces"."request_access_enabled", "namespaces"."ldap_sync_status", "namespaces"."ldap_sync_error", "namespaces"."ldap_sync_last_update_at", "namespaces"."ldap_sync_last_successful_update_at", "namespaces"."ldap_sync_last_sync_at", "namespaces"."description_html", "namespaces"."lfs_enabled", "namespaces"."parent_id", "namespaces"."shared_runners_minutes_limit", "namespaces"."repository_size_limit", "namespaces"."require_two_factor_authentication", "namespaces"."two_factor_grace_period", "namespaces"."cached_markdown_version", "namespaces"."project_creation_level", "namespaces"."runners_token", "namespaces"."file_template_project_id", "namespaces"."saml_discovery_token", "namespaces"."runners_token_encrypted", "namespaces"."custom_project_templates_group_id", "namespaces"."auto_devops_enabled", "namespaces"."extra_shared_runners_minutes_limit", "namespaces"."last_ci_minutes_notification_at", "namespaces"."last_ci_minutes_usage_notification_level", "namespaces"."subgroup_creation_level", "namespaces"."emails_disabled", "namespaces"."max_pages_size", "namespaces"."max_artifacts_size", "namespaces"."mentions_disabled", "namespaces"."default_branch_protection", "namespaces"."unlock_membership_to_ldap", "namespaces"."max_personal_access_token_lifetime", "namespaces"."push_rule_id", "namespaces"."shared_runners_enabled", "namespaces"."allow_descendants_override_disabled_shared_runners", "namespaces"."traversal_ids" FROM "namespaces" WHERE "namespaces"."id" = 848 LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 848 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
WITH RECURSIVE "clusters_cte" AS ((SELECT "clusters".*, NULL AS group_parent_id, 0 AS depth FROM "clusters" INNER JOIN "cluster_projects" ON "cluster_projects"."cluster_id" = "clusters"."id" INNER JOIN "projects" ON "projects"."id" = "cluster_projects"."project_id" WHERE "clusters"."management_project_id" = 371 AND "clusters"."cluster_type" = 3 AND "projects"."namespace_id" = 848)
UNION
(SELECT "clusters".*, "projects"."namespace_id" AS group_parent_id, 1 AS depth FROM "projects" LEFT OUTER JOIN "cluster_projects" ON "cluster_projects"."project_id" = "projects"."id" LEFT OUTER JOIN "clusters" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "projects"."id" = 371)
UNION
(SELECT "clusters".*, "namespaces"."parent_id" AS group_parent_id, ("clusters_cte"."depth" + 1) FROM "clusters_cte", "namespaces" LEFT OUTER JOIN cluster_groups ON cluster_groups.group_id = namespaces.id LEFT OUTER JOIN clusters ON cluster_groups.cluster_id = clusters.id WHERE "namespaces"."id" = "clusters_cte"."group_parent_id")) SELECT "clusters".* FROM "clusters_cte" "clusters" WHERE "clusters"."id" IS NOT NULL AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment5') OR
'environment5' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY (CASE clusters.management_project_id
WHEN 371 THEN 0
ELSE depth
END) ASC
, CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment5' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "clusters".* FROM "clusters" WHERE "clusters"."cluster_type" = 1 AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment5') OR
'environment5' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment5' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 267 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 267 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 222 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 267 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 267 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 222 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "deployments".* FROM "deployments" WHERE "deployments"."status" = 2 AND "deployments"."environment_id" = 399 AND "deployments"."deployable_id" = 267 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
WITH RECURSIVE "clusters_cte" AS ((SELECT "clusters".*, NULL AS group_parent_id, 0 AS depth FROM "clusters" INNER JOIN "cluster_projects" ON "cluster_projects"."cluster_id" = "clusters"."id" INNER JOIN "projects" ON "projects"."id" = "cluster_projects"."project_id" WHERE "clusters"."management_project_id" = 371 AND "clusters"."cluster_type" = 3 AND "projects"."namespace_id" = 848)
UNION
(SELECT "clusters".*, "projects"."namespace_id" AS group_parent_id, 1 AS depth FROM "projects" LEFT OUTER JOIN "cluster_projects" ON "cluster_projects"."project_id" = "projects"."id" LEFT OUTER JOIN "clusters" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "projects"."id" = 371)
UNION
(SELECT "clusters".*, "namespaces"."parent_id" AS group_parent_id, ("clusters_cte"."depth" + 1) FROM "clusters_cte", "namespaces" LEFT OUTER JOIN cluster_groups ON cluster_groups.group_id = namespaces.id LEFT OUTER JOIN clusters ON cluster_groups.cluster_id = clusters.id WHERE "namespaces"."id" = "clusters_cte"."group_parent_id")) SELECT "clusters".* FROM "clusters_cte" "clusters" WHERE "clusters"."id" IS NOT NULL AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment6') OR
'environment6' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY (CASE clusters.management_project_id
WHEN 371 THEN 0
ELSE depth
END) ASC
, CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment6' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "clusters".* FROM "clusters" WHERE "clusters"."cluster_type" = 1 AND "clusters"."enabled" = TRUE AND (environment_scope IN ('*', 'environment6') OR
'environment6' LIKE
REPLACE(REPLACE(REPLACE(environment_scope,
'%', '\%'),
'_', '\_'),
'*', '%')
) ORDER BY CASE environment_scope
WHEN '*' THEN 0
WHEN 'environment6' THEN 2
ELSE 1
END DESC
LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_coverage_regex", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."emails_disabled", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 371 LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 269 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 269 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 224 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 269 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" IN (SELECT "ci_builds"."commit_id" FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."id" = 269 LIMIT 1) LIMIT 1 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "ci_builds"."id" FROM "ci_builds" INNER JOIN "ci_builds_metadata" ON "ci_builds_metadata"."build_id" = "ci_builds"."id" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 224 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:ci*/
SELECT "deployments".* FROM "deployments" WHERE "deployments"."status" = 2 AND "deployments"."environment_id" = 400 AND "deployments"."deployable_id" = 269 /*application:test,correlation_id:a27d17caa722556ecd76382fbde6eae3,db_config_name:main*/
Shared Example Group: "avoid N+1 on environments serialization" called from ./ee/spec/serializers/ee/environment_serializer_spec.rb:17
# ./spec/support/shared_examples/serializers/environment_serializer_shared_examples.rb:22:in `block (2 levels) in <main>'
# ./spec/spec_helper.rb:422:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:413:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:409:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:48:in `with_raw_context'
# ./spec/spec_helper.rb:409:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:387:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/with_request_store.rb:17:in `enabling_request_store'
# ./lib/gitlab/with_request_store.rb:10:in `with_request_store'
# ./spec/spec_helper.rb:387:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:267:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
Edited by Bala Kumar