Skip to content

Commit

Permalink
Remaniement
Browse files Browse the repository at this point in the history
  • Loading branch information
Manon Delahaye committed Jan 26, 2024
1 parent 931e95b commit 8a60310
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v1.1.0

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

## v1.0.1

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ verify_ssl: False
## Actions
### Epics
* `epic.create` - Create new Epic

### Projects

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

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

11 changes: 7 additions & 4 deletions actions/create_epic.py → actions/epic_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, config):
self.url = self.config.get('url')
self.token = self.config.get('token')

def run(self, group_id, title, labels, description, token):
def run(self, group_id, title, labels, description, start_date, due_date, token):

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

# On peut ajouter les params start date et due date,
# mais j'ai l'impression qu'on les laisse toujours à vide ?
epic = group.epics.create({'title': title, 'description': description, 'labels': labels})
# If start/due date is given, tell gitlab it is fixed
due_date_is_fixed = True if due_date else False
start_date_is_fixed = True if start_date else False

# Create new epic
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})
return (True, epic)
12 changes: 10 additions & 2 deletions actions/create_epic.yaml → actions/epic_create.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---

name: create.epic
name: epic.create
description: "Create new Epic"

runner_type: python-script
entry_point: create_epic.py
entry_point: epic_create.py

# Taken from https://docs.gitlab.com/ee/api/epics.html#new-epic
parameters:
Expand All @@ -27,6 +27,14 @@ parameters:
description: "The description of the epic. Limited to 1,048,576 characters."
type: string
position: 3
start_date:
description: "The fixed start date of an epic"
type: string
position: 4
due_date:
description: "The fixed due date of an epic"
type: string
position: 5
token:
description: "Gitlab token"
type: string

0 comments on commit 8a60310

Please sign in to comment.