Skip to content

Commit

Permalink
Adding new UDAs to github and gerrit
Browse files Browse the repository at this point in the history
These show the draft/wip status for both services

Signed-off-by: Jorge Gallegos <[email protected]>
  • Loading branch information
thekad committed Feb 15, 2024
1 parent 8fbc9c0 commit a33839e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions bugwarrior/services/gerrit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class GerritIssue(Issue):
FOREIGN_ID = 'gerritid'
BRANCH = 'gerritbranch'
TOPIC = 'gerrittopic'
STATUS = 'gerritstatus'
WIP = 'gerritwip'

UDAS = {
SUMMARY: {
Expand All @@ -46,6 +48,14 @@ class GerritIssue(Issue):
'type': 'string',
'label': 'Gerrit Topic',
},
STATUS: {
'type': 'string',
'label': 'Gerrit Status',
},
WIP: {
'type': 'string',
'label': 'Gerrit Work in Progress',
},
}
UNIQUE_KEY = (URL, )

Expand All @@ -61,6 +71,8 @@ def to_taskwarrior(self):
self.SUMMARY: self.record['subject'],
self.BRANCH: self.record['branch'],
self.TOPIC: self.record.get('topic', 'notopic'),
self.STATUS: self.record.get('status', ''),
self.WIP: 'wip' if self.record.get('work_in_progress', False) else '',
}

def get_default_description(self):
Expand Down
10 changes: 8 additions & 2 deletions bugwarrior/services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class GithubIssue(Issue):
USER = 'githubuser'
NAMESPACE = 'githubnamespace'
STATE = 'githubstate'
DRAFT = 'githubdraft'

UDAS = {
TITLE: {
Expand Down Expand Up @@ -260,7 +261,11 @@ class GithubIssue(Issue):
STATE: {
'type': 'string',
'label': 'GitHub State',
}
},
DRAFT: {
'type': 'string',
'label': 'GitHub Draft',
},
}
UNIQUE_KEY = (URL, TYPE,)

Expand Down Expand Up @@ -293,7 +298,8 @@ def to_taskwarrior(self):
self.UPDATED_AT: updated,
self.CLOSED_AT: closed,
self.NAMESPACE: self.extra['namespace'],
self.STATE: self.record.get('state', '')
self.STATE: self.record.get('state', ''),
self.DRAFT: 'draft' if self.record.get('draft', False) else '',
}

def get_tags(self):
Expand Down

0 comments on commit a33839e

Please sign in to comment.