Skip to content

Conversation

@ryneeverett
Copy link
Contributor

@ryneeverett ryneeverett commented Jun 5, 2020

Based on #131.

I can't find where the rc:{config_filename} option is documented and it
doesn't seem to work on taskwarrior 2.5.1.

The environment variable TASKRC overrides an rc:%s argument, which means if there is a TASKRC environment variable, it will override the value passed to config_filename. This is only a problem in TaskWarriorShellout because subprocess inherits the environment.

Alternatively, we could set env={} in the subprocess call to isolate the environment, but this would be a more aggressive change and might not be desirable.

I encountered this as a problem running the tests in an environment with the TASKRC variable defined, which causes the global taskrc (and therefore taskwarrior database) to be used by the test suite instead of the test configuration and database, which added a bunch of fake test data to my personal database. If this were the only issue we could do better environment isolation in the test suite. However, ignoring config_filename isn't desirable for taskw library users either.

@ryneeverett ryneeverett force-pushed the taskrc-env-variable branch from cadde18 to 5931171 Compare June 5, 2020 05:36
@coddingtonbear
Copy link
Collaborator

Maybe not important, but I’m fairly sure rc: works in 2.5.1 b/c inthe.am relies on that feature.

ryneeverett added a commit to ryneeverett/taskw that referenced this pull request Jun 6, 2020
Similarly to ralphbean#134, passing description via description:{description}
doesn't appear to be documented and can lead to problems.

See GothenburgBitFactory/bugwarrior#733 and consider the following scenario:

$ task --version
2.5.1
$ task add description:"depends filter does not work with ID"
The expression could not be evaluated.
$ task add "depends filter does not work with ID"
Created task 1.

I've tried variations of the previous with various quoting and shells
and have gotten the same result.
ryneeverett added a commit to ryneeverett/taskw that referenced this pull request Jun 6, 2020
Similarly to ralphbean#134, passing description via description:{description}
doesn't appear to be documented and can lead to problems.

See GothenburgBitFactory/bugwarrior#733 and consider the following scenario:

```sh
$ task --version
2.5.1
$ task add description:"depends filter does not work with ID"
The expression could not be evaluated.
$ task add "depends filter does not work with ID"
Created task 1.
```

I've tried variations of the previous with various quoting and shells
and have gotten the same result.
@mrossinek
Copy link

I can confirm that task rc:<config file> works with 2.5.1.
It is documented in the man page: https://github.com/GothenburgBitFactory/taskwarrior/blob/2.6.0/doc/man/task.1.in#L1306

@ryneeverett
Copy link
Contributor Author

Thanks for the feedback. My reasoning was wrong but now that I understand it better I still think the patch is defensible. I've updated the PR description accordingly.

@coddingtonbear coddingtonbear merged commit 9c245ee into ralphbean:develop Dec 7, 2020
ryneeverett added a commit to ryneeverett/taskw that referenced this pull request Dec 7, 2020
Similarly to ralphbean#134, passing description via description:{description}
doesn't appear to be documented and can lead to problems.

See GothenburgBitFactory/bugwarrior#733 and consider the following scenario:

```sh
$ task --version
2.5.1
$ task add description:"depends filter does not work with ID"
The expression could not be evaluated.
$ task add "depends filter does not work with ID"
Created task 1.
```

I've tried variations of the previous with various quoting and shells
and have gotten the same result.
ryneeverett added a commit to ryneeverett/taskw that referenced this pull request Dec 8, 2020
Similarly to ralphbean#134, passing description via description:{description}
doesn't appear to be documented and can lead to problems.

See GothenburgBitFactory/bugwarrior#733 and consider the following scenario:

```sh
$ task --version
2.5.1
$ task add description:"depends filter does not work with ID"
The expression could not be evaluated.
$ task add "depends filter does not work with ID"
Created task 1.
```

I've tried variations of the previous with various quoting and shells
and have gotten the same result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants