Commit abfafe3c authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent ef326e80
......@@ -62,6 +62,14 @@ class Projects::PagesDomainsController < Projects::ApplicationController
end
end
def clean_certificate
unless @domain.update(user_provided_certificate: nil, user_provided_key: nil)
flash[:alert] = @domain.errors.full_messages.join(', ')
end
redirect_to edit_project_pages_domain_path(@project, @domain)
end
private
def create_params
......
......@@ -9,5 +9,9 @@ module Clusters
def feature_available?(feature)
::Feature.enabled?(feature, default_enabled: true)
end
def flipper_id
self.class.to_s
end
end
end
......@@ -355,7 +355,7 @@ class IssuableBaseService < BaseService
associations =
{
labels: issuable.labels.to_a,
mentioned_users: issuable.mentioned_users.to_a,
mentioned_users: issuable.mentioned_users(current_user).to_a,
assignees: issuable.assignees.to_a
}
associations[:total_time_spent] = issuable.total_time_spent if issuable.respond_to?(:total_time_spent)
......
......@@ -64,12 +64,13 @@
%p.form-text.text-muted
= s_('ClusterIntegration|Learn more about %{help_link_start_machine_type}machine types%{help_link_end} and %{help_link_start_pricing}pricing%{help_link_end}.').html_safe % { help_link_start_machine_type: help_link_start % { url: machine_type_link_url }, help_link_start_pricing: help_link_start % { url: pricing_link_url }, help_link_end: help_link_end }
.form-group
= provider_gcp_field.check_box :cloud_run, { label: s_('ClusterIntegration|Enable Cloud Run on GKE (beta)'),
label_class: 'label-bold' }
.form-text.text-muted
= s_('ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/index.md', anchor: 'cloud-run-on-gke'), target: '_blank'
- if Feature.enabled?(:create_cloud_run_clusters, clusterable)
.form-group
= provider_gcp_field.check_box :cloud_run, { label: s_('ClusterIntegration|Enable Cloud Run on GKE (beta)'),
label_class: 'label-bold' }
.form-text.text-muted
= s_('ClusterIntegration|Uses the Cloud Run, Istio, and HTTP Load Balancing addons for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/index.md', anchor: 'cloud-run-on-gke'), target: '_blank'
.form-group
= field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'),
......
---
title: Do not generate To-Dos additional when editing group mentions
merge_request: 19037
author:
type: fixed
---
title: Disable protected path throttling by default
merge_request: 19185
author:
type: fixed
......@@ -12,18 +12,19 @@
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable %w(
award_emoji
project_statistics
system_note_metadata
container_repository_registry
design_registry
event_log
project_auto_devops
project_registry
file_registry
group_view
job_artifact_registry
container_repository_registry
design_registry
vulnerability_feedback
lfs_object_registry
project_auto_devops
project_registry
project_statistics
system_note_metadata
vulnerabilities_feedback
group_view
vulnerability_feedback
)
inflect.acronym 'EE'
end
......@@ -222,6 +222,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources :domains, except: :index, controller: 'pages_domains', constraints: { id: %r{[^/]+} } do
member do
post :verify
delete :clean_certificate
end
end
end
......
# frozen_string_literal: true
class ChangeDefaultValueOfThrottleProtectedPaths < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
change_column_default :application_settings, :throttle_protected_paths_enabled, false
# Because we already set the value to true in the previous
# migration, this feature was switched on inadvertently in GitLab
# 12.4. This migration toggles it back off to ensure we don't
# inadvertently block legitimate users. The admin will have to
# re-enable it in the application settings.
unless omnibus_protected_paths_present?
execute "UPDATE application_settings SET throttle_protected_paths_enabled = #{false_value}"
end
end
def down
change_column_default :application_settings, :throttle_protected_paths_enabled, true
execute "UPDATE application_settings SET throttle_protected_paths_enabled = #{true_value}"
end
private
def omnibus_protected_paths_present?
Rack::Attack.throttles.key?('protected paths')
rescue e
say "Error while checking if Omnibus protected paths were already enabled: #{e.message}"
say 'Continuing. Protected paths will remain enabled.'
# Return true so we don't take a risk
true
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_10_17_180026) do
ActiveRecord::Schema.define(version: 2019_10_26_041447) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -331,7 +331,7 @@ ActiveRecord::Schema.define(version: 2019_10_17_180026) do
t.string "encrypted_asset_proxy_secret_key_iv"
t.string "static_objects_external_storage_url", limit: 255
t.string "static_objects_external_storage_auth_token", limit: 255
t.boolean "throttle_protected_paths_enabled", default: true, null: false
t.boolean "throttle_protected_paths_enabled", default: false, null: false
t.integer "throttle_protected_paths_requests_per_period", default: 10, null: false
t.integer "throttle_protected_paths_period_in_seconds", default: 60, null: false
t.string "protected_paths", limit: 255, default: ["/users/password", "/users/sign_in", "/api/v3/session.json", "/api/v3/session", "/api/v4/session.json", "/api/v4/session", "/users", "/users/confirmation", "/unsubscribes/", "/import/github/personal_access_token"], array: true
......
......@@ -417,9 +417,10 @@ GFM will recognize the following:
> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#task-lists).
You can add task lists anywhere markdown is supported, but you can only "click" to
toggle the boxes if they are in issues, merge requests, or comments. In other places
you must edit the markdown manually to change the status by adding or removing the `x`.
You can add task lists anywhere Markdown is supported, but you can only "click"
to toggle the boxes if they are in issues, merge requests, or comments. In other
places you must edit the Markdown manually to change the status by adding or
removing an `x` within the square brackets.
To create a task list, add a specially-formatted Markdown list. You can use either
unordered or ordered lists:
......
......@@ -17,6 +17,8 @@ The Advanced Syntax Search is a subset of the
[Advanced Global Search](advanced_global_search.md), which you can use if you
want to have more specific search results.
Advanced Global Search only supports searching the [default branch](../project/repository/branches/index.md#default-branch).
## Use cases
Let's say for example that the product you develop relies on the code of another
......
......@@ -190,6 +190,56 @@ describe Projects::PagesDomainsController do
end
end
describe 'DELETE #clean_certificate' do
subject do
delete(:clean_certificate, params: request_params.merge(id: pages_domain.domain))
end
it 'redirects to edit page' do
subject
expect(response).to redirect_to(edit_project_pages_domain_path(project, pages_domain))
end
it 'removes certificate' do
expect do
subject
end.to change { pages_domain.reload.certificate }.to(nil)
.and change { pages_domain.reload.key }.to(nil)
end
it 'sets certificate source to user_provided' do
pages_domain.update!(certificate_source: :gitlab_provided)
expect do
subject
end.to change { pages_domain.reload.certificate_source }.from("gitlab_provided").to("user_provided")
end
context 'when pages_https_only is set' do
before do
project.update!(pages_https_only: true)
stub_pages_setting(external_https: '127.0.0.1')
end
it 'does not remove certificate' do
subject
pages_domain.reload
expect(pages_domain.certificate).to be_present
expect(pages_domain.key).to be_present
end
it 'redirects to edit page with a flash message' do
subject
expect(flash[:alert]).to include('Certificate')
expect(flash[:alert]).to include('Key')
expect(response).to redirect_to(edit_project_pages_domain_path(project, pages_domain))
end
end
end
context 'pages disabled' do
before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(false)
......
# frozen_string_literal: true
require 'spec_helper'
describe API::AccessRequests do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Applications, :api do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Avatar do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::AwardEmoji do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Badges do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Boards do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Branches do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::BroadcastMessages do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::CommitStatuses do
......
# frozen_string_literal: true
require 'spec_helper'
require 'mime/types'
......
# frozen_string_literal: true
require 'spec_helper'
describe API::DeployKeys do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Discussions do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'doorkeeper access' do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Environments do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Events do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Features do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Files do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'GitlabSchema configurations' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Setting WIP status of a merge request' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'getting an issue list for a project' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'getting merge request information nested in a project' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'getting project information' do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::GroupBoards do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::GroupMilestones do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::GroupVariables do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Groups do
......
# frozen_string_literal: true
require 'spec_helper'
require 'raven/transports/dummy'
require_relative '../../../config/initializers/sentry'
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ImportGithub do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Internal::Base do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Jobs do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Keys do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Labels do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Lint do
......
# frozen_string_literal: true
require "spec_helper"
describe API::Markdown do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Members do
......@@ -24,7 +26,7 @@ describe API::Members do
shared_examples 'GET /:source_type/:id/members/(all)' do |source_type, all|
let(:members_url) do
"/#{source_type.pluralize}/#{source.id}/members".tap do |url|
(+"/#{source_type.pluralize}/#{source.id}/members").tap do |url|
url << "/all" if all
end
end
......
# frozen_string_literal: true
require "spec_helper"
describe API::MergeRequestDiffs, 'MergeRequestDiffs' do
......
# frozen_string_literal: true
require "spec_helper"
describe API::MergeRequests do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Namespaces do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Notes do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::NotificationSettings do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'OAuth tokens' do
......
# frozen_string_literal: true
require 'spec_helper'
describe "Internal Project Pages Access" do
......
# frozen_string_literal: true
require 'spec_helper'
describe "Private Project Pages Access" do
......
# frozen_string_literal: true
require 'spec_helper'
describe "Public Project Pages Access" do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::PagesDomains do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::PipelineSchedules do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectContainerRepositories do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectEvents do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectExport do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectHooks, 'ProjectHooks' do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectImport do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectMilestones do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectSnapshots do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectSnippets do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProjectTemplates do
......
# frozen_string_literal: true
require 'spec_helper'
shared_examples 'languages and percentages JSON response' do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProtectedBranches do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::ProtectedTags do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Releases do
......
# frozen_string_literal: true
require 'spec_helper'
require 'mime/types'
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Runner, :clean_gitlab_redis_shared_state do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Runners do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Search do
......
# frozen_string_literal: true
require "spec_helper"
describe API::Services do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Settings, 'Settings' do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::SidekiqMetrics do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Snippets do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::SystemHooks do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Tags do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Templates do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Todos do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Triggers do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Users do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Variables do
......
# frozen_string_literal: true
require 'spec_helper'
describe API::Version do
......
# frozen_string_literal: true
require 'spec_helper'
# For every API endpoint we test 3 states of wikis:
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Git HTTP requests' do
......
# frozen_string_literal: true
require 'spec_helper'
describe Groups::MilestonesController do
......
# frozen_string_literal: true
require 'spec_helper'
describe JwtController do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Git LFS File Locking API' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'OAuth Tokens requests' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'OpenID Connect requests' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'cycle analytics events' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Rack Attack global throttles' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Request Profiler' do
......
......@@ -58,9 +58,25 @@ RSpec.shared_examples 'updating mentions' do |service_class|
end
end
shared_examples 'updating attribute with existing group mention' do |attribute|
before do
mentionable.update!({ attribute => "FYI: #{group.to_reference}" })
end
it 'creates todos for only newly mentioned users' do
expect do
update_mentionable(
{ attribute => "For #{group.to_reference}, cc: #{mentioned_user.to_reference}" }
)
end.to change { Todo.count }.by(1)
end
end
context 'when group is public' do
it_behaves_like 'updating attribute with allowed mentions', :title
it_behaves_like 'updating attribute with allowed mentions', :description
it_behaves_like 'updating attribute with existing group mention', :title
it_behaves_like 'updating attribute with existing group mention', :description
end
context 'when the group is private' do
......@@ -70,6 +86,8 @@ RSpec.shared_examples 'updating mentions' do |service_class|
it_behaves_like 'updating attribute with allowed mentions', :title
it_behaves_like 'updating attribute with allowed mentions', :description
it_behaves_like 'updating attribute with existing group mention', :title
it_behaves_like 'updating attribute with existing group mention', :description
end
end
......
# frozen_string_literal: true
require 'spec_helper'
describe 'clusters/clusters/gcp/_form' do
let(:admin) { create(:admin) }
let(:environment) { create(:environment) }
let(:gcp_cluster) { create(:cluster, :provided_by_gcp) }
let(:clusterable) { ClusterablePresenter.fabricate(environment.project, current_user: admin) }
before do
assign(:environment, environment)
assign(:gcp_cluster, gcp_cluster)
allow(view).to receive(:clusterable).and_return(clusterable)
allow(view).to receive(:url_for).and_return('#')
allow(view).to receive(:token_in_session).and_return('')
end
context 'with all feature flags enabled' do
it 'has a cloud run checkbox' do
render
expect(rendered).to have_selector("input[id='cluster_provider_gcp_attributes_cloud_run']")
end
end
context 'with cloud run feature flag disabled' do
before do
stub_feature_flags(create_cloud_run_clusters: false)
end
it 'does not have a cloud run checkbox' do
render
expect(rendered).not_to have_selector("input[id='cluster_provider_gcp_attributes_cloud_run']")
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment