Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-01-07 00:07:50 +00:00
parent 015663b70f
commit d95abc0bc9
11 changed files with 54 additions and 19 deletions

View file

@ -142,7 +142,7 @@ gem 'gitlab-markup', '~> 1.7.0'
gem 'github-markup', '~> 1.7.0', require: 'github/markup' gem 'github-markup', '~> 1.7.0', require: 'github/markup'
gem 'commonmarker', '~> 0.20' gem 'commonmarker', '~> 0.20'
gem 'RedCloth', '~> 4.3.2' gem 'RedCloth', '~> 4.3.2'
gem 'rdoc', '~> 6.0' gem 'rdoc', '~> 6.1.2'
gem 'org-ruby', '~> 0.9.12' gem 'org-ruby', '~> 0.9.12'
gem 'creole', '~> 0.5.0' gem 'creole', '~> 0.5.0'
gem 'wikicloth', '0.8.1' gem 'wikicloth', '0.8.1'

View file

@ -823,7 +823,7 @@ GEM
ffi (>= 1.0.6) ffi (>= 1.0.6)
msgpack (>= 0.4.3) msgpack (>= 0.4.3)
optimist (>= 3.0.0) optimist (>= 3.0.0)
rdoc (6.0.4) rdoc (6.1.2)
re2 (1.1.1) re2 (1.1.1)
recaptcha (4.13.1) recaptcha (4.13.1)
json json
@ -1308,7 +1308,7 @@ DEPENDENCIES
raindrops (~> 0.18) raindrops (~> 0.18)
rblineprof (~> 0.3.6) rblineprof (~> 0.3.6)
rbtrace (~> 0.4) rbtrace (~> 0.4)
rdoc (~> 6.0) rdoc (~> 6.1.2)
re2 (~> 1.1.1) re2 (~> 1.1.1)
recaptcha (~> 4.11) recaptcha (~> 4.11)
redis (~> 4.0) redis (~> 4.0)

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class Projects::ErrorTracking::BaseController < Projects::ApplicationController
POLLING_INTERVAL = 1_000
def set_polling_interval
Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL)
end
end

View file

@ -2,10 +2,10 @@
module Projects module Projects
module ErrorTracking module ErrorTracking
class StackTracesController < Projects::ApplicationController class StackTracesController < Projects::ErrorTracking::BaseController
respond_to :json respond_to :json
before_action :authorize_read_sentry_issue! before_action :authorize_read_sentry_issue!, :set_polling_interval
def index def index
result = fetch_latest_event_issue result = fetch_latest_event_issue

View file

@ -1,11 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
class Projects::ErrorTrackingController < Projects::ApplicationController class Projects::ErrorTrackingController < Projects::ErrorTracking::BaseController
before_action :authorize_read_sentry_issue! before_action :authorize_read_sentry_issue!
before_action :set_issue_id, only: :details before_action :set_issue_id, only: :details
POLLING_INTERVAL = 10_000
def index def index
respond_to do |format| respond_to do |format|
format.html format.html
@ -20,6 +18,7 @@ class Projects::ErrorTrackingController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.json do format.json do
set_polling_interval
render_issue_detail_json render_issue_detail_json
end end
end end
@ -74,10 +73,6 @@ class Projects::ErrorTrackingController < Projects::ApplicationController
@issue_id = issue_details_params[:issue_id] @issue_id = issue_details_params[:issue_id]
end end
def set_polling_interval
Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL)
end
def serialize_errors(errors) def serialize_errors(errors)
ErrorTracking::ErrorSerializer ErrorTracking::ErrorSerializer
.new(project: project, user: current_user) .new(project: project, user: current_user)

View file

@ -7,9 +7,10 @@ module Members
raise Gitlab::Access::AccessDeniedError unless can?(current_user, action_member_permission(permission, member), member) raise Gitlab::Access::AccessDeniedError unless can?(current_user, action_member_permission(permission, member), member)
old_access_level = member.human_access old_access_level = member.human_access
old_expiry = member.expires_at
if member.update(params) if member.update(params)
after_execute(action: permission, old_access_level: old_access_level, member: member) after_execute(action: permission, old_access_level: old_access_level, old_expiry: old_expiry, member: member)
# Deletes only confidential issues todos for guests # Deletes only confidential issues todos for guests
enqueue_delete_todos(member) if downgrading_to_guest? enqueue_delete_todos(member) if downgrading_to_guest?

View file

@ -0,0 +1,5 @@
---
title: Update rdoc to 6.1.2
merge_request: 22434
author:
type: security

View file

@ -22106,6 +22106,9 @@ msgstr ""
msgid "needs to be between 10 minutes and 1 month" msgid "needs to be between 10 minutes and 1 month"
msgstr "" msgstr ""
msgid "never expires"
msgstr ""
msgid "new merge request" msgid "new merge request"
msgstr "" msgstr ""
@ -22388,5 +22391,11 @@ msgstr ""
msgid "with %{additions} additions, %{deletions} deletions." msgid "with %{additions} additions, %{deletions} deletions."
msgstr "" msgstr ""
msgid "with expiry changing from %{old_expiry} to %{new_expiry}"
msgstr ""
msgid "with expiry remaining unchanged at %{old_expiry}"
msgstr ""
msgid "yaml invalid" msgid "yaml invalid"
msgstr "" msgstr ""

View file

@ -34,6 +34,8 @@ describe Projects::ErrorTracking::StackTracesController do
it 'responds with no data' do it 'responds with no data' do
expect(response).to have_gitlab_http_status(:no_content) expect(response).to have_gitlab_http_status(:no_content)
end end
it_behaves_like 'sets the polling header'
end end
context 'service result is successful' do context 'service result is successful' do
@ -53,6 +55,8 @@ describe Projects::ErrorTracking::StackTracesController do
Gitlab::ErrorTracking::StackTraceHighlightDecorator.decorate(error_event).as_json Gitlab::ErrorTracking::StackTraceHighlightDecorator.decorate(error_event).as_json
) )
end end
it_behaves_like 'sets the polling header'
end end
context 'service result is erroneous' do context 'service result is erroneous' do

View file

@ -91,13 +91,13 @@ describe Projects::ErrorTrackingController do
.and_return(status: :success, issues: [error], pagination: {}) .and_return(status: :success, issues: [error], pagination: {})
expect(list_issues_service).to receive(:external_url) expect(list_issues_service).to receive(:external_url)
.and_return(external_url) .and_return(external_url)
get :index, params: params
end end
let(:error) { build(:error_tracking_error) } let(:error) { build(:error_tracking_error) }
it 'returns a list of errors' do it 'returns a list of errors' do
get :index, params: params
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('error_tracking/index') expect(response).to match_response_schema('error_tracking/index')
expect(json_response).to eq( expect(json_response).to eq(
@ -106,6 +106,8 @@ describe Projects::ErrorTrackingController do
'external_url' => external_url 'external_url' => external_url
) )
end end
it_behaves_like 'sets the polling header'
end end
end end
@ -201,30 +203,33 @@ describe Projects::ErrorTrackingController do
before do before do
expect(issue_details_service).to receive(:execute) expect(issue_details_service).to receive(:execute)
.and_return(status: :error, http_status: :no_content) .and_return(status: :error, http_status: :no_content)
get :details, params: issue_params(issue_id: issue_id, format: :json)
end end
it 'returns no data' do it 'returns no data' do
get :details, params: issue_params(issue_id: issue_id, format: :json)
expect(response).to have_gitlab_http_status(:no_content) expect(response).to have_gitlab_http_status(:no_content)
end end
it_behaves_like 'sets the polling header'
end end
context 'service result is successful' do context 'service result is successful' do
before do before do
expect(issue_details_service).to receive(:execute) expect(issue_details_service).to receive(:execute)
.and_return(status: :success, issue: error) .and_return(status: :success, issue: error)
get :details, params: issue_params(issue_id: issue_id, format: :json)
end end
let(:error) { build(:detailed_error_tracking_error) } let(:error) { build(:detailed_error_tracking_error) }
it 'returns an error' do it 'returns an error' do
get :details, params: issue_params(issue_id: issue_id, format: :json)
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('error_tracking/issue_detailed') expect(response).to match_response_schema('error_tracking/issue_detailed')
expect(json_response['error']).to eq(error.as_json) expect(json_response['error']).to eq(error.as_json)
end end
it_behaves_like 'sets the polling header'
end end
context 'service result is erroneous' do context 'service result is erroneous' do

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
shared_examples 'sets the polling header' do
subject { response.headers[Gitlab::PollingInterval::HEADER_NAME] }
it { is_expected.to eq '1000'}
end