From 4345d8b43a9da35cf31a30f36aa82c5816026b29 Mon Sep 17 00:00:00 2001 From: Michal Galet Date: Wed, 7 Sep 2016 22:29:23 +0200 Subject: [PATCH 1/6] Fix JIRA service - add api_url to mandatory attributes The api_url attribute is mandatory at least since GitLab 8.11. Otherwise server returns gitlab.exceptions.GitlabUpdateError: 400: 400 (Bad request) "api_url" not given. --- gitlab/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/objects.py b/gitlab/objects.py index 5a23dbf83..c4c6e5959 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1786,7 +1786,7 @@ class ProjectService(GitlabObject): 'server')), 'irker': (('recipients', ), ('default_irc_uri', 'server_port', 'server_host', 'colorize_messages')), - 'jira': (('new_issue_url', 'project_url', 'issues_url'), + 'jira': (('new_issue_url', 'project_url', 'issues_url', 'api_url'), ('description', 'username', 'password')), 'pivotaltracker': (('token', ), tuple()), 'pushover': (('api_key', 'user_key', 'priority'), ('device', 'sound')), From 850228df98be40c9d0f8861d0a9e827d9db7e1a1 Mon Sep 17 00:00:00 2001 From: Armin Weihbold Date: Sat, 10 Sep 2016 06:39:31 +0200 Subject: [PATCH 2/6] Add the ability to fork to a specific namespace --- gitlab/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/objects.py b/gitlab/objects.py index c4c6e5959..81eea911c 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1169,7 +1169,7 @@ class ProjectFork(GitlabObject): canList = False canGet = False requiredUrlAttrs = ['project_id'] - + optionalCreateAttrs = ['namespace'] class ProjectForkManager(BaseManager): obj_cls = ProjectFork From 5736cb1d2a9d974eba9d5acc3719a16ecfce188b Mon Sep 17 00:00:00 2001 From: Armin Weihbold Date: Sat, 10 Sep 2016 06:58:19 +0200 Subject: [PATCH 3/6] fix pep8 --- gitlab/objects.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gitlab/objects.py b/gitlab/objects.py index 81eea911c..c848ddec4 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1171,6 +1171,7 @@ class ProjectFork(GitlabObject): requiredUrlAttrs = ['project_id'] optionalCreateAttrs = ['namespace'] + class ProjectForkManager(BaseManager): obj_cls = ProjectFork From cf9d31dbd0d139f754921567387caff27105f234 Mon Sep 17 00:00:00 2001 From: Armin Weihbold Date: Sat, 10 Sep 2016 07:07:29 +0200 Subject: [PATCH 4/6] add doc --- docs/gl_objects/projects.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 269574720..1bc4fac14 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -51,6 +51,9 @@ fork = gl.project_forks.create({}, project_id=1) # or fork = project.forks.create({}) + +# fork to a specific namespace +fork gl.project_forks.create({'namespace': 'myteam'}, project_id=1) # end fork # forkrelation From 12a9a1f2f257ddbdbd9482b7afabed8ba499f0dd Mon Sep 17 00:00:00 2001 From: Armin Weihbold Date: Sat, 10 Sep 2016 15:06:44 +0200 Subject: [PATCH 5/6] fix doc --- docs/gl_objects/projects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 1bc4fac14..7c845d8cc 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -53,7 +53,7 @@ fork = project.forks.create({}) # fork to a specific namespace -fork gl.project_forks.create({'namespace': 'myteam'}, project_id=1) +fork = gl.project_forks.create({'namespace': 'myteam'}, project_id=1) # end fork # forkrelation From c37536ca97abac205cae19fd78ac048b9ca40eaf Mon Sep 17 00:00:00 2001 From: Michal Galet Date: Tue, 13 Sep 2016 09:23:17 +0200 Subject: [PATCH 6/6] Fix JIRA service - add api_url to mandatory attributes - move api_url to optional attributes based on comments in https://github.com/gpocentek/python-gitlab/pull/142#issuecomment-246288910 --- gitlab/objects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/objects.py b/gitlab/objects.py index c848ddec4..bafd0e5bb 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1787,8 +1787,8 @@ class ProjectService(GitlabObject): 'server')), 'irker': (('recipients', ), ('default_irc_uri', 'server_port', 'server_host', 'colorize_messages')), - 'jira': (('new_issue_url', 'project_url', 'issues_url', 'api_url'), - ('description', 'username', 'password')), + 'jira': (('new_issue_url', 'project_url', 'issues_url'), + ('api_url', 'description', 'username', 'password')), 'pivotaltracker': (('token', ), tuple()), 'pushover': (('api_key', 'user_key', 'priority'), ('device', 'sound')), 'redmine': (('new_issue_url', 'project_url', 'issues_url'),