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
e6426836
Commit
e6426836
authored
Mar 05, 2020
by
Rajendra Kadam
Committed by
Stan Hu
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate package, build info and project alias into own classes
parent
8cc37ed4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
51 deletions
+93
-51
ee/changelogs/unreleased/refactoring-ee-entities-5.yml
ee/changelogs/unreleased/refactoring-ee-entities-5.yml
+5
-0
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+0
-51
ee/lib/ee/api/entities/managed_license.rb
ee/lib/ee/api/entities/managed_license.rb
+12
-0
ee/lib/ee/api/entities/package.rb
ee/lib/ee/api/entities/package.rb
+39
-0
ee/lib/ee/api/entities/package/build_info.rb
ee/lib/ee/api/entities/package/build_info.rb
+13
-0
ee/lib/ee/api/entities/package_file.rb
ee/lib/ee/api/entities/package_file.rb
+13
-0
ee/lib/ee/api/entities/project_alias.rb
ee/lib/ee/api/entities/project_alias.rb
+11
-0
No files found.
ee/changelogs/unreleased/refactoring-ee-entities-5.yml
0 → 100644
View file @
e6426836
---
title
:
Separate project alias, build info, package entities into own class files
merge_request
:
26493
author
:
Rajendra Kadam
type
:
added
ee/lib/ee/api/entities.rb
View file @
e6426836
...
...
@@ -779,57 +779,6 @@ module EE
expose
:dist_tags
,
merge:
true
end
class
Package
<
Grape
::
Entity
include
::
API
::
Helpers
::
RelatedResourcesHelpers
extend
EntityHelpers
class
BuildInfo
<
Grape
::
Entity
expose
:pipeline
,
using:
::
API
::
Entities
::
PipelineBasic
end
expose
:id
expose
:name
expose
:version
expose
:package_type
expose
:_links
do
expose
:web_path
do
|
package
|
::
Gitlab
::
Routing
.
url_helpers
.
project_package_path
(
package
.
project
,
package
)
end
expose
:delete_api_path
,
if:
can_destroy
(
:package
,
&
:project
)
do
|
package
|
expose_url
api_v4_projects_packages_path
(
package_id:
package
.
id
,
id:
package
.
project_id
)
end
end
expose
:created_at
expose
:project_id
,
if:
->
(
_
,
opts
)
{
opts
[
:group
]
}
expose
:project_path
,
if:
->
(
obj
,
opts
)
{
opts
[
:group
]
&&
Ability
.
allowed?
(
opts
[
:user
],
:read_project
,
obj
.
project
)
}
expose
:build_info
,
using:
BuildInfo
expose
:tags
private
def
project_path
object
.
project
.
full_path
end
end
class
PackageFile
<
Grape
::
Entity
expose
:id
,
:package_id
,
:created_at
expose
:file_name
,
:size
expose
:file_md5
,
:file_sha1
end
class
ManagedLicense
<
Grape
::
Entity
expose
:id
,
:name
expose
:approval_status
end
class
ProjectAlias
<
Grape
::
Entity
expose
:id
,
:project_id
,
:name
end
module
Analytics
module
CodeReview
class
MergeRequest
<
::
API
::
Entities
::
MergeRequestSimple
...
...
ee/lib/ee/api/entities/managed_license.rb
0 → 100644
View file @
e6426836
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
ManagedLicense
<
Grape
::
Entity
expose
:id
,
:name
expose
:approval_status
end
end
end
end
ee/lib/ee/api/entities/package.rb
0 → 100644
View file @
e6426836
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
Package
<
Grape
::
Entity
include
::
API
::
Helpers
::
RelatedResourcesHelpers
extend
EntityHelpers
expose
:id
expose
:name
expose
:version
expose
:package_type
expose
:_links
do
expose
:web_path
do
|
package
|
::
Gitlab
::
Routing
.
url_helpers
.
project_package_path
(
package
.
project
,
package
)
end
expose
:delete_api_path
,
if:
can_destroy
(
:package
,
&
:project
)
do
|
package
|
expose_url
api_v4_projects_packages_path
(
package_id:
package
.
id
,
id:
package
.
project_id
)
end
end
expose
:created_at
expose
:project_id
,
if:
->
(
_
,
opts
)
{
opts
[
:group
]
}
expose
:project_path
,
if:
->
(
obj
,
opts
)
{
opts
[
:group
]
&&
Ability
.
allowed?
(
opts
[
:user
],
:read_project
,
obj
.
project
)
}
expose
:build_info
,
using:
Package
::
BuildInfo
expose
:tags
private
def
project_path
object
.
project
.
full_path
end
end
end
end
end
ee/lib/ee/api/entities/package/build_info.rb
0 → 100644
View file @
e6426836
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
Package
<
Grape
::
Entity
class
BuildInfo
<
Grape
::
Entity
expose
:pipeline
,
using:
::
API
::
Entities
::
PipelineBasic
end
end
end
end
end
ee/lib/ee/api/entities/package_file.rb
0 → 100644
View file @
e6426836
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
PackageFile
<
Grape
::
Entity
expose
:id
,
:package_id
,
:created_at
expose
:file_name
,
:size
expose
:file_md5
,
:file_sha1
end
end
end
end
ee/lib/ee/api/entities/project_alias.rb
0 → 100644
View file @
e6426836
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
ProjectAlias
<
Grape
::
Entity
expose
:id
,
:project_id
,
:name
end
end
end
end
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