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
9aba3a90
Commit
9aba3a90
authored
Jun 21, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Unleash API compatible interface
parent
00eb49d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
lib/api/api.rb
lib/api/api.rb
+1
-0
lib/api/entities.rb
lib/api/entities.rb
+34
-0
lib/api/unleash.rb
lib/api/unleash.rb
+25
-0
No files found.
lib/api/api.rb
View file @
9aba3a90
...
...
@@ -158,6 +158,7 @@ module API
mount
::
API
::
Templates
mount
::
API
::
Todos
mount
::
API
::
Triggers
mount
::
API
::
Unleash
mount
::
API
::
Users
mount
::
API
::
Variables
mount
::
API
::
Version
...
...
lib/api/entities.rb
View file @
9aba3a90
...
...
@@ -1515,6 +1515,40 @@ module API
end
expose
:label
,
using:
Entities
::
LabelBasic
expose
:action
class
UnleashIssue
<
Grape
::
Entity
expose
:name
expose
:title
,
as: :description
expose
:enabled
expose
:strategies
private
def
name
"
\#
#{
object
.
iid
}
"
end
def
enabled
true
end
def
strategies
[{
name:
'default'
}]
end
end
class
UnleashFeatureResponse
<
Grape
::
Entity
expose
:version
expose
:features
,
with:
UnleashIssue
private
def
version
1
end
def
features
end
end
end
end
...
...
lib/api/unleash.rb
0 → 100644
View file @
9aba3a90
module
API
class
Unleash
<
Grape
::
API
include
PaginationParams
#before { authenticate! }
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
resource
:projects
,
requirements:
API
::
PROJECT_ENDPOINT_REQUIREMENTS
do
get
':id/unleash/features'
do
issues
=
IssuesFinder
.
new
(
current_user
,
project_id:
user_project
.
id
,
label_name:
'rollout'
)
present
issues
,
with:
Entities
::
UnleashFeatureResponse
end
post
':id/unleash/client/register'
do
status
:ok
end
post
':id/unleash/client/metrics'
do
status
:ok
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