Add filters and sorting options to projects finders
What does this MR do and why?
This adds a few capabilities to the ProjectFinder
and the
Namespaces::ProjectsFinder
. Both now allow for:
- Filtering by issues_enabled
- Filtering by merge_requests_enabled
- Sorting by latest activity
Those new capabilities are being exposes in the corresponding GraphQL resolvers.
These changes will be needed to address #374098 (closed) where we are building a reusable dropdown to create different resources in projects.
Screenshots or screen recordings
No visual change.
How to set up and validate locally
These changes can be tested in the GraphQL Explorer (http://gdk.test:3000/-/graphql-explorer).
Sample queries:
query Projects {
projects(
sort: "latest_activity_desc"
membership: true
withIssuesEnabled: true
) {
nodes {
name
lastActivityAt
issuesEnabled
mergeRequestsEnabled
}
}
}
Sample response
{
"data": {
"projects": {
"nodes": [
{
"name": "Security Reports",
"lastActivityAt": "2023-01-19T15:34:14Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "RSpec example",
"lastActivityAt": "2023-01-17T15:25:56Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Html5 Boilerplate",
"lastActivityAt": "2023-01-10T17:40:54Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Subgroup project",
"lastActivityAt": "2023-01-06T12:30:55Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Flight - Security policy project",
"lastActivityAt": "2022-11-08T16:54:51Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "template-project-1-6f0368dae5d6e05b",
"lastActivityAt": "2022-11-04T20:46:26Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "template-project-1-525b7947428d1156",
"lastActivityAt": "2022-11-04T20:45:51Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "template-project-1-8dbc1ef3d8dda637",
"lastActivityAt": "2022-11-04T20:44:52Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "template-project-1-4a2acca705589b42",
"lastActivityAt": "2022-11-04T20:20:43Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "template-project-1-eb150d72d21a1fa0",
"lastActivityAt": "2022-11-04T20:19:37Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Project using built-in project template 10b399d97a11c10b",
"lastActivityAt": "2022-11-04T20:19:20Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "template-project-1-d395ec538f804abf",
"lastActivityAt": "2022-11-04T20:19:03Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Typeahead.Js",
"lastActivityAt": "2022-10-28T11:55:37Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Wget2",
"lastActivityAt": "2022-09-29T15:06:59Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Lab Coat",
"lastActivityAt": "2022-09-27T10:48:58Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Security Reports",
"lastActivityAt": "2022-09-19T12:08:09Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Flight",
"lastActivityAt": "2022-09-13T19:12:21Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Gitlab Org - Security policy project",
"lastActivityAt": "2022-08-16T20:27:35Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Flight",
"lastActivityAt": "2022-07-19T16:05:20Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Gitlab Shell",
"lastActivityAt": "2022-05-05T00:53:08Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Test Cis With Agentid",
"lastActivityAt": "2022-06-17T14:46:46Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Code Quality Test",
"lastActivityAt": "2022-06-03T18:07:58Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Security Policies",
"lastActivityAt": "2022-05-16T14:12:08Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Monitoring",
"lastActivityAt": "2022-05-05T00:55:32Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Underscore",
"lastActivityAt": "2022-05-05T00:53:31Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Gitlab Test",
"lastActivityAt": "2022-05-05T00:52:56Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
}
]
}
}
}
Raw SQL
ProjectsFinder.new(params: { :sort => "latest_activity_desc", :owned => true, :with_issues_enabled => true }, current_user: User.find_by(username: 'root')).execute
User Load (1.5ms) SELECT
"users"."id",
"users"."email",
"users"."encrypted_password",
"users"."reset_password_token",
"users"."reset_password_sent_at",
"users"."remember_created_at",
"users"."sign_in_count",
"users"."current_sign_in_at",
"users"."last_sign_in_at",
"users"."current_sign_in_ip",
"users"."last_sign_in_ip",
"users"."created_at",
"users"."updated_at",
"users"."name",
"users"."admin",
"users"."projects_limit",
"users"."failed_attempts",
"users"."locked_at",
"users"."username",
"users"."can_create_group",
"users"."can_create_team",
"users"."state",
"users"."color_scheme_id",
"users"."password_expires_at",
"users"."created_by_id",
"users"."last_credential_check_at",
"users"."avatar",
"users"."confirmation_token",
"users"."confirmed_at",
"users"."confirmation_sent_at",
"users"."unconfirmed_email",
"users"."hide_no_ssh_key",
"users"."admin_email_unsubscribed_at",
"users"."notification_email",
"users"."hide_no_password",
"users"."password_automatically_set",
"users"."encrypted_otp_secret",
"users"."encrypted_otp_secret_iv",
"users"."encrypted_otp_secret_salt",
"users"."otp_required_for_login",
"users"."otp_backup_codes",
"users"."public_email",
"users"."dashboard",
"users"."project_view",
"users"."consumed_timestep",
"users"."layout",
"users"."hide_project_limit",
"users"."note",
"users"."unlock_token",
"users"."otp_grace_period_started_at",
"users"."external",
"users"."incoming_email_token",
"users"."auditor",
"users"."require_two_factor_authentication_from_group",
"users"."two_factor_grace_period",
"users"."last_activity_on",
"users"."notified_of_own_activity",
"users"."preferred_language",
"users"."email_opted_in",
"users"."email_opted_in_ip",
"users"."email_opted_in_source_id",
"users"."email_opted_in_at",
"users"."theme_id",
"users"."accepted_term_id",
"users"."feed_token",
"users"."private_profile",
"users"."roadmap_layout",
"users"."include_private_contributions",
"users"."commit_email",
"users"."group_view",
"users"."managing_group_id",
"users"."first_name",
"users"."last_name",
"users"."static_object_token",
"users"."role",
"users"."user_type",
"users"."static_object_token_encrypted",
"users"."otp_secret_expires_at",
"users"."onboarding_in_progress"
FROM
"users"
WHERE
"users"."username" = 'root'
LIMIT 1
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:(pry):26:in `__pry__'*/
Namespace LOAD (1.2ms
)
SELECT
"namespaces".*
FROM
"namespaces"
WHERE
"namespaces"."owner_id" = 1
AND "namespaces"."type" = 'User'
LIMIT 1
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:/app/models/user.rb:1217:in `owned_projects'*/
Feature::FlipperGate LOAD (0.2ms
)
SELECT
"feature_gates".*
FROM
"feature_gates"
WHERE
"feature_gates"."feature_key" = 'disable_anonymous_project_search'
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:/lib/feature.rb:249:in `block in current_feature_value'*/
Feature::FlipperGate LOAD (0.1ms
)
SELECT
"feature_gates".*
FROM
"feature_gates"
WHERE
"feature_gates"."feature_key" = 'project_language_search'
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:/lib/feature.rb:249:in `block in current_feature_value'*/
ApplicationSetting LOAD (3.1ms
)
SELECT
"application_settings"."id",
"application_settings"."default_projects_limit",
"application_settings"."signup_enabled",
"application_settings"."gravatar_enabled",
"application_settings"."sign_in_text",
"application_settings"."created_at",
"application_settings"."updated_at",
"application_settings"."home_page_url",
"application_settings"."default_branch_protection",
"application_settings"."help_text",
"application_settings"."restricted_visibility_levels",
"application_settings"."version_check_enabled",
"application_settings"."max_attachment_size",
"application_settings"."default_project_visibility",
"application_settings"."default_snippet_visibility",
"application_settings"."user_oauth_applications",
"application_settings"."after_sign_out_path",
"application_settings"."session_expire_delay",
"application_settings"."import_sources",
"application_settings"."help_page_text",
"application_settings"."shared_runners_enabled",
"application_settings"."max_artifacts_size",
"application_settings"."runners_registration_token",
"application_settings"."max_pages_size",
"application_settings"."require_two_factor_authentication",
"application_settings"."two_factor_grace_period",
"application_settings"."metrics_enabled",
"application_settings"."metrics_host",
"application_settings"."metrics_pool_size",
"application_settings"."metrics_timeout",
"application_settings"."metrics_method_call_threshold",
"application_settings"."recaptcha_enabled",
"application_settings"."metrics_port",
"application_settings"."akismet_enabled",
"application_settings"."metrics_sample_interval",
"application_settings"."email_author_in_body",
"application_settings"."default_group_visibility",
"application_settings"."repository_checks_enabled",
"application_settings"."shared_runners_text",
"application_settings"."metrics_packet_size",
"application_settings"."disabled_oauth_sign_in_sources",
"application_settings"."health_check_access_token",
"application_settings"."container_registry_token_expire_delay",
"application_settings"."after_sign_up_text",
"application_settings"."user_default_external",
"application_settings"."elasticsearch_indexing",
"application_settings"."elasticsearch_search",
"application_settings"."repository_storages",
"application_settings"."enabled_git_access_protocol",
"application_settings"."usage_ping_enabled",
"application_settings"."sign_in_text_html",
"application_settings"."help_page_text_html",
"application_settings"."shared_runners_text_html",
"application_settings"."after_sign_up_text_html",
"application_settings"."rsa_key_restriction",
"application_settings"."dsa_key_restriction",
"application_settings"."ecdsa_key_restriction",
"application_settings"."ed25519_key_restriction",
"application_settings"."housekeeping_enabled",
"application_settings"."housekeeping_bitmaps_enabled",
"application_settings"."housekeeping_incremental_repack_period",
"application_settings"."housekeeping_full_repack_period",
"application_settings"."housekeeping_gc_period",
"application_settings"."html_emails_enabled",
"application_settings"."plantuml_url",
"application_settings"."plantuml_enabled",
"application_settings"."shared_runners_minutes",
"application_settings"."repository_size_limit",
"application_settings"."terminal_max_session_time",
"application_settings"."unique_ips_limit_per_user",
"application_settings"."unique_ips_limit_time_window",
"application_settings"."unique_ips_limit_enabled",
"application_settings"."default_artifacts_expire_in",
"application_settings"."elasticsearch_url",
"application_settings"."elasticsearch_aws",
"application_settings"."elasticsearch_aws_region",
"application_settings"."elasticsearch_aws_access_key",
"application_settings"."geo_status_timeout",
"application_settings"."uuid",
"application_settings"."polling_interval_multiplier",
"application_settings"."cached_markdown_version",
"application_settings"."check_namespace_plan",
"application_settings"."mirror_max_delay",
"application_settings"."mirror_max_capacity",
"application_settings"."mirror_capacity_threshold",
"application_settings"."prometheus_metrics_enabled",
"application_settings"."authorized_keys_enabled",
"application_settings"."help_page_hide_commercial_content",
"application_settings"."help_page_support_url",
"application_settings"."slack_app_enabled",
"application_settings"."slack_app_id",
"application_settings"."performance_bar_allowed_group_id",
"application_settings"."allow_group_owners_to_manage_ldap",
"application_settings"."hashed_storage_enabled",
"application_settings"."project_export_enabled",
"application_settings"."auto_devops_enabled",
"application_settings"."throttle_unauthenticated_enabled",
"application_settings"."throttle_unauthenticated_requests_per_period",
"application_settings"."throttle_unauthenticated_period_in_seconds",
"application_settings"."throttle_authenticated_api_enabled",
"application_settings"."throttle_authenticated_api_requests_per_period",
"application_settings"."throttle_authenticated_api_period_in_seconds",
"application_settings"."throttle_authenticated_web_enabled",
"application_settings"."throttle_authenticated_web_requests_per_period",
"application_settings"."throttle_authenticated_web_period_in_seconds",
"application_settings"."gitaly_timeout_default",
"application_settings"."gitaly_timeout_medium",
"application_settings"."gitaly_timeout_fast",
"application_settings"."mirror_available",
"application_settings"."password_authentication_enabled_for_web",
"application_settings"."password_authentication_enabled_for_git",
"application_settings"."auto_devops_domain",
"application_settings"."external_authorization_service_enabled",
"application_settings"."external_authorization_service_url",
"application_settings"."external_authorization_service_default_label",
"application_settings"."pages_domain_verification_enabled",
"application_settings"."user_default_internal_regex",
"application_settings"."external_authorization_service_timeout",
"application_settings"."external_auth_client_cert",
"application_settings"."encrypted_external_auth_client_key",
"application_settings"."encrypted_external_auth_client_key_iv",
"application_settings"."encrypted_external_auth_client_key_pass",
"application_settings"."encrypted_external_auth_client_key_pass_iv",
"application_settings"."email_additional_text",
"application_settings"."enforce_terms",
"application_settings"."file_template_project_id",
"application_settings"."pseudonymizer_enabled",
"application_settings"."hide_third_party_offers",
"application_settings"."snowplow_enabled",
"application_settings"."snowplow_collector_hostname",
"application_settings"."snowplow_cookie_domain",
"application_settings"."web_ide_clientside_preview_enabled",
"application_settings"."user_show_add_ssh_key_message",
"application_settings"."custom_project_templates_group_id",
"application_settings"."usage_stats_set_by_user_id",
"application_settings"."receive_max_input_size",
"application_settings"."diff_max_patch_bytes",
"application_settings"."archive_builds_in_seconds",
"application_settings"."commit_email_hostname",
"application_settings"."protected_ci_variables",
"application_settings"."runners_registration_token_encrypted",
"application_settings"."local_markdown_version",
"application_settings"."first_day_of_week",
"application_settings"."elasticsearch_limit_indexing",
"application_settings"."default_project_creation",
"application_settings"."lets_encrypt_notification_email",
"application_settings"."lets_encrypt_terms_of_service_accepted",
"application_settings"."geo_node_allowed_ips",
"application_settings"."encrypted_lets_encrypt_private_key",
"application_settings"."encrypted_lets_encrypt_private_key_iv",
"application_settings"."required_instance_ci_template",
"application_settings"."dns_rebinding_protection_enabled",
"application_settings"."default_project_deletion_protection",
"application_settings"."grafana_enabled",
"application_settings"."lock_memberships_to_ldap",
"application_settings"."time_tracking_limit_to_hours",
"application_settings"."grafana_url",
"application_settings"."login_recaptcha_protection_enabled",
"application_settings"."outbound_local_requests_whitelist",
"application_settings"."raw_blob_request_limit",
"application_settings"."allow_local_requests_from_web_hooks_and_services",
"application_settings"."allow_local_requests_from_system_hooks",
"application_settings"."instance_administration_project_id",
"application_settings"."asset_proxy_enabled",
"application_settings"."asset_proxy_url",
"application_settings"."encrypted_asset_proxy_secret_key",
"application_settings"."encrypted_asset_proxy_secret_key_iv",
"application_settings"."static_objects_external_storage_url",
"application_settings"."max_personal_access_token_lifetime",
"application_settings"."throttle_protected_paths_enabled",
"application_settings"."throttle_protected_paths_requests_per_period",
"application_settings"."throttle_protected_paths_period_in_seconds",
"application_settings"."protected_paths",
"application_settings"."throttle_incident_management_notification_enabled",
"application_settings"."throttle_incident_management_notification_period_in_seconds",
"application_settings"."throttle_incident_management_notification_per_period",
"application_settings"."push_event_hooks_limit",
"application_settings"."push_event_activities_limit",
"application_settings"."custom_http_clone_url_root",
"application_settings"."deletion_adjourned_period",
"application_settings"."license_trial_ends_on",
"application_settings"."eks_integration_enabled",
"application_settings"."eks_account_id",
"application_settings"."eks_access_key_id",
"application_settings"."encrypted_eks_secret_access_key_iv",
"application_settings"."encrypted_eks_secret_access_key",
"application_settings"."snowplow_app_id",
"application_settings"."productivity_analytics_start_date",
"application_settings"."default_ci_config_path",
"application_settings"."sourcegraph_enabled",
"application_settings"."sourcegraph_url",
"application_settings"."sourcegraph_public_only",
"application_settings"."snippet_size_limit",
"application_settings"."minimum_password_length",
"application_settings"."encrypted_akismet_api_key",
"application_settings"."encrypted_akismet_api_key_iv",
"application_settings"."encrypted_elasticsearch_aws_secret_access_key",
"application_settings"."encrypted_elasticsearch_aws_secret_access_key_iv",
"application_settings"."encrypted_recaptcha_private_key",
"application_settings"."encrypted_recaptcha_private_key_iv",
"application_settings"."encrypted_recaptcha_site_key",
"application_settings"."encrypted_recaptcha_site_key_iv",
"application_settings"."encrypted_slack_app_secret",
"application_settings"."encrypted_slack_app_secret_iv",
"application_settings"."encrypted_slack_app_verification_token",
"application_settings"."encrypted_slack_app_verification_token_iv",
"application_settings"."force_pages_access_control",
"application_settings"."updating_name_disabled_for_users",
"application_settings"."instance_administrators_group_id",
"application_settings"."elasticsearch_indexed_field_length_limit",
"application_settings"."elasticsearch_max_bulk_size_mb",
"application_settings"."elasticsearch_max_bulk_concurrency",
"application_settings"."disable_overriding_approvers_per_merge_request",
"application_settings"."prevent_merge_requests_author_approval",
"application_settings"."prevent_merge_requests_committers_approval",
"application_settings"."email_restrictions_enabled",
"application_settings"."email_restrictions",
"application_settings"."npm_package_requests_forwarding",
"application_settings"."container_expiration_policies_enable_historic_entries",
"application_settings"."issues_create_limit",
"application_settings"."push_rule_id",
"application_settings"."group_owners_can_manage_default_branch_protection",
"application_settings"."container_registry_vendor",
"application_settings"."container_registry_version",
"application_settings"."container_registry_features",
"application_settings"."spam_check_endpoint_url",
"application_settings"."spam_check_endpoint_enabled",
"application_settings"."elasticsearch_pause_indexing",
"application_settings"."repository_storages_weighted",
"application_settings"."max_import_size",
"application_settings"."compliance_frameworks",
"application_settings"."notify_on_unknown_sign_in",
"application_settings"."default_branch_name",
"application_settings"."project_import_limit",
"application_settings"."project_export_limit",
"application_settings"."project_download_export_limit",
"application_settings"."group_import_limit",
"application_settings"."group_export_limit",
"application_settings"."group_download_export_limit",
"application_settings"."maintenance_mode",
"application_settings"."maintenance_mode_message",
"application_settings"."wiki_page_max_content_bytes",
"application_settings"."elasticsearch_indexed_file_size_limit_kb",
"application_settings"."enforce_namespace_storage_limit",
"application_settings"."container_registry_delete_tags_service_timeout",
"application_settings"."kroki_url",
"application_settings"."kroki_enabled",
"application_settings"."elasticsearch_client_request_timeout",
"application_settings"."gitpod_enabled",
"application_settings"."gitpod_url",
"application_settings"."abuse_notification_email",
"application_settings"."require_admin_approval_after_user_signup",
"application_settings"."help_page_documentation_base_url",
"application_settings"."automatic_purchased_storage_allocation",
"application_settings"."encrypted_ci_jwt_signing_key",
"application_settings"."encrypted_ci_jwt_signing_key_iv",
"application_settings"."container_registry_expiration_policies_worker_capacity",
"application_settings"."elasticsearch_analyzers_smartcn_enabled",
"application_settings"."elasticsearch_analyzers_smartcn_search",
"application_settings"."elasticsearch_analyzers_kuromoji_enabled",
"application_settings"."elasticsearch_analyzers_kuromoji_search",
"application_settings"."secret_detection_token_revocation_enabled",
"application_settings"."secret_detection_token_revocation_url",
"application_settings"."encrypted_secret_detection_token_revocation_token",
"application_settings"."encrypted_secret_detection_token_revocation_token_iv",
"application_settings"."domain_denylist_enabled",
"application_settings"."domain_denylist",
"application_settings"."domain_allowlist",
"application_settings"."new_user_signups_cap",
"application_settings"."encrypted_cloud_license_auth_token",
"application_settings"."encrypted_cloud_license_auth_token_iv",
"application_settings"."secret_detection_revocation_token_types_url",
"application_settings"."disable_feed_token",
"application_settings"."personal_access_token_prefix",
"application_settings"."rate_limiting_response_text",
"application_settings"."invisible_captcha_enabled",
"application_settings"."container_registry_cleanup_tags_service_max_list_size",
"application_settings"."git_two_factor_session_expiry",
"application_settings"."keep_latest_artifact",
"application_settings"."notes_create_limit",
"application_settings"."notes_create_limit_allowlist",
"application_settings"."kroki_formats",
"application_settings"."in_product_marketing_emails_enabled",
"application_settings"."asset_proxy_whitelist",
"application_settings"."admin_mode",
"application_settings"."delayed_project_removal",
"application_settings"."lock_delayed_project_removal",
"application_settings"."external_pipeline_validation_service_timeout",
"application_settings"."encrypted_external_pipeline_validation_service_token",
"application_settings"."encrypted_external_pipeline_validation_service_token_iv",
"application_settings"."external_pipeline_validation_service_url",
"application_settings"."throttle_unauthenticated_packages_api_requests_per_period",
"application_settings"."throttle_unauthenticated_packages_api_period_in_seconds",
"application_settings"."throttle_authenticated_packages_api_requests_per_period",
"application_settings"."throttle_authenticated_packages_api_period_in_seconds",
"application_settings"."throttle_unauthenticated_packages_api_enabled",
"application_settings"."throttle_authenticated_packages_api_enabled",
"application_settings"."deactivate_dormant_users",
"application_settings"."whats_new_variant",
"application_settings"."encrypted_spam_check_api_key",
"application_settings"."encrypted_spam_check_api_key_iv",
"application_settings"."floc_enabled",
"application_settings"."elasticsearch_username",
"application_settings"."encrypted_elasticsearch_password",
"application_settings"."encrypted_elasticsearch_password_iv",
"application_settings"."diff_max_lines",
"application_settings"."diff_max_files",
"application_settings"."valid_runner_registrars",
"application_settings"."encrypted_mailgun_signing_key",
"application_settings"."encrypted_mailgun_signing_key_iv",
"application_settings"."mailgun_events_enabled",
"application_settings"."usage_ping_features_enabled",
"application_settings"."encrypted_customers_dot_jwt_signing_key",
"application_settings"."encrypted_customers_dot_jwt_signing_key_iv",
"application_settings"."pypi_package_requests_forwarding",
"application_settings"."throttle_unauthenticated_files_api_requests_per_period",
"application_settings"."throttle_unauthenticated_files_api_period_in_seconds",
"application_settings"."throttle_authenticated_files_api_requests_per_period",
"application_settings"."throttle_authenticated_files_api_period_in_seconds",
"application_settings"."throttle_unauthenticated_files_api_enabled",
"application_settings"."throttle_authenticated_files_api_enabled",
"application_settings"."max_yaml_size_bytes",
"application_settings"."max_yaml_depth",
"application_settings"."throttle_authenticated_git_lfs_requests_per_period",
"application_settings"."throttle_authenticated_git_lfs_period_in_seconds",
"application_settings"."throttle_authenticated_git_lfs_enabled",
"application_settings"."user_deactivation_emails_enabled",
"application_settings"."throttle_unauthenticated_api_enabled",
"application_settings"."throttle_unauthenticated_api_requests_per_period",
"application_settings"."throttle_unauthenticated_api_period_in_seconds",
"application_settings"."jobs_per_stage_page_size",
"application_settings"."sidekiq_job_limiter_mode",
"application_settings"."sidekiq_job_limiter_compression_threshold_bytes",
"application_settings"."sidekiq_job_limiter_limit_bytes",
"application_settings"."suggest_pipeline_enabled",
"application_settings"."throttle_unauthenticated_deprecated_api_requests_per_period",
"application_settings"."throttle_unauthenticated_deprecated_api_period_in_seconds",
"application_settings"."throttle_unauthenticated_deprecated_api_enabled",
"application_settings"."throttle_authenticated_deprecated_api_requests_per_period",
"application_settings"."throttle_authenticated_deprecated_api_period_in_seconds",
"application_settings"."throttle_authenticated_deprecated_api_enabled",
"application_settings"."dependency_proxy_ttl_group_policy_worker_capacity",
"application_settings"."content_validation_endpoint_url",
"application_settings"."encrypted_content_validation_api_key",
"application_settings"."encrypted_content_validation_api_key_iv",
"application_settings"."content_validation_endpoint_enabled",
"application_settings"."sentry_enabled",
"application_settings"."sentry_dsn",
"application_settings"."sentry_clientside_dsn",
"application_settings"."sentry_environment",
"application_settings"."max_ssh_key_lifetime",
"application_settings"."static_objects_external_storage_auth_token_encrypted",
"application_settings"."future_subscriptions",
"application_settings"."packages_cleanup_package_file_worker_capacity",
"application_settings"."container_registry_import_max_tags_count",
"application_settings"."container_registry_import_max_retries",
"application_settings"."container_registry_import_start_max_retries",
"application_settings"."container_registry_import_max_step_duration",
"application_settings"."container_registry_import_target_plan",
"application_settings"."container_registry_import_created_before",
"application_settings"."runner_token_expiration_interval",
"application_settings"."group_runner_token_expiration_interval",
"application_settings"."project_runner_token_expiration_interval",
"application_settings"."ecdsa_sk_key_restriction",
"application_settings"."ed25519_sk_key_restriction",
"application_settings"."users_get_by_id_limit",
"application_settings"."users_get_by_id_limit_allowlist",
"application_settings"."container_registry_expiration_policies_caching",
"application_settings"."search_rate_limit",
"application_settings"."search_rate_limit_unauthenticated",
"application_settings"."encrypted_database_grafana_api_key",
"application_settings"."encrypted_database_grafana_api_key_iv",
"application_settings"."database_grafana_api_url",
"application_settings"."database_grafana_tag",
"application_settings"."public_runner_releases_url",
"application_settings"."encrypted_arkose_labs_public_api_key",
"application_settings"."encrypted_arkose_labs_public_api_key_iv",
"application_settings"."encrypted_arkose_labs_private_api_key",
"application_settings"."encrypted_arkose_labs_private_api_key_iv",
"application_settings"."arkose_labs_verify_api_url",
"application_settings"."delete_inactive_projects",
"application_settings"."inactive_projects_delete_after_months",
"application_settings"."inactive_projects_min_size_mb",
"application_settings"."inactive_projects_send_warning_email_after_months",
"application_settings"."delayed_group_deletion",
"application_settings"."arkose_labs_namespace",
"application_settings"."max_export_size",
"application_settings"."container_registry_pre_import_timeout",
"application_settings"."container_registry_import_timeout",
"application_settings"."pipeline_limit_per_project_user_sha",
"application_settings"."encrypted_slack_app_signing_secret",
"application_settings"."encrypted_slack_app_signing_secret_iv",
"application_settings"."globally_allowed_ips",
"application_settings"."dingtalk_integration_enabled",
"application_settings"."encrypted_dingtalk_corpid",
"application_settings"."encrypted_dingtalk_corpid_iv",
"application_settings"."encrypted_dingtalk_app_key",
"application_settings"."encrypted_dingtalk_app_key_iv",
"application_settings"."encrypted_dingtalk_app_secret",
"application_settings"."encrypted_dingtalk_app_secret_iv",
"application_settings"."password_uppercase_required",
"application_settings"."password_lowercase_required",
"application_settings"."password_number_required",
"application_settings"."password_symbol_required",
"application_settings"."container_registry_pre_import_tags_rate",
"application_settings"."jira_connect_application_key",
"application_settings"."license_usage_data_exported",
"application_settings"."phone_verification_code_enabled",
"application_settings"."max_number_of_repository_downloads",
"application_settings"."max_number_of_repository_downloads_within_time_period",
"application_settings"."feishu_integration_enabled",
"application_settings"."encrypted_feishu_app_key",
"application_settings"."encrypted_feishu_app_key_iv",
"application_settings"."encrypted_feishu_app_secret",
"application_settings"."encrypted_feishu_app_secret_iv",
"application_settings"."git_rate_limit_users_allowlist",
"application_settings"."error_tracking_enabled",
"application_settings"."error_tracking_api_url",
"application_settings"."error_tracking_access_token_encrypted",
"application_settings"."package_registry_cleanup_policies_worker_capacity",
"application_settings"."deactivate_dormant_users_period",
"application_settings"."auto_ban_user_on_excessive_projects_download",
"application_settings"."invitation_flow_enforcement",
"application_settings"."max_pages_custom_domains_per_project",
"application_settings"."cube_api_base_url",
"application_settings"."encrypted_cube_api_key",
"application_settings"."encrypted_cube_api_key_iv",
"application_settings"."maven_package_requests_forwarding",
"application_settings"."dashboard_limit_enabled",
"application_settings"."dashboard_limit",
"application_settings"."dashboard_notification_limit",
"application_settings"."dashboard_enforcement_limit",
"application_settings"."dashboard_limit_new_namespace_creation_enforcement_date",
"application_settings"."jitsu_host",
"application_settings"."jitsu_project_xid",
"application_settings"."clickhouse_connection_string",
"application_settings"."jitsu_administrator_email",
"application_settings"."encrypted_jitsu_administrator_password",
"application_settings"."encrypted_jitsu_administrator_password_iv",
"application_settings"."can_create_group",
"application_settings"."lock_maven_package_requests_forwarding",
"application_settings"."lock_pypi_package_requests_forwarding",
"application_settings"."lock_npm_package_requests_forwarding",
"application_settings"."password_expiration_enabled",
"application_settings"."password_expires_in_days",
"application_settings"."password_expires_notice_before_days",
"application_settings"."product_analytics_enabled",
"application_settings"."jira_connect_proxy_url",
"application_settings"."email_confirmation_setting",
"application_settings"."disable_admin_oauth_scopes",
"application_settings"."default_preferred_language",
"application_settings"."disable_download_button",
"application_settings"."encrypted_telesign_customer_xid",
"application_settings"."encrypted_telesign_customer_xid_iv",
"application_settings"."encrypted_telesign_api_key",
"application_settings"."encrypted_telesign_api_key_iv",
"application_settings"."disable_personal_access_tokens",
"application_settings"."max_terraform_state_size_bytes",
"application_settings"."bulk_import_enabled",
"application_settings"."allow_runner_registration_token",
"application_settings"."user_defaults_to_private_profile",
"application_settings"."allow_possible_spam"
FROM
"application_settings"
ORDER BY
"application_settings"."id" DESC
LIMIT 1
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:/app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'*/
Project LOAD (2.2ms
)
SELECT
"projects".*
FROM ((
SELECT
"projects".*
FROM
"projects"
WHERE
"projects"."namespace_id" = 1)
UNION ALL (
SELECT
"projects".*
FROM
"projects"
INNER JOIN "project_authorizations" ON "project_authorizations"."project_id" = "projects"."id"
WHERE
"projects"."namespace_id" != 1
AND "project_authorizations"."user_id" = 1
AND "project_authorizations"."access_level" = 50)) projects
LEFT JOIN project_features ON projects.id = project_features.project_id
WHERE
"projects"."pending_delete" = FALSE
AND ("project_features"."issues_access_level" > 0
OR "project_features"."issues_access_level" IS NULL)
AND "projects"."hidden" = FALSE
ORDER BY
"projects"."updated_at" DESC
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:bin/rails:4:in `
'*/
query GroupProjects {
group(fullPath: "gitlab-org") {
projects(sort: ACTIVITY_DESC, withIssuesEnabled: true) {
nodes {
name
lastActivityAt
issuesEnabled
mergeRequestsEnabled
}
}
}
}
Sample response
{
"data": {
"group": {
"projects": {
"nodes": [
{
"name": "Security Reports",
"lastActivityAt": "2023-01-19T15:34:14Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "RSpec example",
"lastActivityAt": "2023-01-17T15:25:56Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Gitlab Org - Security policy project",
"lastActivityAt": "2022-08-16T20:27:35Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Gitlab Shell",
"lastActivityAt": "2022-05-05T00:53:08Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Test Cis With Agentid",
"lastActivityAt": "2022-06-17T14:46:46Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Code Quality Test",
"lastActivityAt": "2022-06-03T18:07:58Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Security Policies",
"lastActivityAt": "2022-05-16T14:12:08Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
},
{
"name": "Gitlab Test",
"lastActivityAt": "2022-05-05T00:52:56Z",
"issuesEnabled": true,
"mergeRequestsEnabled": true
}
]
}
}
}
}
Raw SQL
Namespaces::ProjectsFinder.new(namespace: Namespace.find_by_full_path('gitlab-org'), params: { :sort => :latest_activity_desc, :with_issues_enabled => true }).execute
SELECT
"namespaces"."id" AS t0_r0,
"namespaces"."name" AS t0_r1,
"namespaces"."path" AS t0_r2,
"namespaces"."owner_id" AS t0_r3,
"namespaces"."created_at" AS t0_r4,
"namespaces"."updated_at" AS t0_r5,
"namespaces"."type" AS t0_r6,
"namespaces"."description" AS t0_r7,
"namespaces"."avatar" AS t0_r8,
"namespaces"."membership_lock" AS t0_r9,
"namespaces"."share_with_group_lock" AS t0_r10,
"namespaces"."visibility_level" AS t0_r11,
"namespaces"."request_access_enabled" AS t0_r12,
"namespaces"."ldap_sync_status" AS t0_r13,
"namespaces"."ldap_sync_error" AS t0_r14,
"namespaces"."ldap_sync_last_update_at" AS t0_r15,
"namespaces"."ldap_sync_last_successful_update_at" AS t0_r16,
"namespaces"."ldap_sync_last_sync_at" AS t0_r17,
"namespaces"."description_html" AS t0_r18,
"namespaces"."lfs_enabled" AS t0_r19,
"namespaces"."parent_id" AS t0_r20,
"namespaces"."shared_runners_minutes_limit" AS t0_r21,
"namespaces"."repository_size_limit" AS t0_r22,
"namespaces"."require_two_factor_authentication" AS t0_r23,
"namespaces"."two_factor_grace_period" AS t0_r24,
"namespaces"."cached_markdown_version" AS t0_r25,
"namespaces"."project_creation_level" AS t0_r26,
"namespaces"."runners_token" AS t0_r27,
"namespaces"."file_template_project_id" AS t0_r28,
"namespaces"."saml_discovery_token" AS t0_r29,
"namespaces"."runners_token_encrypted" AS t0_r30,
"namespaces"."custom_project_templates_group_id" AS t0_r31,
"namespaces"."auto_devops_enabled" AS t0_r32,
"namespaces"."extra_shared_runners_minutes_limit" AS t0_r33,
"namespaces"."last_ci_minutes_notification_at" AS t0_r34,
"namespaces"."last_ci_minutes_usage_notification_level" AS t0_r35,
"namespaces"."subgroup_creation_level" AS t0_r36,
"namespaces"."emails_disabled" AS t0_r37,
"namespaces"."max_pages_size" AS t0_r38,
"namespaces"."max_artifacts_size" AS t0_r39,
"namespaces"."mentions_disabled" AS t0_r40,
"namespaces"."default_branch_protection" AS t0_r41,
"namespaces"."unlock_membership_to_ldap" AS t0_r42,
"namespaces"."max_personal_access_token_lifetime" AS t0_r43,
"namespaces"."push_rule_id" AS t0_r44,
"namespaces"."shared_runners_enabled" AS t0_r45,
"namespaces"."allow_descendants_override_disabled_shared_runners" AS t0_r46,
"namespaces"."traversal_ids" AS t0_r47,
"routes"."id" AS t1_r0,
"routes"."source_id" AS t1_r1,
"routes"."source_type" AS t1_r2,
"routes"."path" AS t1_r3,
"routes"."created_at" AS t1_r4,
"routes"."updated_at" AS t1_r5,
"routes"."name" AS t1_r6,
"routes"."namespace_id" AS t1_r7
FROM
"namespaces"
LEFT OUTER JOIN "routes" ON "routes"."source_type" = 'Namespace'
AND "routes"."source_id" = "namespaces"."id"
WHERE
"routes"."path" = 'gitlab-org'
LIMIT 1
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:/app/models/concerns/routable.rb:29:in `find_by_full_path'*/
Project LOAD (1.2ms
)
SELECT
"projects".*
FROM
"projects"
LEFT JOIN project_features ON projects.id = project_features.project_id
WHERE
"projects"."namespace_id" = 22
AND ("project_features"."issues_access_level" IN (20, 30)
OR "project_features"."issues_access_level" IS NULL)
ORDER BY
"projects"."updated_at" DESC
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:bin/rails:4:in `
'*/
Route LOAD (0.4ms
)
SELECT
"routes".*
FROM
"routes"
WHERE
"routes"."source_type" = 'Project'
AND "routes"."source_id" IN (10, 18, 12, 2, 14, 13, 11, 1)
/*application:console,db_config_name:main,console_hostname:Pauls-MacBook-Pro.local,console_username:paul,line:bin/rails:4:in `
'*/
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #374098 (closed)
Edited by Paul Gascou-Vaillancourt