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
250dbecd
Commit
250dbecd
authored
Jul 25, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pending delete projects should not show in deploy keys
parent
ea6dfcad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
app/serializers/deploy_key_entity.rb
app/serializers/deploy_key_entity.rb
+1
-1
changelogs/unreleased/35338-deploy-keys-should-not-show-pending-delete-projects.yml
...8-deploy-keys-should-not-show-pending-delete-projects.yml
+4
-0
spec/serializers/deploy_key_entity_spec.rb
spec/serializers/deploy_key_entity_spec.rb
+3
-1
No files found.
app/serializers/deploy_key_entity.rb
View file @
250dbecd
...
...
@@ -9,7 +9,7 @@ class DeployKeyEntity < Grape::Entity
expose
:created_at
expose
:updated_at
expose
:projects
,
using:
ProjectEntity
do
|
deploy_key
|
deploy_key
.
projects
.
select
{
|
project
|
options
[
:user
].
can?
(
:read_project
,
project
)
}
deploy_key
.
projects
.
without_deleted
.
select
{
|
project
|
options
[
:user
].
can?
(
:read_project
,
project
)
}
end
expose
:can_edit
...
...
changelogs/unreleased/35338-deploy-keys-should-not-show-pending-delete-projects.yml
0 → 100644
View file @
250dbecd
---
title
:
Pending delete projects should not show in deploy keys.
merge_request
:
13088
author
:
spec/serializers/deploy_key_entity_spec.rb
View file @
250dbecd
...
...
@@ -2,13 +2,15 @@ require 'spec_helper'
describe
DeployKeyEntity
do
include
RequestAwareEntity
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
:internal
)}
let
(
:project_private
)
{
create
(
:empty_project
,
:private
)}
let!
(
:project_pending_delete
)
{
create
(
:empty_project
,
:internal
,
pending_delete:
true
)
}
let
(
:deploy_key
)
{
create
(
:deploy_key
)
}
let!
(
:deploy_key_internal
)
{
create
(
:deploy_keys_project
,
project:
project
,
deploy_key:
deploy_key
)
}
let!
(
:deploy_key_private
)
{
create
(
:deploy_keys_project
,
project:
project_private
,
deploy_key:
deploy_key
)
}
let!
(
:deploy_key_pending_delete
)
{
create
(
:deploy_keys_project
,
project:
project_pending_delete
,
deploy_key:
deploy_key
)
}
let
(
:entity
)
{
described_class
.
new
(
deploy_key
,
user:
user
)
}
...
...
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