Skip to content

Commit 02c5398

Browse files
author
Gauvain Pocentek
committed
Merge pull request #82 from cdbennett/commitstatus
Support setting commit status
2 parents 1d7ebea + 3371008 commit 02c5398

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

gitlab/objects.py

+17
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,22 @@ class ProjectCommitManager(BaseManager):
681681
obj_cls = ProjectCommit
682682

683683

684+
class ProjectCommitStatus(GitlabObject):
685+
_url = '/projects/%(project_id)s/statuses/%(commit_id)s'
686+
canUpdate = False
687+
canDelete = False
688+
requiredUrlAttrs = ['project_id', 'commit_id']
689+
requiredCreateAttrs = ['state']
690+
optionalCreateAttrs = ['description', 'name', 'ref', 'target_url']
691+
requiredGetAttrs = []
692+
requiredUpdateAttrs = []
693+
requiredDeleteAttrs = []
694+
695+
696+
class ProjectCommitStatusManager(BaseManager):
697+
obj_cls = ProjectCommitStatus
698+
699+
684700
class ProjectKey(GitlabObject):
685701
_url = '/projects/%(project_id)s/keys'
686702
canUpdate = False
@@ -961,6 +977,7 @@ class Project(GitlabObject):
961977
managers = [
962978
('branches', ProjectBranchManager, [('project_id', 'id')]),
963979
('commits', ProjectCommitManager, [('project_id', 'id')]),
980+
('commitstatuses', ProjectCommitStatusManager, [('project_id', 'id')]),
964981
('events', ProjectEventManager, [('project_id', 'id')]),
965982
('files', ProjectFileManager, [('project_id', 'id')]),
966983
('forks', ProjectForkManager, [('project_id', 'id')]),

0 commit comments

Comments
 (0)