GothenburgBitFactory / bugwarrior

Pull github, bitbucket, and trac issues into taskwarrior
http://pypi.python.org/pypi/bugwarrior
GNU General Public License v3.0
739 stars 210 forks source link

using bugwarrior with taskwarrior3 #1065

Closed mrVanDalo closed 1 week ago

mrVanDalo commented 2 weeks ago

I was recently switching to taskwarrior 3 and couldn't make bugwarrior work with taskwarrior3. I guess this is because of the python lib taskw, but don't really know.

I wanted to ask if taskwarrior3 support is on the todo list?

In the meantime I created this script, to still use bugwarrior with taskwarrior3.

#!/usr/bin/env bash
set -eo pipefail

export TASK2=$HOME/bin/task2
export TASK3=$HOME/bin/task3

# create a dedicated bugwarrior-task home
mkdir -p $HOME/.bugwarrior
touch $HOME/.bugwarrior/taskrc
export TASKRC=$HOME/.bugwarrior/taskrc
export TASKDATA=$HOME/.bugwarrior

# run bugwarrior pull
echo "bugwarrior pull" | boxes -d ansi
bugwarrior pull "$@"
echo "task export" | boxes -d ansi
$TASK2 export > $HOME/.bugwarrior/bugwarrior.json

# import tasks to taskwarrior3 
unset TASKRC
unset TASKDATA
echo "task import" | boxes -d ansi
$TASK3 import rc.hooks=0 $HOME/.bugwarrior/bugwarrior.json
ryneeverett commented 2 weeks ago

We've done some minimal smoke-testing of bugwarrior with taskwarrior3 and haven't noticed any issues, but that doesn't mean there aren't any. Taskw's default behavior is to access taskwarrior via the command line and there haven't been any relevant breaking changes in the taskwarrior3 cli AFAIK, so in theory bugwarrior ought to work fine with taskwarrior3.

I believe taskw will use whatever task has priority in PATH, so I'm wondering if you have both taskwarrior2 and taskwarrior3 installed and somehow taskwarrior2 has precedence in the PATH of whatever environment is running bugwarrior?

mrVanDalo commented 1 week ago

Ahh, I see. Yes, well I'm using NixOS and dependencies are not that dynamic during run time. I use NixOS for exactly this behavior, but in this case I would have worked all out of the box.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/taskw/default.nix < shows that taskw by default is linked against taskwarrior2, which generates this problem for me.

Thanks for the clarification. I guess I have to fix it in NixOS my self and we can close this Issue.

ryneeverett commented 1 week ago

Thanks for the explanation. The solution might be more obvious to users were the input parametrized as taskwarrior ? taskwarrior2, but it would still not be that obvious to discover. I wish there was a way to make this less painful but I don't have any ideas.