Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
aabf412b
Commit
aabf412b
authored
Sep 25, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
1cfd8874
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
119 additions
and
22 deletions
+119
-22
.rubocop.yml
.rubocop.yml
+6
-0
app/assets/stylesheets/framework/typography.scss
app/assets/stylesheets/framework/typography.scss
+0
-4
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+0
-1
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+6
-1
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+3
-5
app/services/issues/close_service.rb
app/services/issues/close_service.rb
+1
-1
changelogs/unreleased/31728-nullify-cluster-namespace-if-blank.yml
...s/unreleased/31728-nullify-cluster-namespace-if-blank.yml
+5
-0
changelogs/unreleased/32396-collapsible-markdown-formatted-weirdly.yml
...released/32396-collapsible-markdown-formatted-weirdly.yml
+5
-0
changelogs/unreleased/pages-per-project-size-limit-db.yml
changelogs/unreleased/pages-per-project-size-limit-db.yml
+5
-0
db/migrate/20190911115056_add_projects_max_pages_size.rb
db/migrate/20190911115056_add_projects_max_pages_size.rb
+9
-0
db/migrate/20190911115109_add_namespaces_max_pages_size.rb
db/migrate/20190911115109_add_namespaces_max_pages_size.rb
+9
-0
db/migrate/20190911115207_add_projects_max_artifacts_size.rb
db/migrate/20190911115207_add_projects_max_artifacts_size.rb
+9
-0
db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb
...grate/20190911115222_add_namespaces_max_artifacts_size.rb
+9
-0
db/schema.rb
db/schema.rb
+4
-0
lib/api/helpers/services_helpers.rb
lib/api/helpers/services_helpers.rb
+2
-0
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+2
-0
lib/gitlab/jira/http_client.rb
lib/gitlab/jira/http_client.rb
+2
-2
locale/gitlab.pot
locale/gitlab.pot
+6
-0
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-0
spec/models/clusters/platforms/kubernetes_spec.rb
spec/models/clusters/platforms/kubernetes_spec.rb
+12
-3
spec/support/shared_contexts/services_shared_context.rb
spec/support/shared_contexts/services_shared_context.rb
+23
-5
No files found.
.rubocop.yml
View file @
aabf412b
...
...
@@ -218,6 +218,12 @@ ActiveRecordAssociationReload:
-
'
spec/**/*'
-
'
ee/spec/**/*'
Naming/PredicateName
:
Enabled
:
true
Exclude
:
-
'
spec/**/*'
-
'
ee/spec/**/*'
RSpec/FactoriesInMigrationSpecs
:
Enabled
:
true
Include
:
...
...
app/assets/stylesheets/framework/typography.scss
View file @
aabf412b
...
...
@@ -73,10 +73,6 @@
summary
{
margin-bottom
:
$gl-padding
;
}
*
:first-child:not
(
summary
)
{
margin-top
:
$gl-padding
;
}
}
// Single code lines should wrap
...
...
app/helpers/nav_helper.rb
View file @
aabf412b
...
...
@@ -20,7 +20,6 @@ module NavHelper
def
page_gutter_class
if
page_has_markdown?
if
cookies
[
:collapsed_gutter
]
==
'true'
%w[page-gutter right-sidebar-collapsed]
else
...
...
app/models/clusters/platforms/kubernetes.rb
View file @
aabf412b
...
...
@@ -23,11 +23,12 @@ module Clusters
key:
Settings
.
attr_encrypted_db_key_base_truncated
,
algorithm:
'aes-256-cbc'
before_validation
:nullify_blank_namespace
before_validation
:enforce_namespace_to_lower_case
before_validation
:enforce_ca_whitespace_trimming
validates
:namespace
,
allow_
blank
:
true
,
allow_
nil
:
true
,
length:
1
..
63
,
format:
{
with:
Gitlab
::
Regex
.
kubernetes_namespace_regex
,
...
...
@@ -190,6 +191,10 @@ module Clusters
true
end
def
nullify_blank_namespace
self
.
namespace
=
nil
if
namespace
.
blank?
end
end
end
end
...
...
app/models/project_services/jira_service.rb
View file @
aabf412b
...
...
@@ -137,10 +137,9 @@ class JiraService < IssueTrackerService
return
if
issue
.
nil?
||
has_resolution?
(
issue
)
||
!
jira_issue_transition_id
.
present?
commit_id
=
if
entity
.
is_a?
(
Commit
)
entity
.
id
elsif
entity
.
is_a?
(
MergeRequest
)
entity
.
diff_head_sha
commit_id
=
case
entity
when
Commit
then
entity
.
id
when
MergeRequest
then
entity
.
diff_head_sha
end
commit_url
=
build_entity_url
(
:commit
,
commit_id
)
...
...
@@ -331,7 +330,6 @@ class JiraService < IssueTrackerService
# Handle errors when doing Jira API calls
def
jira_request
yield
rescue
Timeout
::
Error
,
Errno
::
EINVAL
,
Errno
::
ECONNRESET
,
Errno
::
ECONNREFUSED
,
URI
::
InvalidURIError
,
JIRA
::
HTTPError
,
OpenSSL
::
SSL
::
SSLError
=>
e
@error
=
e
.
message
log_error
(
"Error sending message"
,
client_url:
client_url
,
error:
@error
)
...
...
app/services/issues/close_service.rb
View file @
aabf412b
...
...
@@ -18,7 +18,7 @@ module Issues
# The code calling this method is responsible for ensuring that a user is
# allowed to close the given issue.
def
close_issue
(
issue
,
closed_via:
nil
,
notifications:
true
,
system_note:
true
)
if
project
.
jira_tracker
?
&&
project
.
jira_service
.
active
&&
issue
.
is_a?
(
ExternalIssue
)
if
project
.
jira_tracker
_active?
&&
issue
.
is_a?
(
ExternalIssue
)
project
.
jira_service
.
close_issue
(
closed_via
,
issue
)
todo_service
.
close_issue
(
issue
,
current_user
)
return
issue
...
...
changelogs/unreleased/31728-nullify-cluster-namespace-if-blank.yml
0 → 100644
View file @
aabf412b
---
title
:
Nullify platform Kubernetes namespace if blank
merge_request
:
17657
author
:
type
:
fixed
changelogs/unreleased/32396-collapsible-markdown-formatted-weirdly.yml
0 → 100644
View file @
aabf412b
---
title
:
Fix css selector for details in issue description
merge_request
:
17557
author
:
type
:
fixed
changelogs/unreleased/pages-per-project-size-limit-db.yml
0 → 100644
View file @
aabf412b
---
title
:
Add columns for per project/group max pages/artifacts sizes
merge_request
:
17231
author
:
type
:
added
db/migrate/20190911115056_add_projects_max_pages_size.rb
0 → 100644
View file @
aabf412b
# frozen_string_literal: true
class
AddProjectsMaxPagesSize
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
change
add_column
:projects
,
:max_pages_size
,
:integer
end
end
db/migrate/20190911115109_add_namespaces_max_pages_size.rb
0 → 100644
View file @
aabf412b
# frozen_string_literal: true
class
AddNamespacesMaxPagesSize
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
change
add_column
:namespaces
,
:max_pages_size
,
:integer
end
end
db/migrate/20190911115207_add_projects_max_artifacts_size.rb
0 → 100644
View file @
aabf412b
# frozen_string_literal: true
class
AddProjectsMaxArtifactsSize
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
change
add_column
:projects
,
:max_artifacts_size
,
:integer
end
end
db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb
0 → 100644
View file @
aabf412b
# frozen_string_literal: true
class
AddNamespacesMaxArtifactsSize
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
change
add_column
:namespaces
,
:max_artifacts_size
,
:integer
end
end
db/schema.rb
View file @
aabf412b
...
...
@@ -2317,6 +2317,8 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do
t
.
integer
"last_ci_minutes_usage_notification_level"
t
.
integer
"subgroup_creation_level"
,
default:
1
t
.
boolean
"emails_disabled"
t
.
integer
"max_pages_size"
t
.
integer
"max_artifacts_size"
t
.
index
[
"created_at"
],
name:
"index_namespaces_on_created_at"
t
.
index
[
"custom_project_templates_group_id"
,
"type"
],
name:
"index_namespaces_on_custom_project_templates_group_id_and_type"
,
where:
"(custom_project_templates_group_id IS NOT NULL)"
t
.
index
[
"file_template_project_id"
],
name:
"index_namespaces_on_file_template_project_id"
...
...
@@ -2909,6 +2911,8 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do
t
.
boolean
"merge_requests_disable_committers_approval"
t
.
boolean
"require_password_to_approve"
t
.
boolean
"emails_disabled"
t
.
integer
"max_pages_size"
t
.
integer
"max_artifacts_size"
t
.
index
[
"archived"
,
"pending_delete"
,
"merge_requests_require_code_owner_approval"
],
name:
"projects_requiring_code_owner_approval"
,
where:
"((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))"
t
.
index
[
"created_at"
],
name:
"index_projects_on_created_at"
t
.
index
[
"creator_id"
],
name:
"index_projects_on_creator_id"
...
...
lib/api/helpers/services_helpers.rb
View file @
aabf412b
...
...
@@ -155,6 +155,7 @@ module API
def
self
.
services
{
'alerts'
=>
[],
'asana'
=>
[
{
required:
true
,
...
...
@@ -696,6 +697,7 @@ module API
def
self
.
service_classes
[
::
AlertsService
,
::
AsanaService
,
::
AssemblaService
,
::
BambooService
,
...
...
lib/gitlab/import_export/import_export.yml
View file @
aabf412b
...
...
@@ -143,6 +143,8 @@ excluded_attributes:
-
:mirror_last_update_at
-
:mirror_last_successful_update_at
-
:emails_disabled
-
:max_pages_size
-
:max_artifacts_size
namespaces
:
-
:runners_token
-
:runners_token_encrypted
...
...
lib/gitlab/jira/http_client.rb
View file @
aabf412b
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Jira
# Gitlab JIRA HTTP client to be used with jira-ruby gem, this subclasses JIRA::HTTPClient.
# Uses Gitlab::HTTP to make requests to JIRA REST API.
# The parent class implementation can be found at: https://github.com/sumoheavy/jira-ruby/blob/v1.
4
.0/lib/jira/http_client.rb
# The parent class implementation can be found at: https://github.com/sumoheavy/jira-ruby/blob/v1.
7
.0/lib/jira/http_client.rb
class
HttpClient
<
JIRA
::
HttpClient
extend
::
Gitlab
::
Utils
::
Override
...
...
@@ -24,7 +24,7 @@ module Gitlab
password:
@options
.
delete
(
:password
)
}.
to_json
make_request
(
:post
,
@options
[
:context_path
]
+
'/rest/auth/1/session'
,
body
,
{
'Content-Type'
=>
'application/json'
}
)
make_request
(
:post
,
@options
[
:context_path
]
+
'/rest/auth/1/session'
,
body
,
'Content-Type'
=>
'application/json'
)
end
override
:make_request
...
...
locale/gitlab.pot
View file @
aabf412b
...
...
@@ -1234,6 +1234,9 @@ msgstr ""
msgid "Alerts"
msgstr ""
msgid "Alerts endpoint"
msgstr ""
msgid "All"
msgstr ""
...
...
@@ -12760,6 +12763,9 @@ msgstr ""
msgid "Receive alerts from manually configured Prometheus servers."
msgstr ""
msgid "Receive alerts on GitLab from any source"
msgstr ""
msgid "Receive notifications about your own activity"
msgstr ""
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
aabf412b
...
...
@@ -411,6 +411,7 @@ project:
-
project_aliases
-
external_pull_requests
-
pages_metadatum
-
alerts_service
award_emoji
:
-
awardable
-
user
...
...
spec/models/clusters/platforms/kubernetes_spec.rb
View file @
aabf412b
...
...
@@ -19,14 +19,23 @@ describe Clusters::Platforms::Kubernetes do
it_behaves_like
'having unique enum values'
describe
'before_validation'
do
let
(
:kubernetes
)
{
create
(
:cluster_platform_kubernetes
,
:configured
,
namespace:
namespace
)
}
context
'when namespace includes upper case'
do
let
(
:kubernetes
)
{
create
(
:cluster_platform_kubernetes
,
:configured
,
namespace:
namespace
)
}
let
(
:namespace
)
{
'ABC'
}
it
'converts to lower case'
do
expect
(
kubernetes
.
namespace
).
to
eq
(
'abc'
)
end
end
context
'when namespace is blank'
do
let
(
:namespace
)
{
''
}
it
'nullifies the namespace'
do
expect
(
kubernetes
.
namespace
).
to
be_nil
end
end
end
describe
'validation'
do
...
...
@@ -35,8 +44,8 @@ describe Clusters::Platforms::Kubernetes do
context
'when validates namespace'
do
let
(
:kubernetes
)
{
build
(
:cluster_platform_kubernetes
,
:configured
,
namespace:
namespace
)
}
context
'when namespace is
blank
'
do
let
(
:namespace
)
{
''
}
context
'when namespace is
nil
'
do
let
(
:namespace
)
{
nil
}
it
{
is_expected
.
to
be_truthy
}
end
...
...
spec/support/shared_contexts/services_shared_context.rb
View file @
aabf412b
...
...
@@ -28,12 +28,17 @@ Service.available_services_names.each do |service|
end
end
let
(
:licensed_features
)
do
{
'github'
=>
:github_project_service_integration
,
'jenkins'
=>
:jenkins_integration
,
'jenkins_deprecated'
=>
:jenkins_integration
,
'alerts'
=>
:incident_management
}
end
before
do
if
service
==
'github'
&&
respond_to?
(
:stub_licensed_features
)
stub_licensed_features
(
github_project_service_integration:
true
)
project
.
clear_memoization
(
:disabled_services
)
project
.
clear_memoization
(
:licensed_feature_available
)
end
enable_license_for_service
(
service
)
end
def
initialize_service
(
service
)
...
...
@@ -42,5 +47,18 @@ Service.available_services_names.each do |service|
service_item
.
save!
service_item
end
private
def
enable_license_for_service
(
service
)
return
unless
respond_to?
(
:stub_licensed_features
)
licensed_feature
=
licensed_features
[
service
]
return
unless
licensed_feature
stub_licensed_features
(
licensed_feature
=>
true
)
project
.
clear_memoization
(
:disabled_services
)
project
.
clear_memoization
(
:licensed_feature_available
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment