-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete tasks with end value, add state and closed UDAs to GitHub #621
Complete tasks with end value, add state and closed UDAs to GitHub #621
Conversation
Python 2 jobs fixed by #618 |
I'm wondering if that error in travis is spurious or not:
It only effects Python 2.7 ... |
Yeah I don't know why it appears only now and not in previous builds. PR #618 fixes it though. |
#618 is merged, please rebase on latest develop, then the checks should all pass. |
- Closed date is updated to happen AFTER creation date. - Since we have a closing date, the state is updated to 'closed'
LGTM 👍 I suppose you tested this locally: does this also create completed tasks from closed issues or is it just closing issues that were created by bugwarrior before? I would really like this for my burndown charts :) |
This is exactly why I opened this PR 😀 ! Yes, it will create completed tasks from closed issues, but (and I'm not targeting you particularly but writing for everyone instead) you have to understand two things:
With the example in the second point above, a few questions come to mind:
So, my conclusion is that bugwarrior should offer a way to include closed issues. A simple flag like I'm gonna add this to my PR in the docs somewhere, maybe also in a contributing section 🙂 Other remark:
|
Thanks, we could start by implementing this for GitHub indeed 🙂 In another PR though. |
Added docs for the two new UDAs. Ready to merge @wookietreiber @ralphbean ! |
|
||
return { | ||
'project': self.extra['project'], | ||
'priority': priority, | ||
'annotations': self.extra.get('annotations', []), | ||
'tags': self.get_tags(), | ||
'entry': created, | ||
'end': closed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we're calling this end
and not closed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! For the same reason created
is named entry
I guess: because this dictionary is ultimately passed to taskw
, the Python API module for taskwarrior, and taskwarrior's end date field is named end
.
The code path to show it:
command.pull
- create
issue_generator
with:service.aggregate_issues
service._aggregate_issues
SERVICE.issues
- return issues from records (
get_issue_for_record
) - records are obtained via
get_taskwarrior_record
get_taskwarrior_record
callsto_taskwarrior
(our interest here)
- return issues from records (
db.synchronize(issue_generator, ...)
for issue in issue_generator:
issue_dict = dict(issue)
task.add(**issue_dict)
: Documentation contains "Takes any of the keywords allowed by taskwarrior like proj or prior."
- create
Issue #620
When pulling closed issues (with custom query), bugwarrior will use the
closed_at
field from GitHub to set theend
value of the task and mark it as "done".Two new UDAs in this PR:
githubclosedon
(to be consistent withgithubcreatedon
): dategithubstate
: string, which is the state of the issue/PR (open
,closed
ormerged
)To implement this for other services, one will need:
to_taskwarrior
method of the service to add theend
item in the returned dictionaryWith the
end
attribute set and true (a valid date), bugwarrior will automatically complete the task after adding/modifying it. I don't know how taskwarrior itself reacts when asked to add a new task with anend
value already set, but I tried this code and had no issue with it. Tasks were successfully created or modified and immediately after, completed.TODO: