diff --git a/Dangerfile b/Dangerfile index ab96c43c4e5..212097f6a68 100644 --- a/Dangerfile +++ b/Dangerfile @@ -19,10 +19,17 @@ anything_to_post = status_report.values.any? { |data| data.any? } return unless helper.ci? -if project_helper.labels_to_add.any? +def post_labels gitlab.api.update_merge_request(gitlab.mr_json['project_id'], gitlab.mr_json['iid'], add_labels: project_helper.labels_to_add.join(',')) +rescue Gitlab::Error::Forbidden + labels = project_helper.labels_to_add.map { |label| %Q(~"#{label}") } + warn("This Merge Request needs to be labelled with #{labels.join(' ')}. Please request a reviewer or maintainer to add them.") +end + +if project_helper.labels_to_add.any? + post_labels end if anything_to_post diff --git a/Gemfile b/Gemfile index 269aa282952..87a0cff84c1 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ gem 'omniauth-auth0', '~> 2.0.0' gem 'omniauth-azure-activedirectory-v2', '~> 1.0' gem 'omniauth-azure-oauth2', '~> 0.0.9' # Deprecated v1 version gem 'omniauth-cas3', '~> 1.1.4' +gem 'omniauth-dingtalk-oauth2', '~> 1.0' gem 'omniauth-facebook', '~> 4.0.0' gem 'omniauth-github', '~> 1.4' gem 'omniauth-gitlab', '~> 1.0.2' diff --git a/Gemfile.lock b/Gemfile.lock index 106c6ef1ebb..51c3b29926c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -841,6 +841,8 @@ GEM addressable (~> 2.3) nokogiri (~> 1.7, >= 1.7.1) omniauth (~> 1.2) + omniauth-dingtalk-oauth2 (1.0.0) + omniauth-oauth2 (~> 1.7.1) omniauth-facebook (4.0.0) omniauth-oauth2 (~> 1.2) omniauth-github (1.4.0) @@ -1547,6 +1549,7 @@ DEPENDENCIES omniauth-azure-activedirectory-v2 (~> 1.0) omniauth-azure-oauth2 (~> 0.0.9) omniauth-cas3 (~> 1.1.4) + omniauth-dingtalk-oauth2 (~> 1.0) omniauth-facebook (~> 4.0.0) omniauth-github (~> 1.4) omniauth-gitlab (~> 1.0.2) diff --git a/app/assets/images/auth_buttons/dingtalk_64.png b/app/assets/images/auth_buttons/dingtalk_64.png new file mode 100644 index 00000000000..77b3fa752bc Binary files /dev/null and b/app/assets/images/auth_buttons/dingtalk_64.png differ diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb index 1df7b9ed165..0f87690bba5 100644 --- a/app/controllers/projects/blame_controller.rb +++ b/app/controllers/projects/blame_controller.rb @@ -10,6 +10,7 @@ class Projects::BlameController < Projects::ApplicationController before_action :authorize_download_code! feature_category :source_code_management + urgency :low, [:show] def show @blob = @repository.blob_at(@commit.id, @path) diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 17fd28ee06a..cd50c8cf5b1 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -40,6 +40,7 @@ class Projects::BlobController < Projects::ApplicationController track_redis_hll_event :create, :update, name: 'g_edit_by_sfe' feature_category :source_code_management + urgency :low, [:create, :show, :edit, :update, :diff] before_action do push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml) diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 3b9dde68ded..63ac5f97420 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -14,6 +14,7 @@ class Projects::BranchesController < Projects::ApplicationController before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts] feature_category :source_code_management + urgency :low, [:index, :diverging_commit_counts, :create, :destroy] def index respond_to do |format| diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 6748be06ded..62935e133c5 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -24,6 +24,7 @@ class Projects::CommitController < Projects::ApplicationController COMMIT_DIFFS_PER_PAGE = 20 feature_category :source_code_management + urgency :low, [:pipelines, :merge_requests, :show] def show apply_diff_view_cookie! diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index 0132306dd90..1ca35903703 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -17,6 +17,7 @@ class Projects::CommitsController < Projects::ApplicationController before_action :set_commits, except: :commits_root feature_category :source_code_management + urgency :low, [:signatures, :show] def commits_root redirect_to project_commits_path(@project, @project.default_branch) diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 99f62c18593..07f7c1cf7de 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -21,6 +21,7 @@ class Projects::CompareController < Projects::ApplicationController before_action :validate_refs! feature_category :source_code_management + urgency :low, [:show, :create, :signatures] # Diffs may be pretty chunky, the less is better in this endpoint. # Pagination design guides: https://design.gitlab.com/components/pagination/#behavior diff --git a/app/controllers/projects/find_file_controller.rb b/app/controllers/projects/find_file_controller.rb index 89e72d98a33..c6bc115e737 100644 --- a/app/controllers/projects/find_file_controller.rb +++ b/app/controllers/projects/find_file_controller.rb @@ -11,6 +11,7 @@ class Projects::FindFileController < Projects::ApplicationController before_action :authorize_download_code! feature_category :source_code_management + urgency :low, [:show, :list] def show return render_404 unless @repository.commit(@ref) diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 7135c0d959e..5154f145b46 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -15,6 +15,7 @@ class Projects::ForksController < Projects::ApplicationController before_action :authorize_fork_namespace!, only: [:create] feature_category :source_code_management + urgency :low, [:index] before_action do push_frontend_feature_flag(:fork_project_form, @project, default_enabled: :yaml) diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb index 7a7961c28bb..82eddd618a5 100644 --- a/app/controllers/projects/graphs_controller.rb +++ b/app/controllers/projects/graphs_controller.rb @@ -12,6 +12,7 @@ class Projects::GraphsController < Projects::ApplicationController track_redis_hll_event :charts, name: 'p_analytics_repo' feature_category :source_code_management + urgency :low, [:show] def show respond_to do |format| diff --git a/app/controllers/projects/network_controller.rb b/app/controllers/projects/network_controller.rb index f3a7bc7913e..84ac9fb01fd 100644 --- a/app/controllers/projects/network_controller.rb +++ b/app/controllers/projects/network_controller.rb @@ -11,6 +11,7 @@ class Projects::NetworkController < Projects::ApplicationController before_action :assign_commit feature_category :source_code_management + urgency :low, [:show] def show @url = project_network_path(@project, @ref, @options.merge(format: :json)) diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb index 4d23c853334..73eb6bb2bf2 100644 --- a/app/controllers/projects/refs_controller.rb +++ b/app/controllers/projects/refs_controller.rb @@ -12,6 +12,7 @@ class Projects::RefsController < Projects::ApplicationController before_action :authorize_download_code! feature_category :source_code_management + urgency :low, [:switch, :logs_tree] def switch respond_to do |format| diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index 728231dbdbd..cc419bab687 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -12,6 +12,7 @@ module Projects feature_category :source_code_management, [:show, :cleanup] feature_category :continuous_delivery, [:create_deploy_token] + urgency :low, [:show] def show render_show diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb index 00b0b791f01..de0faaca9c0 100644 --- a/app/controllers/projects/tags_controller.rb +++ b/app/controllers/projects/tags_controller.rb @@ -11,6 +11,7 @@ class Projects::TagsController < Projects::ApplicationController before_action :authorize_admin_tag!, only: [:new, :create, :destroy] feature_category :source_code_management + urgency :low, [:new, :show, :index] # rubocop: disable CodeReuse/ActiveRecord def index diff --git a/app/controllers/projects/templates_controller.rb b/app/controllers/projects/templates_controller.rb index 4bad6dc1b3d..6d06b05c1e9 100644 --- a/app/controllers/projects/templates_controller.rb +++ b/app/controllers/projects/templates_controller.rb @@ -6,6 +6,7 @@ class Projects::TemplatesController < Projects::ApplicationController before_action :get_template_class feature_category :source_code_management + urgency :low, [:names] def index templates = @template_type.template_subsets(project) diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 72bb03b63a3..c36b30e198b 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -23,6 +23,7 @@ class Projects::TreeController < Projects::ApplicationController end feature_category :source_code_management + urgency :low, [:show] def show return render_404 unless @commit diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index bbf33865a26..a5fa1807cc9 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -52,6 +52,7 @@ class ProjectsController < Projects::ApplicationController feature_category :team_planning, [:preview_markdown, :new_issuable_address] feature_category :importers, [:export, :remove_export, :generate_new_export, :download_export] feature_category :code_review, [:unfoldered_environment_names] + urgency :low, [:refs] def index redirect_to(current_user ? root_path : explore_root_path) diff --git a/app/controllers/repositories/lfs_api_controller.rb b/app/controllers/repositories/lfs_api_controller.rb index a7719516cb6..30cafb6747e 100644 --- a/app/controllers/repositories/lfs_api_controller.rb +++ b/app/controllers/repositories/lfs_api_controller.rb @@ -13,6 +13,7 @@ module Repositories # added here as a part of the refactor, will be removed # https://gitlab.com/gitlab-org/gitlab/-/issues/328692 delegate :deploy_token, :user, to: :authentication_result, allow_nil: true + urgency :medium, [:batch] def batch unless objects.present? diff --git a/app/controllers/repositories/lfs_storage_controller.rb b/app/controllers/repositories/lfs_storage_controller.rb index 6ec63a0f939..252b604dcb0 100644 --- a/app/controllers/repositories/lfs_storage_controller.rb +++ b/app/controllers/repositories/lfs_storage_controller.rb @@ -11,6 +11,8 @@ module Repositories # added here as a part of the refactor, will be removed # https://gitlab.com/gitlab-org/gitlab/-/issues/328692 delegate :deploy_token, :user, to: :authentication_result, allow_nil: true + urgency :medium, [:download, :upload_authorize] + urgency :low, [:upload_finalize] def download lfs_object = LfsObject.find_by_oid(oid) diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb index a0c3a6f2f52..6fe92a5a978 100644 --- a/app/helpers/auth_helper.rb +++ b/app/helpers/auth_helper.rb @@ -8,6 +8,7 @@ module AuthHelper azure_oauth2 bitbucket facebook + dingtalk github gitlab google_oauth2 diff --git a/app/models/concerns/integrations/reactively_cached.rb b/app/models/concerns/integrations/reactively_cached.rb new file mode 100644 index 00000000000..62eff06c8e2 --- /dev/null +++ b/app/models/concerns/integrations/reactively_cached.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Integrations + module ReactivelyCached + extend ActiveSupport::Concern + + included do + include ::ReactiveCaching + + # Default cache key: class name + project_id + self.reactive_cache_key = ->(integration) { [integration.class.model_name.singular, integration.project_id] } + self.reactive_cache_work_type = :external_dependency + end + end +end diff --git a/app/models/concerns/reactive_service.rb b/app/models/concerns/reactive_service.rb deleted file mode 100644 index c444f238944..00000000000 --- a/app/models/concerns/reactive_service.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module ReactiveService - extend ActiveSupport::Concern - - included do - include ReactiveCaching - - # Default cache key: class name + project_id - self.reactive_cache_key = ->(service) { [service.class.model_name.singular, service.project_id] } - self.reactive_cache_work_type = :external_dependency - end -end diff --git a/app/models/integrations/bamboo.rb b/app/models/integrations/bamboo.rb index 1a7cbaa34c7..0774b84b69f 100644 --- a/app/models/integrations/bamboo.rb +++ b/app/models/integrations/bamboo.rb @@ -3,7 +3,7 @@ module Integrations class Bamboo < BaseCi include ActionView::Helpers::UrlHelper - include ReactiveService + include ReactivelyCached prop_accessor :bamboo_url, :build_key, :username, :password diff --git a/app/models/integrations/buildkite.rb b/app/models/integrations/buildkite.rb index 94a37f0c4f2..9fad3a42647 100644 --- a/app/models/integrations/buildkite.rb +++ b/app/models/integrations/buildkite.rb @@ -5,7 +5,7 @@ require "addressable/uri" module Integrations class Buildkite < BaseCi include HasWebHook - include ReactiveService + include ReactivelyCached extend Gitlab::Utils::Override ENDPOINT = "https://buildkite.com" diff --git a/app/models/integrations/drone_ci.rb b/app/models/integrations/drone_ci.rb index c93ae432fe9..6843aa21892 100644 --- a/app/models/integrations/drone_ci.rb +++ b/app/models/integrations/drone_ci.rb @@ -3,7 +3,7 @@ module Integrations class DroneCi < BaseCi include HasWebHook - include ReactiveService + include ReactivelyCached include ServicePushDataValidations extend Gitlab::Utils::Override diff --git a/app/models/integrations/teamcity.rb b/app/models/integrations/teamcity.rb index 3f868b57597..9da9c0d2909 100644 --- a/app/models/integrations/teamcity.rb +++ b/app/models/integrations/teamcity.rb @@ -2,7 +2,7 @@ module Integrations class Teamcity < BaseCi - include ReactiveService + include ReactivelyCached include ServicePushDataValidations prop_accessor :teamcity_url, :build_type, :username, :password diff --git a/app/views/dashboard/_snippets_head.html.haml b/app/views/dashboard/_snippets_head.html.haml index e96b5695ddc..8c468812e33 100644 --- a/app/views/dashboard/_snippets_head.html.haml +++ b/app/views/dashboard/_snippets_head.html.haml @@ -7,10 +7,6 @@ = link_to _("New snippet"), new_snippet_path, class: "gl-button btn btn-confirm", title: _("New snippet") .top-area - %ul.nav-links.nav.nav-tabs - = nav_link(page: dashboard_snippets_path, html_options: {class: 'home'}) do - = link_to dashboard_snippets_path, title: 'Your snippets', data: {placement: 'right'} do - Your snippets - = nav_link(page: explore_snippets_path) do - = link_to explore_snippets_path, title: 'Explore snippets', data: {placement: 'right'} do - Explore snippets + = gl_tabs_nav({ class: 'gl-border-0' }) do + = gl_tab_link_to _('Your snippets'), dashboard_snippets_path, { title: _('Your snippets') } + = gl_tab_link_to _('Explore snippets'), explore_snippets_path, { title: _('Explore snippets') } diff --git a/app/views/dashboard/projects/_nav.html.haml b/app/views/dashboard/projects/_nav.html.haml index f9b61bf1f3e..3e39872902d 100644 --- a/app/views/dashboard/projects/_nav.html.haml +++ b/app/views/dashboard/projects/_nav.html.haml @@ -14,8 +14,6 @@ = link_to s_('DashboardProjects|All'), dashboard_projects_path, class: params[:personal].present? ? inactive_class : active_class = link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), class: params[:personal].present? ? active_class : inactive_class - else - %ul.nav-links.mobile-separator.nav.nav-tabs - = nav_link(html_options: { class: ("active" unless params[:personal].present?) }) do - = link_to s_('DashboardProjects|All'), dashboard_projects_path - = nav_link(html_options: { class: ("active" if params[:personal].present?) }) do - = link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true) + = gl_tabs_nav do + = gl_tab_link_to s_('DashboardProjects|All'), dashboard_projects_path, { item_active: params[:personal].blank? } + = gl_tab_link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), { item_active: params[:personal].present? } diff --git a/app/views/explore/projects/topic.html.haml b/app/views/explore/projects/topic.html.haml index 9b6e4acb02a..aeb040ea61f 100644 --- a/app/views/explore/projects/topic.html.haml +++ b/app/views/explore/projects/topic.html.haml @@ -7,7 +7,7 @@ .gl-text-center.gl-bg-gray-10.gl-pb-2.gl-pt-6 .gl-pb-5.gl-align-items-center.gl-justify-content-center.gl-display-flex - .avatar-container.s60.gl-flex-shrink-0 + .avatar-container.rect-avatar.s60.gl-flex-shrink-0 = topic_icon(@topic, alt: _('Topic avatar'), class: 'avatar topic-avatar s60') - if @topic.name.length > max_topic_name_length %h1.gl-mt-3.str-truncated.has-tooltip{ title: @topic.name } diff --git a/app/views/shared/labels/_nav.html.haml b/app/views/shared/labels/_nav.html.haml index a0225e35c90..47e9d9b0e4a 100644 --- a/app/views/shared/labels/_nav.html.haml +++ b/app/views/shared/labels/_nav.html.haml @@ -1,14 +1,10 @@ - subscribed = params[:subscribed] .top-area.adjust - %ul.nav-links.nav.nav-tabs - %li{ class: active_when(subscribed != 'true') }> - = link_to labels_filter_path do - = _('All') + = gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0' }) do + = gl_tab_link_to _('All'), labels_filter_path, { item_active: subscribed != 'true' } - if current_user - %li{ class: active_when(subscribed == 'true') }> - = link_to labels_filter_path(subscribed: 'true') do - = _('Subscribed') + = gl_tab_link_to _('Subscribed'), labels_filter_path(subscribed: 'true'), { item_active: subscribed == 'true' } .nav-controls = form_tag labels_filter_path, method: :get do = hidden_field_tag :subscribed, params[:subscribed] diff --git a/config/feature_flags/development/dependency_proxy_manifest_workhorse.yml b/config/feature_flags/development/dependency_proxy_manifest_workhorse.yml index 5ff6fc93e0a..f1e3be78da8 100644 --- a/config/feature_flags/development/dependency_proxy_manifest_workhorse.yml +++ b/config/feature_flags/development/dependency_proxy_manifest_workhorse.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/344216 milestone: '14.4' type: development group: group::package -default_enabled: false +default_enabled: true diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index bb69c215f8d..4e5e15d261b 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -1024,6 +1024,9 @@ production: &base # - { name: 'bitbucket', # app_id: 'YOUR_APP_ID', # app_secret: 'YOUR_APP_SECRET' } + # - { name: 'dingtalk', + # app_id: 'YOUR_APP_ID', + # app_secret: 'YOUR_APP_SECRET' } # - { name: 'gitlab', # app_id: 'YOUR_APP_ID', # app_secret: 'YOUR_APP_SECRET', @@ -1515,6 +1518,9 @@ test: - { name: 'bitbucket', app_id: 'YOUR_APP_ID', app_secret: 'YOUR_APP_SECRET' } + - { name: 'dingtalk', + app_id: 'YOUR_APP_ID', + app_secret: 'YOUR_APP_SECRET' } - { name: 'gitlab', app_id: 'YOUR_APP_ID', app_secret: 'YOUR_APP_SECRET', diff --git a/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb b/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb new file mode 100644 index 00000000000..01507908e0f --- /dev/null +++ b/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddHasShimoToProjectSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :project_settings, :has_shimo, :boolean, default: false, null: false + end +end diff --git a/db/schema_migrations/20211110100050 b/db/schema_migrations/20211110100050 new file mode 100644 index 00000000000..eed0afbac1c --- /dev/null +++ b/db/schema_migrations/20211110100050 @@ -0,0 +1 @@ +54b83ba1f8e8aa8a23f230664bcd6cc068a2df2d669e395713f0805d0f054f9c \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index e0efa8b9c39..13e7848a190 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -18302,6 +18302,7 @@ CREATE TABLE project_settings ( previous_default_branch text, warn_about_potentially_unwanted_characters boolean DEFAULT true NOT NULL, merge_commit_template text, + has_shimo boolean DEFAULT false NOT NULL, CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)), CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL)), CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)) diff --git a/doc/development/reactive_caching.md b/doc/development/reactive_caching.md index 3c0a1419604..5aaf4c72e64 100644 --- a/doc/development/reactive_caching.md +++ b/doc/development/reactive_caching.md @@ -74,7 +74,7 @@ For more information, read the internal issue ### In models and integrations -The ReactiveCaching concern can be used in models as well as `integrations` +The ReactiveCaching concern can be used in models as well as integrations (`app/models/integrations`). 1. Include the concern in your model or integration. @@ -88,7 +88,7 @@ The ReactiveCaching concern can be used in models as well as `integrations` To include the concern in an integration: ```ruby - include ReactiveService + include Integrations::ReactivelyCached ``` 1. Implement the `calculate_reactive_cache` method in your model or integration. @@ -201,15 +201,15 @@ There are some `class_attribute` options which can be tweaked. and `"ExampleModel:1:arg1:arg2:alive"` respectively, where `ExampleModel` is the name of the model, `1` is the ID of the record, `arg1` and `arg2` are parameters passed to `with_reactive_cache`. -- If you're including this concern in a service instead, you must override - the default by adding the following to your service: +- If you're including this concern in an integration (`app/models/integrations/`) instead, you must override + the default by adding the following to your integration: ```ruby - self.reactive_cache_key = ->(service) { [service.class.model_name.singular, service.project_id] } + self.reactive_cache_key = ->(integration) { [integration.class.model_name.singular, integration.project_id] } ``` If your reactive_cache_key is exactly like the above, you can use the existing - `ReactiveService` concern instead. + `Integrations::ReactivelyCached` concern instead. #### `self.reactive_cache_lease_timeout` diff --git a/doc/user/infrastructure/clusters/manage/management_project_applications/apparmor.md b/doc/user/infrastructure/clusters/manage/management_project_applications/apparmor.md index 7fbbbac866c..ae335a180e8 100644 --- a/doc/user/infrastructure/clusters/manage/management_project_applications/apparmor.md +++ b/doc/user/infrastructure/clusters/manage/management_project_applications/apparmor.md @@ -4,7 +4,7 @@ group: Container Security info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# Install AppArmor with a cluster management project +# Install AppArmor with a cluster management project **(FREE)** > [Introduced](https://gitlab.com/gitlab-org/project-templates/cluster-management/-/merge_requests/5) in GitLab 14.0. diff --git a/doc/user/infrastructure/clusters/manage/management_project_applications/cilium.md b/doc/user/infrastructure/clusters/manage/management_project_applications/cilium.md index c19bfbfb1b1..b5959624954 100644 --- a/doc/user/infrastructure/clusters/manage/management_project_applications/cilium.md +++ b/doc/user/infrastructure/clusters/manage/management_project_applications/cilium.md @@ -4,7 +4,7 @@ group: Container Security info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# Install Cilium with a cluster management project +# Install Cilium with a cluster management project **(FREE)** > [Introduced](https://gitlab.com/gitlab-org/project-templates/cluster-management/-/merge_requests/5) in GitLab 14.0. diff --git a/doc/user/infrastructure/clusters/manage/management_project_applications/falco.md b/doc/user/infrastructure/clusters/manage/management_project_applications/falco.md index 7bd2a4a5133..50401e9a391 100644 --- a/doc/user/infrastructure/clusters/manage/management_project_applications/falco.md +++ b/doc/user/infrastructure/clusters/manage/management_project_applications/falco.md @@ -4,7 +4,7 @@ group: Container Security info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# Install Falco with a cluster management project +# Install Falco with a cluster management project **(FREE)** > [Introduced](https://gitlab.com/gitlab-org/project-templates/cluster-management/-/merge_requests/5) in GitLab 14.0. diff --git a/doc/user/infrastructure/clusters/manage/management_project_applications/fluentd.md b/doc/user/infrastructure/clusters/manage/management_project_applications/fluentd.md index c5de0511c2f..ea3a3503f9b 100644 --- a/doc/user/infrastructure/clusters/manage/management_project_applications/fluentd.md +++ b/doc/user/infrastructure/clusters/manage/management_project_applications/fluentd.md @@ -4,7 +4,7 @@ group: Container Security info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# Install Fluentd with a cluster management project +# Install Fluentd with a cluster management project **(FREE)** > [Introduced](https://gitlab.com/gitlab-org/project-templates/cluster-management/-/merge_requests/5) in GitLab 14.0. diff --git a/lib/api/branches.rb b/lib/api/branches.rb index 0db5bb82296..462c4a3de4c 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -41,7 +41,7 @@ module API optional :page_token, type: String, desc: 'Name of branch to start the paginaition from' end - get ':id/repository/branches' do + get ':id/repository/branches', urgency: :low do ff_enabled = Feature.enabled?(:api_caching_rate_limit_branches, user_project, default_enabled: :yaml) cache_action_if(ff_enabled, [user_project, :branches, current_user, declared_params], expires_in: 30.seconds) do @@ -86,7 +86,7 @@ module API head do user_project.repository.branch_exists?(params[:branch]) ? no_content! : not_found! end - get do + get '/', urgency: :low do branch = find_branch!(params[:branch]) present branch, with: Entities::Branch, current_user: current_user, project: user_project diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 10dc51556b9..8b8d8192524 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -27,7 +27,7 @@ module API params do requires :id, type: String, desc: 'The ID of a project' end - resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS, urgency: :low do desc 'Get a project repository commits' do success Entities::Commit end @@ -43,7 +43,7 @@ module API optional :trailers, type: Boolean, desc: 'Parse and include Git trailers for every commit', default: false use :pagination end - get ':id/repository/commits' do + get ':id/repository/commits', urgency: :low do path = params[:path] before = params[:until] after = params[:since] @@ -169,7 +169,7 @@ module API requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag' use :pagination end - get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do + get ':id/repository/commits/:sha/diff', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS, urgency: :low do commit = user_project.commit(params[:sha]) not_found! 'Commit' unless commit @@ -295,7 +295,7 @@ module API optional :type, type: String, values: %w[branch tag all], default: 'all', desc: 'Scope' use :pagination end - get ':id/repository/commits/:sha/refs', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do + get ':id/repository/commits/:sha/refs', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS, urgency: :low do commit = user_project.commit(params[:sha]) not_found!('Commit') unless commit @@ -363,7 +363,7 @@ module API requires :sha, type: String, desc: 'A commit sha, or the name of a branch or tag on which to find Merge Requests' use :pagination end - get ':id/repository/commits/:sha/merge_requests', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS do + get ':id/repository/commits/:sha/merge_requests', requirements: API::COMMIT_ENDPOINT_REQUIREMENTS, urgency: :low do authorize! :read_merge_request, user_project commit = user_project.commit(params[:sha]) diff --git a/lib/api/files.rb b/lib/api/files.rb index 9d2b7cce837..39b3904ec90 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -122,7 +122,7 @@ module API requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' optional :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false end - head ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS do + head ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do assign_file_vars! set_http_headers(blob_data) @@ -133,7 +133,7 @@ module API requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' optional :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false end - get ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS do + get ":id/repository/files/:file_path/raw", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do assign_file_vars! no_cache_headers @@ -147,7 +147,7 @@ module API requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' requires :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false end - head ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do + head ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do assign_file_vars! set_http_headers(blob_data) @@ -174,7 +174,7 @@ module API params do use :extended_file_params end - post ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do + post ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do authorize! :push_code, user_project file_params = declared_params(include_missing: false) @@ -192,7 +192,7 @@ module API params do use :extended_file_params end - put ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS do + put ":id/repository/files/:file_path", requirements: FILE_ENDPOINT_REQUIREMENTS, urgency: :low do authorize! :push_code, user_project file_params = declared_params(include_missing: false) diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb index dc9257ebd62..d8e39d089e4 100644 --- a/lib/api/internal/base.rb +++ b/lib/api/internal/base.rb @@ -145,7 +145,7 @@ module API check_allowed(params) end - post "/lfs_authenticate", feature_category: :source_code_management do + post "/lfs_authenticate", feature_category: :source_code_management, urgency: :high do not_found! unless container&.lfs_enabled? status 200 diff --git a/lib/api/internal/lfs.rb b/lib/api/internal/lfs.rb index 66baa4f1034..e94da8d34e0 100644 --- a/lib/api/internal/lfs.rb +++ b/lib/api/internal/lfs.rb @@ -24,7 +24,7 @@ module API requires :oid, type: String, desc: 'The object ID to query' requires :gl_repository, type: String, desc: "Project identifier (e.g. project-1)" end - get "/" do + get "/", urgency: :high do lfs_object = find_lfs_object(params[:oid]) not_found! unless lfs_object diff --git a/lib/api/merge_request_approvals.rb b/lib/api/merge_request_approvals.rb index 83150bb51ca..dd49624c74f 100644 --- a/lib/api/merge_request_approvals.rb +++ b/lib/api/merge_request_approvals.rb @@ -25,7 +25,7 @@ module API # Examples: # GET /projects/:id/merge_requests/:merge_request_iid/approvals desc 'List approvals for merge request' - get 'approvals' do + get 'approvals', urgency: :low do not_found!("Merge Request") unless can?(current_user, :read_merge_request, user_project) merge_request = find_merge_request_with_access(params[:merge_request_iid]) @@ -47,7 +47,7 @@ module API use :ee_approval_params end - post 'approve' do + post 'approve', urgency: :low do merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request) check_sha_param!(params, merge_request) @@ -63,7 +63,7 @@ module API end desc 'Remove an approval from a merge request' - post 'unapprove' do + post 'unapprove', urgency: :low do merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request) success = ::MergeRequests::RemoveApprovalService diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 57b67553fda..9f0077d23d8 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -404,7 +404,7 @@ module API use :collection_params use :with_custom_attributes end - get ':id/forks', feature_category: :source_code_management do + get ':id/forks', feature_category: :source_code_management, urgency: :low do forks = ForkProjectsFinder.new(user_project, params: project_finder_params, current_user: current_user).execute present_projects forks, request_scope: user_project @@ -514,7 +514,7 @@ module API end desc 'Get languages in project repository' - get ':id/languages', feature_category: :source_code_management do + get ':id/languages', feature_category: :source_code_management, urgency: :medium do ::Projects::RepositoryLanguagesService .new(user_project, current_user) .execute.to_h { |lang| [lang.name, lang.share] } diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb index 3cebc308f51..a4f5dfefae6 100644 --- a/lib/api/protected_branches.rb +++ b/lib/api/protected_branches.rb @@ -91,7 +91,7 @@ module API requires :name, type: String, desc: 'The name of the protected branch' end # rubocop: disable CodeReuse/ActiveRecord - delete ':id/protected_branches/:name', requirements: BRANCH_ENDPOINT_REQUIREMENTS do + delete ':id/protected_branches/:name', requirements: BRANCH_ENDPOINT_REQUIREMENTS, urgency: :low do protected_branch = user_project.protected_branches.find_by!(name: params[:name]) destroy_conditionally!(protected_branch) do diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index c6cedb9f060..2dd0e40afba 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -79,7 +79,7 @@ module API optional :page_token, type: String, desc: 'Record from which to start the keyset pagination' end end - get ':id/repository/tree' do + get ':id/repository/tree', urgency: :low do tree_finder = ::Repositories::TreeFinder.new(user_project, declared_params(include_missing: false)) not_found!("Tree") unless tree_finder.commit_exists? @@ -144,7 +144,7 @@ module API optional :from_project_id, type: String, desc: 'The project to compare from' optional :straight, type: Boolean, desc: 'Comparison method, `true` for direct comparison between `from` and `to` (`from`..`to`), `false` to compare using merge base (`from`...`to`)', default: false end - get ':id/repository/compare' do + get ':id/repository/compare', urgency: :low do ff_enabled = Feature.enabled?(:api_caching_rate_limit_repository_compare, user_project, default_enabled: :yaml) target_project = fetch_target_project(current_user, user_project, params) diff --git a/lib/api/tags.rb b/lib/api/tags.rb index 9bcb1503194..043d6d77f93 100644 --- a/lib/api/tags.rb +++ b/lib/api/tags.rb @@ -23,7 +23,7 @@ module API optional :search, type: String, desc: 'Return list of tags matching the search criteria' use :pagination end - get ':id/repository/tags', feature_category: :source_code_management do + get ':id/repository/tags', feature_category: :source_code_management, urgency: :low do tags = ::TagsFinder.new(user_project.repository, sort: "#{params[:order_by]}_#{params[:sort]}", search: params[:search]).execute diff --git a/lib/gitlab/auth/o_auth/provider.rb b/lib/gitlab/auth/o_auth/provider.rb index ab6ac815601..41a8739b0b6 100644 --- a/lib/gitlab/auth/o_auth/provider.rb +++ b/lib/gitlab/auth/o_auth/provider.rb @@ -5,6 +5,7 @@ module Gitlab module OAuth class Provider LABELS = { + "dingtalk" => "DingTalk", "github" => "GitHub", "gitlab" => "GitLab.com", "google_oauth2" => "Google", diff --git a/locale/gitlab.pot b/locale/gitlab.pot index acf25deb567..c16b9e706c6 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -14044,6 +14044,9 @@ msgstr "" msgid "Explore public groups" msgstr "" +msgid "Explore snippets" +msgstr "" + msgid "Explore topics" msgstr "" @@ -40082,6 +40085,9 @@ msgstr "" msgid "Your sign-in page is %{url}." msgstr "" +msgid "Your snippets" +msgstr "" + msgid "Your subscription expired!" msgstr "" diff --git a/spec/controllers/profiles/accounts_controller_spec.rb b/spec/controllers/profiles/accounts_controller_spec.rb index c6e7866a659..011528016ce 100644 --- a/spec/controllers/profiles/accounts_controller_spec.rb +++ b/spec/controllers/profiles/accounts_controller_spec.rb @@ -31,7 +31,7 @@ RSpec.describe Profiles::AccountsController do end end - [:twitter, :facebook, :google_oauth2, :gitlab, :github, :bitbucket, :crowd, :auth0, :authentiq].each do |provider| + [:twitter, :facebook, :google_oauth2, :gitlab, :github, :bitbucket, :crowd, :auth0, :authentiq, :dingtalk].each do |provider| describe "#{provider} provider" do let(:user) { create(:omniauth_user, provider: provider.to_s) } diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 0f1c6ae4c70..68cccfa8bde 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -1410,12 +1410,12 @@ RSpec.describe Projects::IssuesController do context 'when the endpoint receives requests above the limit', :freeze_time, :clean_gitlab_redis_rate_limiting do before do - stub_application_setting(issues_create_limit: 5) + stub_application_setting(issues_create_limit: 1) end context 'when issue creation limits imposed' do it 'prevents from creating more issues', :request_store do - 5.times { post_new_issue } + post_new_issue expect { post_new_issue } .to change { Gitlab::GitalyClient.get_request_count }.by(1) # creates 1 projects and 0 issues @@ -1442,7 +1442,7 @@ RSpec.describe Projects::IssuesController do project.add_developer(user) sign_in(user) - 6.times do + 2.times do post :create, params: { namespace_id: project.namespace.to_param, project_id: project, diff --git a/spec/features/groups/labels/subscription_spec.rb b/spec/features/groups/labels/subscription_spec.rb index dedded777ac..231c4b33bee 100644 --- a/spec/features/groups/labels/subscription_spec.rb +++ b/spec/features/groups/labels/subscription_spec.rb @@ -71,7 +71,7 @@ RSpec.describe 'Labels subscription' do end it 'does not show subscribed tab' do - page.within('.nav-tabs') do + page.within('.gl-tabs-nav') do expect(page).not_to have_link 'Subscribed' end end @@ -86,7 +86,7 @@ RSpec.describe 'Labels subscription' do end def click_subscribed_tab - page.within('.nav-tabs') do + page.within('.gl-tabs-nav') do click_link 'Subscribed' end end diff --git a/spec/features/oauth_login_spec.rb b/spec/features/oauth_login_spec.rb index 3402bda5a41..0ea14bc00a5 100644 --- a/spec/features/oauth_login_spec.rb +++ b/spec/features/oauth_login_spec.rb @@ -16,7 +16,7 @@ RSpec.describe 'OAuth Login', :js, :allow_forgery_protection do end providers = [:github, :twitter, :bitbucket, :gitlab, :google_oauth2, - :facebook, :cas3, :auth0, :authentiq, :salesforce] + :facebook, :cas3, :auth0, :authentiq, :salesforce, :dingtalk] around do |example| with_omniauth_full_host { example.run } diff --git a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb index a3f81bd19d8..c579027788d 100644 --- a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb @@ -309,7 +309,7 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do context 'when limit is higher than sent emails' do before do - stub_application_setting(issues_create_limit: 3) + stub_application_setting(issues_create_limit: 2) end it 'creates 2 issues' do diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index 7aa21d7bc0f..9daa3b32fd1 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -693,6 +693,7 @@ ProjectCiCdSetting: ProjectSetting: - allow_merge_on_skipped_pipeline - has_confluence +- has_shimo - has_vulnerabilities ProtectedEnvironment: - id diff --git a/spec/requests/api/project_attributes.yml b/spec/requests/api/project_attributes.yml index dd00d413664..01d2fb18f00 100644 --- a/spec/requests/api/project_attributes.yml +++ b/spec/requests/api/project_attributes.yml @@ -137,6 +137,7 @@ project_setting: unexposed_attributes: - created_at - has_confluence + - has_shimo - has_vulnerabilities - prevent_merge_without_jira_issue - warn_about_potentially_unwanted_characters diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index 57fcdf84163..18e03db11dc 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -329,9 +329,9 @@ RSpec.describe Issues::CreateService do end end - context 'when limit is higher than counf of issues being created' do + context 'when limit is higher than count of issues being created' do before do - stub_application_setting(issues_create_limit: 3) + stub_application_setting(issues_create_limit: 2) end it 'creates 2 issues' do