GothenburgBitFactory / bugwarrior

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

github.only_if_assigned does not work for pull requests #822

Closed jkuball closed 3 years ago

jkuball commented 3 years ago

I have this configuration to pull all issues and pr's in an organization that are assigned to me.

[github_assigned]
service = github
github.only_if_assigned = jkuball
github.default_priority = H
github.username = some organization

It works fine for the most part, but it also fetches all open PRs, not only the ones I'm assigned to. Is there some extra configuration that I'm not aware of or is it a (known) bug?

I'm running bugwarrior 1.8.0 and task 2.5.1 (because of #805).

jkuball commented 3 years ago

It seems like I overlooked the configuration option github.filter_pull_requests = True, now it handles them correctly.

There still might be a bug here, because it also fetched pull requests before I've set filter_pull_requests

ryneeverett commented 3 years ago

Bugwarrior's notion of "filter" is the removal of tasks that would otherwise be added to the database, so the behavior you're describing sounds correct to me.

That said there are some known issues with the semantics of these options. See #315.

jkuball commented 3 years ago

Okay, that's interesting, but a little weird how then I get assigned PR's even if I have filter_pull_requests set to true. I might investigate it later, if I find the time. (It might be a configuration mistake on my side since I have two instances of github configurated with the same login but other parameters)

ryneeverett commented 3 years ago

Okay, that's interesting, but a little weird how then I get assigned PR's even if I have filter_pull_requests set to true. I might investigate it later, if I find the time. (It might be a configuration mistake on my side since I have two instances of github configurated with the same login but other parameters)

It makes sense to me. My understanding is that filter_pull_requests causes the common service configuration options to be applied to pull requests. Using filter_pull_requests in combination with only_if_assigned should therefore yield just assigned pull requests. Perhaps the documentation should be more explicit about this.

jkuball commented 3 years ago

Using filter_pull_requests in combination with only_if_assigned should therefore yield just assigned pull requests. Perhaps the documentation should be more explicit about this.

Yeah, exactly. Everything works right, I'm pretty happy and don't have any urgent problems! Thanks for that 😊

But: filter_pull_requests=False and only_if_assigned=True do also fetch all Pull Requests, which is just a little weird. I would assume in that case no PRs will be pulled.

ryneeverett commented 3 years ago

But: filter_pull_requests=False and only_if_assigned=True do also fetch all Pull Requests, which is just a little weird. I would assume in that case no PRs will be pulled.

Again, this is consistent with my understanding of the documented behavior. That's why I was emphasizing that filter_pull_requests applies filters such as only_if_assigned to pull requests. It can therefore only reduce the number of pull requests added to taskwarrior. If filter_pull_requests=False then all pull requests should be added regardless of only_if_assigned's value.

jkuball commented 3 years ago

Okay, now I finally understand your point. From a logic standpoint everything seems to work correctly, it's just a little confusing. Thanks again!