Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-04 00:34:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-04 00:34:49 +0300
commitc7d361d3f6e123dea2f6c40bef94312294ee037e (patch)
tree67b88b8e974ccfef28ee991bf5803b998a03ccba
parent739f6fecbf4faeac17024be1def340bf9636c235 (diff)
Add latest changes from gitlab-org/security/gitlab@12-6-stable-ee
-rw-r--r--danger/changelog/Dangerfile2
-rw-r--r--danger/metadata/Dangerfile2
-rw-r--r--lib/gitlab/danger/helper.rb6
-rw-r--r--spec/lib/gitlab/danger/changelog_spec.rb1
-rw-r--r--spec/lib/gitlab/danger/helper_spec.rb22
-rwxr-xr-x[-rw-r--r--]vendor/gitignore/C++.gitignore0
-rwxr-xr-x[-rw-r--r--]vendor/gitignore/Java.gitignore0
7 files changed, 31 insertions, 2 deletions
diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile
index 62b41d14bee..8c010accd56 100644
--- a/danger/changelog/Dangerfile
+++ b/danger/changelog/Dangerfile
@@ -26,7 +26,7 @@ def check_changelog(path)
fail "`title` should be set, in #{gitlab.html_link(path)}! #{SEE_DOC}" if yaml["title"].nil?
fail "`type` should be set, in #{gitlab.html_link(path)}! #{SEE_DOC}" if yaml["type"].nil?
- if yaml["merge_request"].nil?
+ if yaml["merge_request"].nil? && !helper.security_mr?
message "Consider setting `merge_request` to #{gitlab.mr_json["iid"]} in #{gitlab.html_link(path)}. #{SEE_DOC}"
elsif yaml["merge_request"] != gitlab.mr_json["iid"] && !changelog.ce_port_changelog?(path)
fail "Merge request ID was not set to #{gitlab.mr_json["iid"]}! #{SEE_DOC}"
diff --git a/danger/metadata/Dangerfile b/danger/metadata/Dangerfile
index f2d68e64eb6..5edd134cbab 100644
--- a/danger/metadata/Dangerfile
+++ b/danger/metadata/Dangerfile
@@ -32,7 +32,7 @@ end
has_pick_into_stable_label = gitlab.mr_labels.find { |label| label.start_with?('Pick into') }
-if gitlab.branch_for_base != "master" && !has_pick_into_stable_label
+if gitlab.branch_for_base != "master" && !has_pick_into_stable_label && !helper.security_mr?
warn "Most of the time, merge requests should target `master`. Otherwise, please set the relevant `Pick into X.Y` label."
end
diff --git a/lib/gitlab/danger/helper.rb b/lib/gitlab/danger/helper.rb
index cd7d617509b..90cef384a1b 100644
--- a/lib/gitlab/danger/helper.rb
+++ b/lib/gitlab/danger/helper.rb
@@ -174,6 +174,12 @@ module Gitlab
labels - current_mr_labels
end
+ def security_mr?
+ return false unless gitlab_helper
+
+ gitlab_helper.mr_json['web_url'].include?('/gitlab-org/security/')
+ end
+
private
def has_database_scoped_labels?(current_mr_labels)
diff --git a/spec/lib/gitlab/danger/changelog_spec.rb b/spec/lib/gitlab/danger/changelog_spec.rb
index 888094eaf6e..689957993ec 100644
--- a/spec/lib/gitlab/danger/changelog_spec.rb
+++ b/spec/lib/gitlab/danger/changelog_spec.rb
@@ -34,6 +34,7 @@ describe Gitlab::Danger::Changelog do
{ docs: nil, none: nil }
].each do |categories|
let(:changes_by_category) { categories }
+
it "is falsy when categories don't require a changelog" do
is_expected.to be_falsy
end
diff --git a/spec/lib/gitlab/danger/helper_spec.rb b/spec/lib/gitlab/danger/helper_spec.rb
index d7e67444fca..edcd020a10f 100644
--- a/spec/lib/gitlab/danger/helper_spec.rb
+++ b/spec/lib/gitlab/danger/helper_spec.rb
@@ -312,4 +312,26 @@ describe Gitlab::Danger::Helper do
it { is_expected.to match_array(['database', 'database::review pending']) }
end
end
+
+ describe '#security_mr?' do
+ it 'returns false when `gitlab_helper` is unavailable' do
+ expect(helper).to receive(:gitlab_helper).and_return(nil)
+
+ expect(helper).not_to be_security_mr
+ end
+
+ it 'returns false when on a normal merge request' do
+ expect(fake_gitlab).to receive(:mr_json)
+ .and_return('web_url' => 'https://gitlab.com/gitlab-org/gitlab/merge_requests/1')
+
+ expect(helper).not_to be_security_mr
+ end
+
+ it 'returns true when on a security merge request' do
+ expect(fake_gitlab).to receive(:mr_json)
+ .and_return('web_url' => 'https://gitlab.com/gitlab-org/security/gitlab/merge_requests/1')
+
+ expect(helper).to be_security_mr
+ end
+ end
end
diff --git a/vendor/gitignore/C++.gitignore b/vendor/gitignore/C++.gitignore
index 259148fa18f..259148fa18f 100644..100755
--- a/vendor/gitignore/C++.gitignore
+++ b/vendor/gitignore/C++.gitignore
diff --git a/vendor/gitignore/Java.gitignore b/vendor/gitignore/Java.gitignore
index a1c2a238a96..a1c2a238a96 100644..100755
--- a/vendor/gitignore/Java.gitignore
+++ b/vendor/gitignore/Java.gitignore