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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b8b973fb
Commit
b8b973fb
authored
Jun 02, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch MR change using API
This enables rspec foss-impact job to run in community and security forks
parent
8c71cbde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
.gitlab/ci/rails.gitlab-ci.yml
.gitlab/ci/rails.gitlab-ci.yml
+2
-3
.gitlab/ci/rules.gitlab-ci.yml
.gitlab/ci/rules.gitlab-ci.yml
+4
-4
tooling/bin/find_foss_tests
tooling/bin/find_foss_tests
+12
-10
No files found.
.gitlab/ci/rails.gitlab-ci.yml
View file @
b8b973fb
...
...
@@ -331,11 +331,10 @@ rspec foss-impact:
extends
:
-
.rspec-base
-
.as-if-foss
-
.rails:rules:ee-
canonical-
mr-only
-
.rails:rules:ee-mr-only
-
.use-pg11
script
:
-
git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
-
git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
-
install_gitlab_gem
-
run_timed_command "scripts/gitaly-test-build"
-
run_timed_command "scripts/gitaly-test-spawn"
-
source scripts/rspec_helpers.sh
...
...
.gitlab/ci/rules.gitlab-ci.yml
View file @
b8b973fb
...
...
@@ -446,13 +446,13 @@
-
<<
:
*if-master-refs
changes
:
*code-backstage-patterns
.rails:rules:ee-
canonical-
mr-only:
.rails:rules:ee-mr-only:
rules
:
-
<<
:
*if-not-ee
when
:
never
-
<<
:
*if-
not-canonical-namespace
when
:
never
-
<<
:
*if-merge-request
-
<<
:
*if-
security-merge-request
changes
:
*code-backstage-patterns
-
<<
:
*if-
dot-com-gitlab-org-
merge-request
changes
:
*code-backstage-patterns
.rails:rules:downtime_check:
...
...
tooling/bin/find_foss_tests
View file @
b8b973fb
...
...
@@ -4,20 +4,22 @@
require_relative
'../../lib/gitlab/popen'
require_relative
'../lib/tooling/test_file_finder'
output_file
=
ARGV
.
shift
source
=
ENV
.
fetch
(
'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'
)
target
=
ENV
.
fetch
(
'CI_MERGE_REQUEST_TARGET_BRANCH_NAME'
)
require
'gitlab'
git
_diff
=
Gitlab
::
Popen
.
popen_with_detail
(
%w[git diff --name-only]
+
[
"origin/
#{
target
}
...origin/
#{
source
}
"
]
)
git
lab_token
=
ENV
.
fetch
(
'DANGER_GITLAB_API_TOKEN'
,
''
)
unless
git_diff
.
status
.
success?
warn
"****
#{
git_diff
.
cmd
.
join
(
' '
)
}
had the following error(s):"
warn
git_diff
.
stderr
exit
git_diff
.
status
.
exitstatus
Gitlab
.
configure
do
|
config
|
config
.
endpoint
=
'https://gitlab.com/api/v4'
config
.
private_token
=
gitlab_token
end
changed_files
=
git_diff
.
stdout
.
split
(
"
\n
"
)
output_file
=
ARGV
.
shift
mr_project_path
=
ENV
.
fetch
(
'CI_MERGE_REQUEST_PROJECT_PATH'
)
mr_iid
=
ENV
.
fetch
(
'CI_MERGE_REQUEST_IID'
)
mr_changes
=
Gitlab
.
merge_request_changes
(
mr_project_path
,
mr_iid
)
changed_files
=
mr_changes
.
changes
.
map
{
|
change
|
change
[
'new_path'
]
}
tests_to_run
=
changed_files
.
flat_map
do
|
file
|
test_files
=
Tooling
::
TestFileFinder
.
new
(
file
,
foss_test_only:
true
).
test_files
...
...
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