cinatic/taskwhisperer

Setting taskwarrior to non-standard locations prevents plugin from working

Closed this issue · 4 comments

Hello,

When changing the following variables to conform with https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html the plugin no longer reads the tasks. Running taskwarrior for the terminal works as expected.

TASKRC=~/.taskrc TASKDATA=~/.task

Below is my current setup:

Environment

echo $TASKDATA
/home/andrew/.local/share/task

echo $TASKRC
/home/andrew/.config/task/taskrc

Taskrc

# [Created by task 2.5.1 5/7/2019 08:49:13]
# Taskwarrior program configuration file.
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color',
# 'man task-sync' or 'man taskrc'

# Here is an example of entries that use the default, override and blank values
#   variable=foo   -- By specifying a value, this overrides the default
#   variable=      -- By specifying no value, this means no default
#   #variable=foo  -- By commenting out the line, or deleting it, this uses the default

# Use the command 'task show' to see all defaults and overrides

# Files
data.location=~/.local/share/task
verbose=no

# Color theme (uncomment one to use)
include ~/.local/share/task/my_theme.theme



# Bugwarrior UDAs
uda.pivotal_description.type=string
uda.pivotal_description.label=Story Description
uda.pivotal_url.type=string
uda.pivotal_url.label=Story URL
uda.pivotal_story_type.type=string
uda.pivotal_story_type.label=Story Type
uda.pivotal_id.type=numeric
uda.pivotal_id.label=Story ID
uda.pivotal_request_users.type=string
uda.pivotal_request_users.label=Story Requesting User
uda.pivotal_current_state.type=string
uda.pivotal_current_state.label=Story State
uda.pivotal_estimate.type=numeric
uda.pivotal_estimate.label=Story Estimate
uda.pivotal_blockers.type=string
uda.pivotal_blockers.label=Story Blockers
# END Bugwarrior UDAs

Screenshot of plugin

image

Opening the dialog of the plugin results in empty pages.

Hello and thanks for the report

The following command is executed, please try it as the same user as you are running gnome and make sure it behaves as expected or paste output.

let command = ['task', 'rc.json.array=on', status, project, 'export'];

I guess the extension does not have the environment variables when the extension executes the task command.

I think this is not a problem of the extension rather taking care the environment variables are properly set at the right time / place (correct me if I am wrong)

BTW. Did you checked the gnome logs?

Hey @cinatic,

Running the command listed returns the following output.

task rc.json.array=on status:Pending project:test export

[
{"id":7,"description":"This is a test task for PR","entry":"20190617T171908Z","modified":"20190617T171908Z","project":"test","status":"pending","uuid":"35cf7418-8fc8-40c5-a897-dc0a8708f30b","urgency":1}
]

I am not sure where would be the right place to look in the logs for an issue. However, it does seem the plugin is not picking up on the environment changes because I am prompted an error that the configuration file is missing when creating a task.

ok then it is obviously: it has no environment or wrong environment vars. i just replaced the cmd to printenv and put also a log(buffer) and it shows me all the enviroment variables i also have set in my ~/.bashrc.

let command = ['printenv'];

So i would suggest you to double check where your enviroments variables are set. Or do you run gnome-shell and taskwarrior with different users?

if you want to debug further you can checkout or just replace the taskService.js (~/.local/share/gnome-shell/extensions/taskwhisperer-extension@infinicode.de/taskService.js): 31df6cc

and then check your logs

journalctl /usr/bin/gnome-shell -f

@cinatic After doing what you suggested I can confirm the envs are not loading. I have fixed the issue on my end by putting those paths into my zshenv. Thank you!