Closed DannyvdSluijs closed 8 months ago
thanks for the PR.
regarding youtrack in general: does youtrack use the same issue-key-format as in jira? meaning a project identifier followed by a number (will the jira regex work for youtrack as is?)
I guess I could add an
enabled
flag on each of the ticket fetchers config and add entries to theconditionalTags
section of theextension.neon
file.
I think we should instead utilize the enabled
flag and turn it into a string parameter.
enabled=false
means the rule is disabledenabled=true
means the rule uses the jira fetcher (for BC, but deprecated)enabled='jira'
means the rule uses the jira fetcherenabled='youtrack'
means the rule uses the youtrack fetcherThere is still some unresolved issue at this point in time for which some input could help regarding the approach. With this PR there are now two implementations of the
staabm\PHPStanTodoBy\utils\TicketStatusFetcher
causing the Nette autowiring to throw an exception:
I think we could typehint the concrete implementations to make the dependencies unambigous
Hi, nice to see upcoming support for another issue tracker.
Recently I started working on introducing GitHub support (which has completely different ticket keys: #123
) and this requires some refactoring to be able to support multiple issue trackers. See the draft: #62. To be able to choose a fetcher dynamically, we can use factory which has DI container injected. This way we can read parameters to decide which service to use.
Adding your fetcher would be as easy as adding those lines to the factory:
if ('youtrack' === $tracker) {
$fetcher = $this->container->getByType(YouTrackTicketStatusFetcher::class);
return new TicketRuleConfiguration(
$fetcher::getKeyPattern(),
$resolvedStatuses,
$keyPrefixes,
$fetcher,
);
}
What do you think?
I like the direction of https://github.com/staabm/phpstan-todo-by/pull/62 - we should wait with this PR here until #62 is merged
I see now #62 is merged so I can rebase/redo this work with minimal effort. Great work by @EmilMassey this was the part I was missing.
I’ll try and see if I can update this PR in the upcoming week.
could we have a similar e2e test for youtrack, as we have added recently for jira?
@EmilMassey any input from your side?
thank you guys
This adds support for YouTrack in the the TodoByTicketRule.
There is still some unresolved issue at this point in time for which some input could help regarding the approach. With this PR there are now two implementations of the
staabm\PHPStanTodoBy\utils\TicketStatusFetcher
causing the Nette autowiring to throw an exception:@staabm I guess I could add an
enabled
flag on each of the ticket fetchers config and add entries to theconditionalTags
section of theextension.neon
file. But this could lead two multiple issue trackers being enabled, which isn't supported by the rule. Also theconditionalTags
seems undocumented which results in me maybe not seeing all the options here. Maybe this touches https://github.com/staabm/phpstan-todo-by/issues/48 as well.I'm willing to continue the PR in order to get it to the finish line but could use some of you input in order to go in the right direction.