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
e65daf20
Commit
e65daf20
authored
Feb 13, 2020
by
Rajendra Kadam
Committed by
Stan Hu
Feb 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate JobRequest entities into own class files
parent
6b95c3f9
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
174 additions
and
87 deletions
+174
-87
changelogs/unreleased/refactoring-entities-file-26.yml
changelogs/unreleased/refactoring-entities-file-26.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-87
lib/api/entities/job_request/artifacts.rb
lib/api/entities/job_request/artifacts.rb
+17
-0
lib/api/entities/job_request/cache.rb
lib/api/entities/job_request/cache.rb
+11
-0
lib/api/entities/job_request/credentials.rb
lib/api/entities/job_request/credentials.rb
+11
-0
lib/api/entities/job_request/dependency.rb
lib/api/entities/job_request/dependency.rb
+12
-0
lib/api/entities/job_request/git_info.rb
lib/api/entities/job_request/git_info.rb
+14
-0
lib/api/entities/job_request/image.rb
lib/api/entities/job_request/image.rb
+12
-0
lib/api/entities/job_request/job_info.rb
lib/api/entities/job_request/job_info.rb
+12
-0
lib/api/entities/job_request/port.rb
lib/api/entities/job_request/port.rb
+11
-0
lib/api/entities/job_request/response.rb
lib/api/entities/job_request/response.rb
+35
-0
lib/api/entities/job_request/runner_info.rb
lib/api/entities/job_request/runner_info.rb
+12
-0
lib/api/entities/job_request/service.rb
lib/api/entities/job_request/service.rb
+11
-0
lib/api/entities/job_request/step.rb
lib/api/entities/job_request/step.rb
+11
-0
No files found.
changelogs/unreleased/refactoring-entities-file-26.yml
0 → 100644
View file @
e65daf20
---
title
:
Separate JobRequest entities into own class files
merge_request
:
24977
author
:
Rajendra Kadam
type
:
added
lib/api/entities.rb
View file @
e65daf20
...
@@ -641,93 +641,6 @@ module API
...
@@ -641,93 +641,6 @@ module API
end
end
end
end
module
JobRequest
class
JobInfo
<
Grape
::
Entity
expose
:name
,
:stage
expose
:project_id
,
:project_name
end
class
GitInfo
<
Grape
::
Entity
expose
:repo_url
,
:ref
,
:sha
,
:before_sha
expose
:ref_type
expose
:refspecs
expose
:git_depth
,
as: :depth
end
class
RunnerInfo
<
Grape
::
Entity
expose
:metadata_timeout
,
as: :timeout
expose
:runner_session_url
end
class
Step
<
Grape
::
Entity
expose
:name
,
:script
,
:timeout
,
:when
,
:allow_failure
end
class
Port
<
Grape
::
Entity
expose
:number
,
:protocol
,
:name
end
class
Image
<
Grape
::
Entity
expose
:name
,
:entrypoint
expose
:ports
,
using:
JobRequest
::
Port
end
class
Service
<
Image
expose
:alias
,
:command
end
class
Artifacts
<
Grape
::
Entity
expose
:name
expose
:untracked
expose
:paths
expose
:when
expose
:expire_in
expose
:artifact_type
expose
:artifact_format
end
class
Cache
<
Grape
::
Entity
expose
:key
,
:untracked
,
:paths
,
:policy
end
class
Credentials
<
Grape
::
Entity
expose
:type
,
:url
,
:username
,
:password
end
class
Dependency
<
Grape
::
Entity
expose
:id
,
:name
,
:token
expose
:artifacts_file
,
using:
JobArtifactFile
,
if:
->
(
job
,
_
)
{
job
.
artifacts?
}
end
class
Response
<
Grape
::
Entity
expose
:id
expose
:token
expose
:allow_git_fetch
expose
:job_info
,
using:
JobInfo
do
|
model
|
model
end
expose
:git_info
,
using:
GitInfo
do
|
model
|
model
end
expose
:runner_info
,
using:
RunnerInfo
do
|
model
|
model
end
expose
:variables
expose
:steps
,
using:
Step
expose
:image
,
using:
Image
expose
:services
,
using:
Service
expose
:artifacts
,
using:
Artifacts
expose
:cache
,
using:
Cache
expose
:credentials
,
using:
Credentials
expose
:all_dependencies
,
as: :dependencies
,
using:
Dependency
expose
:features
end
end
class
UserAgentDetail
<
Grape
::
Entity
class
UserAgentDetail
<
Grape
::
Entity
expose
:user_agent
expose
:user_agent
expose
:ip_address
expose
:ip_address
...
...
lib/api/entities/job_request/artifacts.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Artifacts
<
Grape
::
Entity
expose
:name
expose
:untracked
expose
:paths
expose
:when
expose
:expire_in
expose
:artifact_type
expose
:artifact_format
end
end
end
end
lib/api/entities/job_request/cache.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Cache
<
Grape
::
Entity
expose
:key
,
:untracked
,
:paths
,
:policy
end
end
end
end
lib/api/entities/job_request/credentials.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Credentials
<
Grape
::
Entity
expose
:type
,
:url
,
:username
,
:password
end
end
end
end
lib/api/entities/job_request/dependency.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Dependency
<
Grape
::
Entity
expose
:id
,
:name
,
:token
expose
:artifacts_file
,
using:
Entities
::
JobArtifactFile
,
if:
->
(
job
,
_
)
{
job
.
artifacts?
}
end
end
end
end
lib/api/entities/job_request/git_info.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
GitInfo
<
Grape
::
Entity
expose
:repo_url
,
:ref
,
:sha
,
:before_sha
expose
:ref_type
expose
:refspecs
expose
:git_depth
,
as: :depth
end
end
end
end
lib/api/entities/job_request/image.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Image
<
Grape
::
Entity
expose
:name
,
:entrypoint
expose
:ports
,
using:
Entities
::
JobRequest
::
Port
end
end
end
end
lib/api/entities/job_request/job_info.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
JobInfo
<
Grape
::
Entity
expose
:name
,
:stage
expose
:project_id
,
:project_name
end
end
end
end
lib/api/entities/job_request/port.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Port
<
Grape
::
Entity
expose
:number
,
:protocol
,
:name
end
end
end
end
lib/api/entities/job_request/response.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Response
<
Grape
::
Entity
expose
:id
expose
:token
expose
:allow_git_fetch
expose
:job_info
,
using:
Entities
::
JobRequest
::
JobInfo
do
|
model
|
model
end
expose
:git_info
,
using:
Entities
::
JobRequest
::
GitInfo
do
|
model
|
model
end
expose
:runner_info
,
using:
Entities
::
JobRequest
::
RunnerInfo
do
|
model
|
model
end
expose
:variables
expose
:steps
,
using:
Entities
::
JobRequest
::
Step
expose
:image
,
using:
Entities
::
JobRequest
::
Image
expose
:services
,
using:
Entities
::
JobRequest
::
Service
expose
:artifacts
,
using:
Entities
::
JobRequest
::
Artifacts
expose
:cache
,
using:
Entities
::
JobRequest
::
Cache
expose
:credentials
,
using:
Entities
::
JobRequest
::
Credentials
expose
:all_dependencies
,
as: :dependencies
,
using:
Entities
::
JobRequest
::
Dependency
expose
:features
end
end
end
end
lib/api/entities/job_request/runner_info.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
RunnerInfo
<
Grape
::
Entity
expose
:metadata_timeout
,
as: :timeout
expose
:runner_session_url
end
end
end
end
lib/api/entities/job_request/service.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Service
<
Entities
::
JobRequest
::
Image
expose
:alias
,
:command
end
end
end
end
lib/api/entities/job_request/step.rb
0 → 100644
View file @
e65daf20
# frozen_string_literal: true
module
API
module
Entities
module
JobRequest
class
Step
<
Grape
::
Entity
expose
:name
,
:script
,
:timeout
,
:when
,
:allow_failure
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