Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Managetests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Managetests
Commits
99bc9380
Commit
99bc9380
authored
May 17, 2016
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide the correct project ID to GitLab
parent
2a40fd4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
managetests/gitlab.py
managetests/gitlab.py
+11
-1
No files found.
managetests/gitlab.py
View file @
99bc9380
...
@@ -24,7 +24,8 @@ class GitLabAPI:
...
@@ -24,7 +24,8 @@ class GitLabAPI:
self
.
manager
=
manager
self
.
manager
=
manager
self
.
url
=
manager
.
config
[
"gitlab-url"
]
self
.
url
=
manager
.
config
[
"gitlab-url"
]
self
.
token
=
manager
.
config
[
"gitlab-token"
]
self
.
token
=
manager
.
config
[
"gitlab-token"
]
self
.
project
=
manager
.
config
[
"gitlab-project"
].
replace
(
"/"
,
"%2F"
)
self
.
project_name
=
manager
.
config
[
"gitlab-project"
]
self
.
project
=
self
.
project_id_of
(
self
.
project_name
)
def
call
(
self
,
method
,
endpoint
,
params
=
None
,
data
=
None
):
def
call
(
self
,
method
,
endpoint
,
params
=
None
,
data
=
None
):
"""Make a raw call to the GitLab API"""
"""Make a raw call to the GitLab API"""
...
@@ -41,6 +42,15 @@ class GitLabAPI:
...
@@ -41,6 +42,15 @@ class GitLabAPI:
return
response
.
json
()
return
response
.
json
()
return
False
return
False
def
project_id_of
(
self
,
name
):
"""Get the project ID of a specific project"""
projects
=
self
.
call
(
"get"
,
"projects"
)
for
project
in
projects
:
if
project
[
"path_with_namespace"
]
==
name
:
return
project
[
"id"
]
raise
NameError
(
"No project named %s"
%
name
)
def
merge_requests
(
self
):
def
merge_requests
(
self
):
"""Get all the merge requests of the project"""
"""Get all the merge requests of the project"""
return
self
.
call
(
"get"
,
"projects/%s/merge_requests"
%
self
.
project
,
{
return
self
.
call
(
"get"
,
"projects/%s/merge_requests"
%
self
.
project
,
{
...
...
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