Resolve growing query with more invites
Problem
Adding members through the members
or invitations
API causes what would be similar to a n+1
query state.
For example every new email adds 12 queries - meaning we have something like an n+1 here, but not really..
It is more like queries are being performed for each member that is being added that perhaps could be done from a higher level and passed in via dependency injection instead or some other method to reduce queries in those services or at the model layer during validation.
This can lead to DB saturation similar to what was seen in gitlab-com/gl-infra/production#6351 (closed)
Observed from the invitations
API, the projects limit to where it goes over 100 seems to be 6, and group member is 8 emails.
Queries observed
For a Project from invitations API spec
0: SELECT "personal_access_tokens".* FROM "personal_access_tokens" WHERE "personal_access_tokens"."token_digest" = 'YoB+mw4POd9XtrZk4TPLJqyd3bk7OSDuxYguA39HDo4=' LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
1: SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
2: UPDATE "personal_access_tokens" SET "last_used_at" = '2022-03-01 16:06:45.022572' WHERE "personal_access_tokens"."id" = 180 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
3: SELECT "users".* FROM "users" WHERE "users"."id" = 736 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
4: 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"."pending_delete" = FALSE AND "projects"."hidden" = FALSE AND "projects"."id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
5: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
6: SELECT MAX("project_authorizations"."access_level") AS maximum_access_level, "project_authorizations"."user_id" AS project_authorizations_user_id FROM "project_authorizations" WHERE "project_authorizations"."project_id" = 99 AND "project_authorizations"."user_id" = 736 GROUP BY "project_authorizations"."user_id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
7: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
8: SELECT "gitlab_subscriptions".* FROM "gitlab_subscriptions" WHERE "gitlab_subscriptions"."namespace_id" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
9: SELECT a.attname
FROM (
SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx
FROM pg_index
WHERE indrelid = '"gitlab_subscriptions"'::regclass
AND indisprimary
) i
JOIN pg_attribute a
ON a.attrelid = i.indrelid
AND a.attnum = i.indkey[i.idx]
ORDER BY i.idx
10: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
c.collname, col_description(a.attrelid, a.attnum) AS comment
FROM pg_attribute a
LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
LEFT JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
WHERE a.attrelid = '"plans"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
11: SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'free' LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
12: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
13: SELECT 1 AS one FROM "gitlab_subscriptions" WHERE "gitlab_subscriptions"."namespace_id" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
14: INSERT INTO "gitlab_subscriptions" ("created_at", "updated_at", "start_date", "namespace_id") VALUES ('2022-03-01 16:06:45.114189', '2022-03-01 16:06:45.114189', '2022-03-01', 1006) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
15: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
16: SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'free' LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
17: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
18: SELECT a.attname
FROM (
SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx
FROM pg_index
WHERE indrelid = '"plans"'::regclass
AND indisprimary
) i
JOIN pg_attribute a
ON a.attrelid = i.indrelid
AND a.attnum = i.indkey[i.idx]
ORDER BY i.idx
19: INSERT INTO "plans" ("created_at", "updated_at", "name") VALUES ('2022-03-01 16:06:45.130725', '2022-03-01 16:06:45.130725', 'free') RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
20: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
21: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
c.collname, col_description(a.attrelid, a.attnum) AS comment
FROM pg_attribute a
LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
LEFT JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
WHERE a.attrelid = '"plan_limits"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
22: SELECT "plan_limits"."id", "plan_limits"."plan_id", "plan_limits"."ci_active_pipelines", "plan_limits"."ci_pipeline_size", "plan_limits"."ci_active_jobs", "plan_limits"."project_hooks", "plan_limits"."group_hooks", "plan_limits"."ci_project_subscriptions", "plan_limits"."ci_pipeline_schedules", "plan_limits"."offset_pagination_limit", "plan_limits"."ci_instance_level_variables", "plan_limits"."storage_size_limit", "plan_limits"."ci_max_artifact_size_lsif", "plan_limits"."ci_max_artifact_size_archive", "plan_limits"."ci_max_artifact_size_metadata", "plan_limits"."ci_max_artifact_size_trace", "plan_limits"."ci_max_artifact_size_junit", "plan_limits"."ci_max_artifact_size_sast", "plan_limits"."ci_max_artifact_size_dependency_scanning", "plan_limits"."ci_max_artifact_size_container_scanning", "plan_limits"."ci_max_artifact_size_dast", "plan_limits"."ci_max_artifact_size_codequality", "plan_limits"."ci_max_artifact_size_license_management", "plan_limits"."ci_max_artifact_size_license_scanning", "plan_limits"."ci_max_artifact_size_performance", "plan_limits"."ci_max_artifact_size_metrics", "plan_limits"."ci_max_artifact_size_metrics_referee", "plan_limits"."ci_max_artifact_size_network_referee", "plan_limits"."ci_max_artifact_size_dotenv", "plan_limits"."ci_max_artifact_size_cobertura", "plan_limits"."ci_max_artifact_size_terraform", "plan_limits"."ci_max_artifact_size_accessibility", "plan_limits"."ci_max_artifact_size_cluster_applications", "plan_limits"."ci_max_artifact_size_secret_detection", "plan_limits"."ci_max_artifact_size_requirements", "plan_limits"."ci_max_artifact_size_coverage_fuzzing", "plan_limits"."ci_max_artifact_size_browser_performance", "plan_limits"."ci_max_artifact_size_load_performance", "plan_limits"."ci_needs_size_limit", "plan_limits"."conan_max_file_size", "plan_limits"."maven_max_file_size", "plan_limits"."npm_max_file_size", "plan_limits"."nuget_max_file_size", "plan_limits"."pypi_max_file_size", "plan_limits"."generic_packages_max_file_size", "plan_limits"."golang_max_file_size", "plan_limits"."debian_max_file_size", "plan_limits"."project_feature_flags", "plan_limits"."ci_max_artifact_size_api_fuzzing", "plan_limits"."ci_pipeline_deployments", "plan_limits"."pull_mirror_interval_seconds", "plan_limits"."daily_invites", "plan_limits"."rubygems_max_file_size", "plan_limits"."terraform_module_max_file_size", "plan_limits"."helm_max_file_size", "plan_limits"."ci_registered_group_runners", "plan_limits"."ci_registered_project_runners", "plan_limits"."web_hook_calls", "plan_limits"."ci_daily_pipeline_schedule_triggers", "plan_limits"."ci_max_artifact_size_cluster_image_scanning", "plan_limits"."ci_jobs_trace_size_limit", "plan_limits"."pages_file_entries", "plan_limits"."dast_profile_schedules", "plan_limits"."external_audit_event_destinations", "plan_limits"."dotenv_variables", "plan_limits"."dotenv_size", "plan_limits"."pipeline_triggers" FROM "plan_limits" WHERE "plan_limits"."plan_id" = 57 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
23: SELECT a.attname
FROM (
SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx
FROM pg_index
WHERE indrelid = '"plan_limits"'::regclass
AND indisprimary
) i
JOIN pg_attribute a
ON a.attrelid = i.indrelid
AND a.attnum = i.indkey[i.idx]
ORDER BY i.idx
24: SELECT COUNT(*) FROM ((SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Namespace' AND "members"."source_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'User' AND (traversal_ids @> ('{1006}'))))
UNION
(SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Project' AND "members"."source_id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" = 1006))) members WHERE "members"."invite_token" IS NOT NULL AND "members"."created_at" BETWEEN '2022-03-01 00:00:00' AND '2022-03-01 23:59:59.999999' /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
25: SELECT "users".* FROM "users" WHERE "users"."id" IN (739, 740) /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
26: SELECT "members".* FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_id" = 99 AND "members"."source_type" = 'Project' AND "members"."user_id" IN (739, 740) /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
27: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
28: SELECT "users".* FROM ((SELECT "users".* FROM "users" WHERE (LOWER("users"."email") IN (LOWER('email1@example.com'))))
UNION
(SELECT "users".* FROM "users" INNER JOIN "emails" ON "emails"."user_id" = "users"."id" WHERE "emails"."email" = 'email1@example.com')) users LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
29: 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" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
30: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
31: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
32: SELECT "users".* FROM "users" WHERE "users"."id" = 736 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
33: SELECT "members".* FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_type" = 'Project' AND "members"."invite_token" = '1a421d162e7eb75614f8b110e99d3ce0efb70f424cdd2d8a5509bf93c9de3fc7' ORDER BY "members"."id" ASC LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
34: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email1@example.com' AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
35: INSERT INTO "members" ("access_level", "source_id", "source_type", "type", "created_at", "updated_at", "created_by_id", "invite_email", "invite_token", "member_namespace_id", "notification_level") VALUES (30, 99, 'Project', 'ProjectMember', '2022-03-01 16:06:45.370765', '2022-03-01 16:06:45.370765', 736, 'email1@example.com', '1a421d162e7eb75614f8b110e99d3ce0efb70f424cdd2d8a5509bf93c9de3fc7', 1010, 3) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
36: SELECT "users".* FROM ((SELECT "users".* FROM "users" WHERE (LOWER("users"."email") IN (LOWER('email2@example.com'))))
UNION
(SELECT "users".* FROM "users" INNER JOIN "emails" ON "emails"."user_id" = "users"."id" WHERE "emails"."email" = 'email2@example.com')) users LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
37: 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" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
38: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
39: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
40: SELECT "users".* FROM "users" WHERE "users"."id" = 736 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
41: SELECT "members".* FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_type" = 'Project' AND "members"."invite_token" = '99fbbae19d794490ea8010c3b7787342e8c0ff990a12a8b8a6c08a2ce0703e65' ORDER BY "members"."id" ASC LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
42: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email2@example.com' AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
43: INSERT INTO "members" ("access_level", "source_id", "source_type", "type", "created_at", "updated_at", "created_by_id", "invite_email", "invite_token", "member_namespace_id", "notification_level") VALUES (30, 99, 'Project', 'ProjectMember', '2022-03-01 16:06:45.408754', '2022-03-01 16:06:45.408754', 736, 'email2@example.com', '99fbbae19d794490ea8010c3b7787342e8c0ff990a12a8b8a6c08a2ce0703e65', 1010, 3) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
44: 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" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
45: SELECT "users".* FROM "users" WHERE "users"."id" = 739 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
46: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
47: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
48: SELECT "users".* FROM "users" WHERE "users"."id" = 736 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
49: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 739 AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
50: INSERT INTO "members" ("access_level", "source_id", "source_type", "user_id", "type", "created_at", "updated_at", "created_by_id", "member_namespace_id", "notification_level") VALUES (30, 99, 'Project', 739, 'ProjectMember', '2022-03-01 16:06:45.438776', '2022-03-01 16:06:45.438776', 736, 1010, 3) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
51: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
52: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
53: INSERT INTO "notification_settings" ("user_id", "source_id", "source_type", "created_at", "updated_at", "level") VALUES (739, 99, 'Project', '2022-03-01 16:06:45.448276', '2022-03-01 16:06:45.448276', 3) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
54: INSERT INTO "events" ("project_id", "author_id", "created_at", "updated_at", "action") VALUES (99, 739, '2022-03-01 16:06:45.451257', '2022-03-01 16:06:45.451257', 8) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
55: 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" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
56: SELECT 1 AS one FROM "user_interacted_projects" WHERE "user_interacted_projects"."project_id" = 99 AND "user_interacted_projects"."user_id" = 739 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
57: INSERT INTO "user_interacted_projects" ("project_id","user_id") VALUES (99, 739) ON CONFLICT ("project_id","user_id") DO NOTHING RETURNING "project_id","user_id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
58: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 99 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
59: 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" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
60: SELECT "users".* FROM "users" WHERE "users"."id" = 740 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
61: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
62: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
63: SELECT "users".* FROM "users" WHERE "users"."id" = 736 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
64: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 740 AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
65: INSERT INTO "members" ("access_level", "source_id", "source_type", "user_id", "type", "created_at", "updated_at", "created_by_id", "member_namespace_id", "notification_level") VALUES (30, 99, 'Project', 740, 'ProjectMember', '2022-03-01 16:06:45.495546', '2022-03-01 16:06:45.495546', 736, 1010, 3) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
66: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 740 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
67: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 740 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
68: INSERT INTO "notification_settings" ("user_id", "source_id", "source_type", "created_at", "updated_at", "level") VALUES (740, 99, 'Project', '2022-03-01 16:06:45.504420', '2022-03-01 16:06:45.504420', 3) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
69: INSERT INTO "events" ("project_id", "author_id", "created_at", "updated_at", "action") VALUES (99, 740, '2022-03-01 16:06:45.507279', '2022-03-01 16:06:45.507279', 8) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
70: 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" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
71: SELECT 1 AS one FROM "user_interacted_projects" WHERE "user_interacted_projects"."project_id" = 99 AND "user_interacted_projects"."user_id" = 740 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
72: INSERT INTO "user_interacted_projects" ("project_id","user_id") VALUES (99, 740) ON CONFLICT ("project_id","user_id") DO NOTHING RETURNING "project_id","user_id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
73: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 99 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
74: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
75: SELECT "project_authorizations"."user_id", "project_authorizations"."access_level" FROM "project_authorizations" WHERE "project_authorizations"."project_id" = 99 AND "project_authorizations"."user_id" = 739 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
76: SELECT 1 AS one FROM "project_group_links" WHERE "project_group_links"."project_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
77: SELECT "members"."user_id", "members"."access_level" FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_id" = 99 AND "members"."source_type" = 'Project' AND "members"."requested_at" IS NULL AND "members"."user_id" IS NOT NULL AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."user_id" = 739 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
78: SELECT "members"."user_id", "members"."access_level" FROM (VALUES (736, 50)) members (user_id, access_level) WHERE "members"."user_id" = 739 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
79: SELECT "members"."user_id" FROM (VALUES (739, 30)) members (user_id, access_level) GROUP BY "members"."user_id" ORDER BY "members"."user_id" ASC LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
80: SELECT "members"."user_id" FROM (VALUES (739, 30)) members (user_id, access_level) WHERE "members"."user_id" >= 739 GROUP BY "members"."user_id" ORDER BY "members"."user_id" ASC LIMIT 1 OFFSET 1000 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
81: SELECT "members"."user_id", MAX(access_level) FROM (VALUES (739, 30)) members (user_id, access_level) WHERE "members"."user_id" >= 739 GROUP BY "members"."user_id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
82: INSERT INTO "project_authorizations" ("user_id","access_level","project_id") VALUES (739, 30, 99) ON CONFLICT ("user_id","project_id","access_level") DO NOTHING RETURNING "user_id","project_id","access_level" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
83: SELECT "web_hooks".* FROM "web_hooks" WHERE "web_hooks"."type" = 'SystemHook' AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:45.552854')) AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:45.553205')) ORDER BY "web_hooks"."id" ASC LIMIT 1000 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
84: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
85: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
86: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
87: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" IS NULL AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
88: INSERT INTO "notification_settings" ("user_id", "level", "created_at", "updated_at") VALUES (739, 1, '2022-03-01 16:06:45.567855', '2022-03-01 16:06:45.567855') RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
89: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
90: SELECT "project_authorizations"."user_id", "project_authorizations"."access_level" FROM "project_authorizations" WHERE "project_authorizations"."project_id" = 99 AND "project_authorizations"."user_id" = 740 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
91: SELECT 1 AS one FROM "project_group_links" WHERE "project_group_links"."project_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
92: SELECT "members"."user_id", "members"."access_level" FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_id" = 99 AND "members"."source_type" = 'Project' AND "members"."requested_at" IS NULL AND "members"."user_id" IS NOT NULL AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."user_id" = 740 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
93: SELECT "members"."user_id", "members"."access_level" FROM (VALUES (736, 50)) members (user_id, access_level) WHERE "members"."user_id" = 740 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
94: SELECT "members"."user_id" FROM (VALUES (740, 30)) members (user_id, access_level) GROUP BY "members"."user_id" ORDER BY "members"."user_id" ASC LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
95: SELECT "members"."user_id" FROM (VALUES (740, 30)) members (user_id, access_level) WHERE "members"."user_id" >= 740 GROUP BY "members"."user_id" ORDER BY "members"."user_id" ASC LIMIT 1 OFFSET 1000 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
96: SELECT "members"."user_id", MAX(access_level) FROM (VALUES (740, 30)) members (user_id, access_level) WHERE "members"."user_id" >= 740 GROUP BY "members"."user_id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
97: INSERT INTO "project_authorizations" ("user_id","access_level","project_id") VALUES (740, 30, 99) ON CONFLICT ("user_id","project_id","access_level") DO NOTHING RETURNING "user_id","project_id","access_level" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
98: SELECT "web_hooks".* FROM "web_hooks" WHERE "web_hooks"."type" = 'SystemHook' AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:45.591174')) AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:45.591476')) ORDER BY "web_hooks"."id" ASC LIMIT 1000 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
99: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 740 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
100: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 740 AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
101: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
102: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 740 AND "notification_settings"."source_type" IS NULL AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
103: INSERT INTO "notification_settings" ("user_id", "level", "created_at", "updated_at") VALUES (740, 1, '2022-03-01 16:06:45.603369', '2022-03-01 16:06:45.603369') RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
104: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
105: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email1@example.com' AND "members"."id" != 1074 AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
106: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
c.collname, col_description(a.attrelid, a.attnum) AS comment
FROM pg_attribute a
LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
LEFT JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
WHERE a.attrelid = '"audit_events"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
107: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
108: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type") VALUES (736, 99, 'Project', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id:
:member_id: 1074
:target_type: User
:target_details: Deleted User
', 'Sidney Jones2', 'Deleted User', '2022-03-01 16:06:45.630181', 'User') RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
109: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
110: 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" = 99 ORDER BY "projects"."id" ASC LIMIT 1000 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
111: 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" = 1006 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
112: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email2@example.com' AND "members"."id" != 1075 AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
113: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
114: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type") VALUES (736, 99, 'Project', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id:
:member_id: 1075
:target_type: User
:target_details: Deleted User
', 'Sidney Jones2', 'Deleted User', '2022-03-01 16:06:45.658193', 'User') RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
115: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
116: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 739 AND "members"."id" != 1076 AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
117: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
118: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type", "target_id") VALUES (736, 99, 'Project', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id: 739
:member_id: 1076
:target_type: User
:target_details: Sidney Jones5
', 'Sidney Jones2', 'Sidney Jones5', '2022-03-01 16:06:45.669817', 'User', 739) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
119: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
120: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 740 AND "members"."id" != 1077 AND "members"."source_type" = 'Project' AND "members"."source_id" = 99 LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
121: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
122: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type", "target_id") VALUES (736, 99, 'Project', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id: 740
:member_id: 1077
:target_type: User
:target_details: Sidney Jones6
', 'Sidney Jones2', 'Sidney Jones6', '2022-03-01 16:06:45.681974', 'User', 740) RETURNING "id" /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
123: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
124: SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
125: 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"."owner_id" = 736 AND "namespaces"."type" = 'User' LIMIT 1 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
126: UPDATE "users" SET "updated_at" = '2022-03-01 16:06:45.726506', "last_activity_on" = '2022-03-01' WHERE "users"."id" = 736 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
127: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
128: SELECT "emails"."email" FROM "emails" WHERE "emails"."user_id" = 736 AND "emails"."confirmed_at" IS NOT NULL /*application:test,correlation_id:72c6c4e2-d753-44e3-bd5a-194599c9e951,endpoint_id:POST /api/:version/projects/:id/invitations,db_config_name:main*/
Shared Example Group: "POST /:source_type/:id/invitations" called from ./spec/requests/api/invitations_spec.rb:315
# ./lib/gitlab/query_limiting/transaction.rb:57:in `act_upon_results'
# ./lib/gitlab/query_limiting/middleware.rb:21:in `call'
# ./lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'
# ./lib/gitlab/jira/middleware.rb:19:in `call'
# ./lib/gitlab/middleware/go.rb:20:in `call'
# ./lib/gitlab/etag_caching/middleware.rb:21:in `call'
# ./lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'
# ./lib/gitlab/database/query_analyzer.rb:37:in `within'
# ./lib/gitlab/middleware/query_analyzer.rb:11:in `call'
# ./lib/gitlab/middleware/multipart.rb:173:in `call'
# ./lib/gitlab/middleware/read_only/controller.rb:50:in `call'
# ./lib/gitlab/middleware/read_only.rb:18:in `call'
# ./lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
# ./lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
# ./lib/gitlab/middleware/basic_health_check.rb:25:in `call'
# ./lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
# ./lib/gitlab/middleware/request_context.rb:21:in `call'
# ./lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
# ./config/initializers/fix_local_cache_middleware.rb:11:in `call'
# ./lib/gitlab/middleware/compressed_json.rb:26:in `call'
# ./lib/gitlab/middleware/static.rb:11:in `call'
# ./lib/gitlab/testing/clear_process_memory_cache_middleware.rb:13:in `call'
# ./lib/gitlab/testing/request_inspector_middleware.rb:35:in `call'
# ./lib/gitlab/testing/robots_blocker_middleware.rb:30:in `call'
# ./lib/gitlab/testing/request_blocker_middleware.rb:47:in `call'
# ./lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
# ./lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
# ./lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'
# ./spec/requests/api/invitations_spec.rb:132:in `block (6 levels) in <main>'
# ./spec/requests/api/invitations_spec.rb:128:in `block (5 levels) in <main>'
# ./spec/spec_helper.rb:422:in `block (3 levels) in <main>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:413:in `block (2 levels) in <main>'
# ./spec/spec_helper.rb:409:in `block (3 levels) in <main>'
# ./lib/gitlab/application_context.rb:45:in `with_raw_context'
# ./spec/spec_helper.rb:409:in `block (2 levels) in <main>'
# ./spec/spec_helper.rb:266:in `block (2 levels) in <main>'
# ./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>'
# -e:1:in `<main>'
For a Group from invitations API spec
0: SELECT "personal_access_tokens".* FROM "personal_access_tokens" WHERE "personal_access_tokens"."token_digest" = 'wWE81PjYKXZw+/hn/re3wsd3peVP1IgU83IMIOg47js=' LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
1: SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
2: UPDATE "personal_access_tokens" SET "last_used_at" = '2022-03-01 16:06:46.313249' WHERE "personal_access_tokens"."id" = 181 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
3: SELECT "users".* FROM "users" WHERE "users"."id" = 736 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
4: 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" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
5: SELECT "saml_providers".* FROM "saml_providers" WHERE "saml_providers"."group_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
6: SELECT MAX("members"."access_level") AS maximum_access_level, "members"."user_id" AS members_user_id FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."user_id" = 736 GROUP BY "members"."user_id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
7: SELECT "gitlab_subscriptions".* FROM "gitlab_subscriptions" WHERE "gitlab_subscriptions"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
8: SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'free' LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
9: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
10: SELECT 1 AS one FROM "gitlab_subscriptions" WHERE "gitlab_subscriptions"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
11: INSERT INTO "gitlab_subscriptions" ("created_at", "updated_at", "start_date", "namespace_id") VALUES ('2022-03-01 16:06:46.371957', '2022-03-01 16:06:46.371957', '2022-03-01', 1011) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
12: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
13: SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'free' LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
14: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
15: INSERT INTO "plans" ("created_at", "updated_at", "name") VALUES ('2022-03-01 16:06:46.383814', '2022-03-01 16:06:46.383814', 'free') RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
16: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
17: SELECT "plan_limits"."id", "plan_limits"."plan_id", "plan_limits"."ci_active_pipelines", "plan_limits"."ci_pipeline_size", "plan_limits"."ci_active_jobs", "plan_limits"."project_hooks", "plan_limits"."group_hooks", "plan_limits"."ci_project_subscriptions", "plan_limits"."ci_pipeline_schedules", "plan_limits"."offset_pagination_limit", "plan_limits"."ci_instance_level_variables", "plan_limits"."storage_size_limit", "plan_limits"."ci_max_artifact_size_lsif", "plan_limits"."ci_max_artifact_size_archive", "plan_limits"."ci_max_artifact_size_metadata", "plan_limits"."ci_max_artifact_size_trace", "plan_limits"."ci_max_artifact_size_junit", "plan_limits"."ci_max_artifact_size_sast", "plan_limits"."ci_max_artifact_size_dependency_scanning", "plan_limits"."ci_max_artifact_size_container_scanning", "plan_limits"."ci_max_artifact_size_dast", "plan_limits"."ci_max_artifact_size_codequality", "plan_limits"."ci_max_artifact_size_license_management", "plan_limits"."ci_max_artifact_size_license_scanning", "plan_limits"."ci_max_artifact_size_performance", "plan_limits"."ci_max_artifact_size_metrics", "plan_limits"."ci_max_artifact_size_metrics_referee", "plan_limits"."ci_max_artifact_size_network_referee", "plan_limits"."ci_max_artifact_size_dotenv", "plan_limits"."ci_max_artifact_size_cobertura", "plan_limits"."ci_max_artifact_size_terraform", "plan_limits"."ci_max_artifact_size_accessibility", "plan_limits"."ci_max_artifact_size_cluster_applications", "plan_limits"."ci_max_artifact_size_secret_detection", "plan_limits"."ci_max_artifact_size_requirements", "plan_limits"."ci_max_artifact_size_coverage_fuzzing", "plan_limits"."ci_max_artifact_size_browser_performance", "plan_limits"."ci_max_artifact_size_load_performance", "plan_limits"."ci_needs_size_limit", "plan_limits"."conan_max_file_size", "plan_limits"."maven_max_file_size", "plan_limits"."npm_max_file_size", "plan_limits"."nuget_max_file_size", "plan_limits"."pypi_max_file_size", "plan_limits"."generic_packages_max_file_size", "plan_limits"."golang_max_file_size", "plan_limits"."debian_max_file_size", "plan_limits"."project_feature_flags", "plan_limits"."ci_max_artifact_size_api_fuzzing", "plan_limits"."ci_pipeline_deployments", "plan_limits"."pull_mirror_interval_seconds", "plan_limits"."daily_invites", "plan_limits"."rubygems_max_file_size", "plan_limits"."terraform_module_max_file_size", "plan_limits"."helm_max_file_size", "plan_limits"."ci_registered_group_runners", "plan_limits"."ci_registered_project_runners", "plan_limits"."web_hook_calls", "plan_limits"."ci_daily_pipeline_schedule_triggers", "plan_limits"."ci_max_artifact_size_cluster_image_scanning", "plan_limits"."ci_jobs_trace_size_limit", "plan_limits"."pages_file_entries", "plan_limits"."dast_profile_schedules", "plan_limits"."external_audit_event_destinations", "plan_limits"."dotenv_variables", "plan_limits"."dotenv_size", "plan_limits"."pipeline_triggers" FROM "plan_limits" WHERE "plan_limits"."plan_id" = 58 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
18: SELECT COUNT(*) FROM ((SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Namespace' AND "members"."source_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND (traversal_ids @> ('{1011}'))))
UNION
(SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Project' AND "members"."source_id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" IN (SELECT namespaces.traversal_ids[array_length(namespaces.traversal_ids, 1)] AS id FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND (traversal_ids @> ('{1011}')))))) members WHERE "members"."invite_token" IS NOT NULL AND "members"."created_at" BETWEEN '2022-03-01 00:00:00' AND '2022-03-01 23:59:59.999999' /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
19: SELECT "users".* FROM "users" WHERE "users"."id" IN (739, 741) /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
20: SELECT "members".* FROM "members" WHERE "members"."type" = 'GroupMember' AND "members"."source_id" = 1011 AND "members"."source_type" = 'Namespace' AND "members"."user_id" IN (739, 741) /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
21: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
22: SELECT "users".* FROM ((SELECT "users".* FROM "users" WHERE (LOWER("users"."email") IN (LOWER('email1@example.com'))))
UNION
(SELECT "users".* FROM "users" INNER JOIN "emails" ON "emails"."user_id" = "users"."id" WHERE "emails"."email" = 'email1@example.com')) users LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
23: 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" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
24: SELECT 1 AS one FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = 50 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
25: SELECT "members".* FROM "members" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."invite_token" = 'dde4bc4c3a6f96b9bf3600ced225a485d8ccf06558d0f632660958f8fd535a77' ORDER BY "members"."id" ASC LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
26: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email1@example.com' AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
27: SELECT "namespace_settings".* FROM "namespace_settings" WHERE "namespace_settings"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
28: INSERT INTO "members" ("access_level", "source_id", "source_type", "type", "created_at", "updated_at", "created_by_id", "invite_email", "invite_token", "member_namespace_id", "notification_level") VALUES (30, 1011, 'Namespace', 'GroupMember', '2022-03-01 16:06:46.470564', '2022-03-01 16:06:46.470564', 736, 'email1@example.com', 'dde4bc4c3a6f96b9bf3600ced225a485d8ccf06558d0f632660958f8fd535a77', 1011, 3) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
29: SELECT "users".* FROM ((SELECT "users".* FROM "users" WHERE (LOWER("users"."email") IN (LOWER('email2@example.com'))))
UNION
(SELECT "users".* FROM "users" INNER JOIN "emails" ON "emails"."user_id" = "users"."id" WHERE "emails"."email" = 'email2@example.com')) users LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
30: 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" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
31: SELECT 1 AS one FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = 50 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
32: SELECT "members".* FROM "members" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."invite_token" = '3941257c1f39a07e0c374865b922648ba1636cdf289691968236f900238f2645' ORDER BY "members"."id" ASC LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
33: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email2@example.com' AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
34: SELECT "namespace_settings".* FROM "namespace_settings" WHERE "namespace_settings"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
35: INSERT INTO "members" ("access_level", "source_id", "source_type", "type", "created_at", "updated_at", "created_by_id", "invite_email", "invite_token", "member_namespace_id", "notification_level") VALUES (30, 1011, 'Namespace', 'GroupMember', '2022-03-01 16:06:46.521194', '2022-03-01 16:06:46.521194', 736, 'email2@example.com', '3941257c1f39a07e0c374865b922648ba1636cdf289691968236f900238f2645', 1011, 3) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
36: 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" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
37: SELECT "users".* FROM "users" WHERE "users"."id" = 739 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
38: SELECT 1 AS one FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = 50 AND "members"."user_id" = 739 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
39: SELECT 1 AS one FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = 50 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
40: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 739 AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
41: SELECT "saml_providers".* FROM "saml_providers" WHERE "saml_providers"."group_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
42: SELECT 1 AS one FROM ((SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Namespace' AND "members"."source_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND (traversal_ids @> ('{1011}'))))
UNION
(SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Project' AND "members"."source_id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" IN (SELECT namespaces.traversal_ids[array_length(namespaces.traversal_ids, 1)] AS id FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND (traversal_ids @> ('{1011}')))))) members WHERE "members"."user_id" = 739 AND ("members"."state" IN (0)) LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
43: SELECT "namespace_settings".* FROM "namespace_settings" WHERE "namespace_settings"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
44: INSERT INTO "members" ("access_level", "source_id", "source_type", "user_id", "type", "created_at", "updated_at", "created_by_id", "member_namespace_id", "notification_level") VALUES (30, 1011, 'Namespace', 739, 'GroupMember', '2022-03-01 16:06:46.578920', '2022-03-01 16:06:46.578920', 736, 1011, 3) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
45: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" = 'Namespace' AND "notification_settings"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
46: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" = 'Namespace' AND "notification_settings"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
47: INSERT INTO "notification_settings" ("user_id", "source_id", "source_type", "created_at", "updated_at", "level") VALUES (739, 1011, 'Namespace', '2022-03-01 16:06:46.605951', '2022-03-01 16:06:46.605951', 3) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
48: SELECT "user_details".* FROM "user_details" WHERE "user_details"."user_id" = 739 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
49: SELECT "gitlab_subscriptions".* FROM "gitlab_subscriptions" WHERE "gitlab_subscriptions"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
50: SELECT 1 AS one FROM "web_hooks" WHERE "web_hooks"."type" = 'GroupHook' AND "web_hooks"."group_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1011) LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
51: SELECT 1 AS one FROM "namespaces" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 739 AND "members"."requested_at" IS NULL AND (access_level >= 10) LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
52: 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" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 739 AND "members"."requested_at" IS NULL AND (access_level >= 10))
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")), "base_and_descendants" 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" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 739 AND "members"."requested_at" IS NULL AND (access_level >= 10))
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_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT "namespaces"."two_factor_grace_period" FROM ((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 "base_and_ancestors" AS "namespaces" WHERE "namespaces"."type" = 'Group')
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 "base_and_descendants" AS "namespaces" WHERE "namespaces"."type" = 'Group')) namespaces WHERE "namespaces"."type" = 'Group' AND "namespaces"."require_two_factor_authentication" = TRUE /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
53: 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"."owner_id" = 739 AND "namespaces"."type" = 'User' LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
54: INSERT INTO "user_details" ("user_id") VALUES (739) RETURNING "user_id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
55: 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" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
56: SELECT "users".* FROM "users" WHERE "users"."id" = 741 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
57: SELECT 1 AS one FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = 50 AND "members"."user_id" = 741 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
58: SELECT 1 AS one FROM ((SELECT "members"."id", "members"."access_level", "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members" LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."state" = 0 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1011)
UNION
(WITH "group_group_links_cte" AS MATERIALIZED (SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1011) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override", "members"."state", "members"."invite_email_success", "members"."member_namespace_id" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND "members"."state" = 0 AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = 50 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
59: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 741 AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
60: SELECT "saml_providers".* FROM "saml_providers" WHERE "saml_providers"."group_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
61: SELECT 1 AS one FROM ((SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Namespace' AND "members"."source_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND (traversal_ids @> ('{1011}'))))
UNION
(SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Project' AND "members"."source_id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" IN (SELECT namespaces.traversal_ids[array_length(namespaces.traversal_ids, 1)] AS id FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND (traversal_ids @> ('{1011}')))))) members WHERE "members"."user_id" = 741 AND ("members"."state" IN (0)) LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
62: SELECT "namespace_settings".* FROM "namespace_settings" WHERE "namespace_settings"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
63: INSERT INTO "members" ("access_level", "source_id", "source_type", "user_id", "type", "created_at", "updated_at", "created_by_id", "member_namespace_id", "notification_level") VALUES (30, 1011, 'Namespace', 741, 'GroupMember', '2022-03-01 16:06:46.718864', '2022-03-01 16:06:46.718864', 736, 1011, 3) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
64: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 741 AND "notification_settings"."source_type" = 'Namespace' AND "notification_settings"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
65: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 741 AND "notification_settings"."source_type" = 'Namespace' AND "notification_settings"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
66: INSERT INTO "notification_settings" ("user_id", "source_id", "source_type", "created_at", "updated_at", "level") VALUES (741, 1011, 'Namespace', '2022-03-01 16:06:46.746474', '2022-03-01 16:06:46.746474', 3) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
67: SELECT "user_details".* FROM "user_details" WHERE "user_details"."user_id" = 741 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
68: SELECT "gitlab_subscriptions".* FROM "gitlab_subscriptions" WHERE "gitlab_subscriptions"."namespace_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
69: SELECT 1 AS one FROM "web_hooks" WHERE "web_hooks"."type" = 'GroupHook' AND "web_hooks"."group_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1011) LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
70: SELECT 1 AS one FROM "namespaces" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 741 AND "members"."requested_at" IS NULL AND (access_level >= 10) LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
71: 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" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 741 AND "members"."requested_at" IS NULL AND (access_level >= 10))
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")), "base_and_descendants" 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" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 741 AND "members"."requested_at" IS NULL AND (access_level >= 10))
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_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT "namespaces"."two_factor_grace_period" FROM ((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 "base_and_ancestors" AS "namespaces" WHERE "namespaces"."type" = 'Group')
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 "base_and_descendants" AS "namespaces" WHERE "namespaces"."type" = 'Group')) namespaces WHERE "namespaces"."type" = 'Group' AND "namespaces"."require_two_factor_authentication" = TRUE /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
72: 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"."owner_id" = 741 AND "namespaces"."type" = 'User' LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
73: INSERT INTO "user_details" ("user_id") VALUES (741) RETURNING "user_id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
74: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
75: SELECT "users".* FROM "users" WHERE "users"."id" = 739 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
76: SELECT "users".* FROM "users" WHERE "users"."id" = 739 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
77: SELECT "project_authorizations"."project_id", "project_authorizations"."access_level" FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 739 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
78: WITH RECURSIVE "namespaces_cte" AS ((SELECT "namespaces"."id", "members"."access_level" FROM "namespaces" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 739 AND "members"."requested_at" IS NULL AND (access_level >= 10) AND "members"."state" = 0)
UNION
(SELECT "namespaces"."id", LEAST("members"."access_level", "group_group_links"."group_access") AS access_level FROM "namespaces" INNER JOIN "group_group_links" ON "group_group_links"."shared_group_id" = "namespaces"."id" INNER JOIN "members" ON "group_group_links"."shared_with_group_id" = "members"."source_id" AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."user_id" = 739 AND "members"."state" = 0 AND "members"."access_level" > 5 WHERE "namespaces"."type" = 'Group')
UNION
(SELECT "namespaces"."id", GREATEST("members"."access_level", "namespaces_cte"."access_level") AS access_level FROM "namespaces" INNER JOIN "namespaces_cte" ON "namespaces_cte"."id" = "namespaces"."parent_id" LEFT OUTER JOIN "members" ON "members"."source_id" = "namespaces"."id" AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."user_id" = 739 AND "members"."state" = 0 AND "members"."access_level" > 5 WHERE "namespaces"."type" = 'Group')) SELECT "project_authorizations"."project_id", MAX(access_level) AS access_level FROM ((SELECT projects.id AS project_id, "members"."access_level" FROM "projects" INNER JOIN "members" ON "projects"."id" = "members"."source_id" WHERE "members"."type" = 'ProjectMember' AND "members"."source_type" = 'Project' AND "members"."user_id" = 739 AND "members"."requested_at" IS NULL AND "members"."state" = 0)
UNION
(SELECT projects.id AS project_id, 50 AS access_level FROM "projects" INNER JOIN "namespaces" ON "projects"."namespace_id" = "namespaces"."id" WHERE "namespaces"."owner_id" = 739 AND "namespaces"."type" = 'User')
UNION
(SELECT "projects"."id" AS project_id, "namespaces"."access_level" FROM "namespaces_cte" "namespaces" INNER JOIN "projects" ON "projects"."namespace_id" = "namespaces"."id")
UNION
(SELECT "project_group_links"."project_id", LEAST("namespaces"."access_level", "project_group_links"."group_access") AS access_level FROM "namespaces_cte" "namespaces" INNER JOIN project_group_links ON project_group_links.group_id = namespaces.id INNER JOIN projects ON projects.id = project_group_links.project_id INNER JOIN namespaces p_ns ON p_ns.id = projects.namespace_id WHERE (p_ns.share_with_group_lock IS FALSE))) project_authorizations GROUP BY "project_authorizations"."project_id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
79: SELECT "users".* FROM "users" WHERE "users"."id" = 739 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
80: SELECT "web_hooks".* FROM "web_hooks" WHERE "web_hooks"."type" = 'SystemHook' AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:46.849960')) AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:46.850634')) ORDER BY "web_hooks"."id" ASC LIMIT 1000 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
81: SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1011 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
82: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."source_type" = 'Namespace' AND "notification_settings"."source_id" = 1011 AND "notification_settings"."user_id" = 739 AND "notification_settings"."level" != 3 ORDER BY "notification_settings"."id" ASC LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
83: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
84: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
85: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 739 AND "notification_settings"."source_type" IS NULL AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
86: INSERT INTO "notification_settings" ("user_id", "level", "created_at", "updated_at") VALUES (739, 1, '2022-03-01 16:06:46.875892', '2022-03-01 16:06:46.875892') RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
87: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
88: SELECT "emails"."email" FROM "emails" WHERE "emails"."user_id" = 739 AND "emails"."confirmed_at" IS NOT NULL /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
89: SELECT "users".* FROM "users" WHERE "users"."id" = 741 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
90: SELECT "users".* FROM "users" WHERE "users"."id" = 741 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
91: SELECT "project_authorizations"."project_id", "project_authorizations"."access_level" FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 741 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
92: WITH RECURSIVE "namespaces_cte" AS ((SELECT "namespaces"."id", "members"."access_level" FROM "namespaces" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 741 AND "members"."requested_at" IS NULL AND (access_level >= 10) AND "members"."state" = 0)
UNION
(SELECT "namespaces"."id", LEAST("members"."access_level", "group_group_links"."group_access") AS access_level FROM "namespaces" INNER JOIN "group_group_links" ON "group_group_links"."shared_group_id" = "namespaces"."id" INNER JOIN "members" ON "group_group_links"."shared_with_group_id" = "members"."source_id" AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."user_id" = 741 AND "members"."state" = 0 AND "members"."access_level" > 5 WHERE "namespaces"."type" = 'Group')
UNION
(SELECT "namespaces"."id", GREATEST("members"."access_level", "namespaces_cte"."access_level") AS access_level FROM "namespaces" INNER JOIN "namespaces_cte" ON "namespaces_cte"."id" = "namespaces"."parent_id" LEFT OUTER JOIN "members" ON "members"."source_id" = "namespaces"."id" AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."user_id" = 741 AND "members"."state" = 0 AND "members"."access_level" > 5 WHERE "namespaces"."type" = 'Group')) SELECT "project_authorizations"."project_id", MAX(access_level) AS access_level FROM ((SELECT projects.id AS project_id, "members"."access_level" FROM "projects" INNER JOIN "members" ON "projects"."id" = "members"."source_id" WHERE "members"."type" = 'ProjectMember' AND "members"."source_type" = 'Project' AND "members"."user_id" = 741 AND "members"."requested_at" IS NULL AND "members"."state" = 0)
UNION
(SELECT projects.id AS project_id, 50 AS access_level FROM "projects" INNER JOIN "namespaces" ON "projects"."namespace_id" = "namespaces"."id" WHERE "namespaces"."owner_id" = 741 AND "namespaces"."type" = 'User')
UNION
(SELECT "projects"."id" AS project_id, "namespaces"."access_level" FROM "namespaces_cte" "namespaces" INNER JOIN "projects" ON "projects"."namespace_id" = "namespaces"."id")
UNION
(SELECT "project_group_links"."project_id", LEAST("namespaces"."access_level", "project_group_links"."group_access") AS access_level FROM "namespaces_cte" "namespaces" INNER JOIN project_group_links ON project_group_links.group_id = namespaces.id INNER JOIN projects ON projects.id = project_group_links.project_id INNER JOIN namespaces p_ns ON p_ns.id = projects.namespace_id WHERE (p_ns.share_with_group_lock IS FALSE))) project_authorizations GROUP BY "project_authorizations"."project_id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
93: SELECT "users".* FROM "users" WHERE "users"."id" = 741 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
94: SELECT "web_hooks".* FROM "web_hooks" WHERE "web_hooks"."type" = 'SystemHook' AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:46.923336')) AND (recent_failures <= 3 AND (disabled_until IS NULL OR disabled_until < '2022-03-01 16:06:46.923650')) ORDER BY "web_hooks"."id" ASC LIMIT 1000 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
95: SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1011 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
96: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."source_type" = 'Namespace' AND "notification_settings"."source_id" = 1011 AND "notification_settings"."user_id" = 741 AND "notification_settings"."level" != 3 ORDER BY "notification_settings"."id" ASC LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
97: SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 741 AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
98: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
99: SELECT 1 AS one FROM "notification_settings" WHERE "notification_settings"."user_id" = 741 AND "notification_settings"."source_type" IS NULL AND "notification_settings"."source_id" IS NULL LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
100: INSERT INTO "notification_settings" ("user_id", "level", "created_at", "updated_at") VALUES (741, 1, '2022-03-01 16:06:46.944434', '2022-03-01 16:06:46.944434') RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
101: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
102: SELECT "emails"."email" FROM "emails" WHERE "emails"."user_id" = 741 AND "emails"."confirmed_at" IS NOT NULL /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
103: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email1@example.com' AND "members"."id" != 1078 AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
104: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
105: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type") VALUES (736, 1011, 'Group', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id:
:member_id: 1078
:target_type: User
:target_details: Deleted User
', 'Sidney Jones2', 'Deleted User', '2022-03-01 16:06:46.966287', 'User') RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
106: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
107: 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" = 1011 ORDER BY "namespaces"."id" ASC LIMIT 1000 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
108: SELECT 1 AS one FROM "members" WHERE "members"."invite_email" = 'email2@example.com' AND "members"."id" != 1079 AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
109: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
110: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type") VALUES (736, 1011, 'Group', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id:
:member_id: 1079
:target_type: User
:target_details: Deleted User
', 'Sidney Jones2', 'Deleted User', '2022-03-01 16:06:47.331797', 'User') RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
111: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
112: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 739 AND "members"."id" != 1080 AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
113: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
114: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type", "target_id") VALUES (736, 1011, 'Group', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id: 739
:member_id: 1080
:target_type: User
:target_details: Sidney Jones5
', 'Sidney Jones2', 'Sidney Jones5', '2022-03-01 16:06:47.345668', 'User', 739) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
115: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
116: SELECT 1 AS one FROM "members" WHERE "members"."user_id" = 741 AND "members"."id" != 1081 AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 1011 LIMIT 1 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
117: SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
118: INSERT INTO "audit_events" ("author_id", "entity_id", "entity_type", "details", "author_name", "target_details", "created_at", "target_type", "target_id") VALUES (736, 1011, 'Group', '---
:add: user_access
:as: Developer
:author_name: Sidney Jones2
:target_id: 741
:member_id: 1081
:target_type: User
:target_details: Sidney Jones7
', 'Sidney Jones2', 'Sidney Jones7', '2022-03-01 16:06:47.358770', 'User', 741) RETURNING "id" /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
119: RELEASE SAVEPOINT active_record_2 /*application:test,correlation_id:35f89646-fab2-4e2b-96f9-1d46d92ab3a3,endpoint_id:POST /api/:version/groups/:id/invitations,db_config_name:main*/
🚧
Resolutions Caching inside the request
-
Look for things like expensive queries that could be done once and then cached during the same request cycle. -
See if dependency injection can be used so that results of queries are injected into each member add that are only run once during the invitation process
Limiting number of invites per request
-
Limit how many invites can be sent to members
and/orinvitations
API- not desirable as that number would likely be around 5 to keep under our 100 threshold, but perhaps some sort of limit combined with other fixes.
- Frontend limit in invite modal of 10
- Backend limits at API/service level
Reduce queries/reuse their results inside each add member process for each invite
-
Reduce the amount of queries that adding a member requires - Look at Service level and Validations
- restructure
app/services/concerns/members/bulk_create_users.rb
class methods - perhaps use another class - re-think creator vs bulk creator and the parsing of the invites - perhaps it can be done in one place beforehand and de-duplicate that logic
- consider refactoring
Creator
class into separate Update and Create services
Edited by Doug Stull