Skip to content

Commit 8a60310

Browse files
author
Manon Delahaye
committed
Remaniement
1 parent 931e95b commit 8a60310

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## v1.1.0
22

3-
* Super use of `python-gitlab` API
3+
* Use of `python-gitlab` library
4+
* New action `epic.create`
45

56
## v1.0.1
67

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ verify_ssl: False
1212
1313
## Actions
1414
15+
### Epics
16+
17+
* `epic.create` - Create new Epic
18+
1519
### Projects
1620

1721
* `project.info` - Returns project information
@@ -24,4 +28,3 @@ verify_ssl: False
2428

2529
* `pipeline.list` - List all pipelines in a project
2630
* `pipeline.trigger` - Create a new pipeline
27-

actions/create_epic.py renamed to actions/epic_create.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def __init__(self, config):
1212
self.url = self.config.get('url')
1313
self.token = self.config.get('token')
1414

15-
def run(self, group_id, title, labels, description, token):
15+
def run(self, group_id, title, labels, description, start_date, due_date, token):
1616

1717
# Use user token if given
1818
token = token or self.token
@@ -23,7 +23,10 @@ def run(self, group_id, title, labels, description, token):
2323
# Get the group with id == group_id
2424
group = gl.groups.get(group_id)
2525

26-
# On peut ajouter les params start date et due date,
27-
# mais j'ai l'impression qu'on les laisse toujours à vide ?
28-
epic = group.epics.create({'title': title, 'description': description, 'labels': labels})
26+
# If start/due date is given, tell gitlab it is fixed
27+
due_date_is_fixed = True if due_date else False
28+
start_date_is_fixed = True if start_date else False
29+
30+
# Create new epic
31+
epic = group.epics.create({'title': title, 'description': description, 'labels': labels, 'start_date_fixed': start_date, 'start_date_is_fixed': start_date_is_fixed, 'due_date_fixed': due_date, 'due_date_is_fixed': due_date_is_fixed})
2932
return (True, epic)

actions/create_epic.yaml renamed to actions/epic_create.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22

3-
name: create.epic
3+
name: epic.create
44
description: "Create new Epic"
55

66
runner_type: python-script
7-
entry_point: create_epic.py
7+
entry_point: epic_create.py
88

99
# Taken from https://docs.gitlab.com/ee/api/epics.html#new-epic
1010
parameters:
@@ -27,6 +27,14 @@ parameters:
2727
description: "The description of the epic. Limited to 1,048,576 characters."
2828
type: string
2929
position: 3
30+
start_date:
31+
description: "The fixed start date of an epic"
32+
type: string
33+
position: 4
34+
due_date:
35+
description: "The fixed due date of an epic"
36+
type: string
37+
position: 5
3038
token:
3139
description: "Gitlab token"
3240
type: string

0 commit comments

Comments
 (0)