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
Boxiang Sun
gitlab-ce
Commits
555fd0cf
Commit
555fd0cf
authored
Jun 23, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix downloading of patches on public merge requests when user logged out
Closes #1225 Closes #1854 Closes #1858
parent
88343897
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
3 deletions
+47
-3
CHANGELOG
CHANGELOG
+1
-0
features/project/merge_requests.feature
features/project/merge_requests.feature
+12
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+22
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+5
-0
lib/gitlab/backend/shell_env.rb
lib/gitlab/backend/shell_env.rb
+3
-1
lib/gitlab/satellite/action.rb
lib/gitlab/satellite/action.rb
+4
-2
No files found.
CHANGELOG
View file @
555fd0cf
Please view this file on the master branch, on stable branches it's out of date.
v 7.13.0 (unreleased)
- Fix downloading of patches on public merge requests when user logged out (Stan Hu)
- Update maintenance documentation to explain no need to recompile asssets for omnibus installations (Stan Hu)
- Support commenting on diffs in side-by-side mode (Stan Hu)
- Fix JavaScript error when clicking on the comment button on a diff line that has a comment already (Stan Hu)
...
...
features/project/merge_requests.feature
View file @
555fd0cf
...
...
@@ -41,6 +41,18 @@ Feature: Project Merge Requests
And
I submit new merge request
"Wiki Feature"
Then
I should see merge request
"Wiki Feature"
Scenario
:
I
download a diff on a public merge request
Given
public project
"Community"
And
"John Doe"
owns public project
"Community"
And
project
"Community"
has
"Bug CO-01"
open merge request with diffs inside
Given
I logout directly
And
I visit merge request page
"Bug CO-01"
And
I click on
"Email Patches"
Then
I should see a patch diff
And
I visit merge request page
"Bug CO-01"
And
I click on
"Plain Diff"
Then
I should see a patch diff
@javascript
Scenario
:
I
comment on a merge request
Given
I visit merge request page
"Bug NS-04"
...
...
features/steps/project/merge_requests.rb
View file @
555fd0cf
...
...
@@ -6,6 +6,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
include
SharedPaths
include
SharedMarkdown
include
SharedDiffNote
include
SharedUser
step
'I click link "New Merge Request"'
do
click_link
"New Merge Request"
...
...
@@ -108,6 +109,15 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
author:
project
.
users
.
first
)
end
step
'project "Community" has "Bug CO-01" open merge request with diffs inside'
do
project
=
Project
.
find_by
(
name:
"Community"
)
create
(
:merge_request_with_diffs
,
title:
"Bug CO-01"
,
source_project:
project
,
target_project:
project
,
author:
project
.
users
.
first
)
end
step
'I switch to the diff tab'
do
visit
diffs_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
...
...
@@ -326,6 +336,18 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect
(
page
).
to
have_content
'Target branch changed from master to feature'
end
step
'I click on "Email Patches"'
do
click_link
"Email Patches"
end
step
'I click on "Plain Diff"'
do
click_link
"Plain Diff"
end
step
'I should see a patch diff'
do
expect
(
page
).
to
have_content
(
'diff --git'
)
end
def
merge_request
@merge_request
||=
MergeRequest
.
find_by!
(
title:
"Bug NS-05"
)
end
...
...
features/steps/shared/paths.rb
View file @
555fd0cf
...
...
@@ -357,6 +357,11 @@ module SharedPaths
visit
namespace_project_merge_request_path
(
mr
.
target_project
.
namespace
,
mr
.
target_project
,
mr
)
end
step
'I visit merge request page "Bug CO-01"'
do
mr
=
MergeRequest
.
find_by
(
title:
"Bug CO-01"
)
visit
namespace_project_merge_request_path
(
mr
.
target_project
.
namespace
,
mr
.
target_project
,
mr
)
end
step
'I visit project "Shop" merge requests page'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
end
...
...
lib/gitlab/backend/shell_env.rb
View file @
555fd0cf
...
...
@@ -6,8 +6,10 @@ module Gitlab
def
set_env
(
user
)
# Set GL_ID env variable
if
user
ENV
[
'GL_ID'
]
=
"user-
#{
user
.
id
}
"
end
end
def
reset_env
# Reset GL_ID env variable
...
...
lib/gitlab/satellite/action.rb
View file @
555fd0cf
...
...
@@ -39,9 +39,11 @@ module Gitlab
def
prepare_satellite!
(
repo
)
project
.
satellite
.
clear_and_update!
if
user
repo
.
config
[
'user.name'
]
=
user
.
name
repo
.
config
[
'user.email'
]
=
user
.
email
end
end
def
default_options
(
options
=
{})
{
raise:
true
,
timeout:
true
}.
merge
(
options
)
...
...
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