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
Kazuhiko Shiozaki
gitlab-ce
Commits
a0fd2eb5
Commit
a0fd2eb5
authored
May 08, 2015
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't show duplicate deploy keys. Fixes #1516
parent
6c32abc5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
CHANGELOG
CHANGELOG
+1
-0
app/models/user.rb
app/models/user.rb
+1
-1
features/project/deploy_keys.feature
features/project/deploy_keys.feature
+4
-3
features/steps/project/deploy_keys.rb
features/steps/project/deploy_keys.rb
+12
-2
No files found.
CHANGELOG
View file @
a0fd2eb5
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased)
v 7.11.0 (unreleased)
- Don't show duplicate deploy keys
- Make the first branch pushed to an empty repository the default HEAD (Stan Hu)
- Make the first branch pushed to an empty repository the default HEAD (Stan Hu)
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
- Add application setting to restrict user signups to e-mail domains (Stan Hu)
- Add application setting to restrict user signups to e-mail domains (Stan Hu)
...
...
app/models/user.rb
View file @
a0fd2eb5
...
@@ -438,7 +438,7 @@ class User < ActiveRecord::Base
...
@@ -438,7 +438,7 @@ class User < ActiveRecord::Base
end
end
def
project_deploy_keys
def
project_deploy_keys
DeployKey
.
in_projects
(
self
.
authorized_projects
.
pluck
(
:id
)
)
DeployKey
.
unscoped
.
in_projects
(
self
.
authorized_projects
.
pluck
(
:id
)).
distinct
(
:id
)
end
end
def
accessible_deploy_keys
def
accessible_deploy_keys
...
...
features/project/deploy_keys.feature
View file @
a0fd2eb5
...
@@ -9,9 +9,10 @@ Feature: Project Deploy Keys
...
@@ -9,9 +9,10 @@ Feature: Project Deploy Keys
Then
I should see project deploy key
Then
I should see project deploy key
Scenario
:
I
should see project deploy keys
Scenario
:
I
should see project deploy keys
Given
other project
has deploy key
Given
other project
s have deploy keys
When
I visit project deploy keys page
When
I visit project deploy keys page
Then
I should see other project deploy key
Then
I should see other project deploy key
And
I should only see the same deploy key once
Scenario
:
I
should see public deploy keys
Scenario
:
I
should see public deploy keys
Given
public deploy key exists
Given
public deploy key exists
...
@@ -26,7 +27,7 @@ Feature: Project Deploy Keys
...
@@ -26,7 +27,7 @@ Feature: Project Deploy Keys
And
I should see newly created deploy key
And
I should see newly created deploy key
Scenario
:
I
attach other project deploy key to project
Scenario
:
I
attach other project deploy key to project
Given
other project
has deploy key
Given
other project
s have deploy keys
And
I visit project deploy keys page
And
I visit project deploy keys page
When
I click attach deploy key
When
I click attach deploy key
Then
I should be on deploy keys page
Then
I should be on deploy keys page
...
...
features/steps/project/deploy_keys.rb
View file @
a0fd2eb5
...
@@ -45,10 +45,20 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -45,10 +45,20 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
end
end
step
'other project
has deploy key
'
do
step
'other project
s have deploy keys
'
do
@second_project
=
create
:project
,
namespace:
create
(
:group
)
@second_project
=
create
(
:project
,
namespace:
create
(
:group
)
)
@second_project
.
team
<<
[
current_user
,
:master
]
@second_project
.
team
<<
[
current_user
,
:master
]
create
(
:deploy_keys_project
,
project:
@second_project
)
create
(
:deploy_keys_project
,
project:
@second_project
)
@third_project
=
create
(
:project
,
namespace:
create
(
:group
))
@third_project
.
team
<<
[
current_user
,
:master
]
create
(
:deploy_keys_project
,
project:
@third_project
,
deploy_key:
@second_project
.
deploy_keys
.
first
)
end
step
'I should only see the same deploy key once'
do
within
'.available-keys'
do
page
.
should
have_selector
(
'ul li'
,
count:
1
)
end
end
end
step
'public deploy key exists'
do
step
'public deploy key exists'
do
...
...
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