Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket #1157: support specific filenames as trigger for Shell. #1167

Draft
wants to merge 1 commit into
base: v2.x
Choose a base branch
from

Conversation

evs-xsarus
Copy link

Q A
Branch feature/1157-triggered_by_filenames
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Documented? yes
Fixed tickets comma-separated list of tickets fixed by the PR, if any

Question, I would like to be able to specify a pathname in the filename. This fails now because the pattern is checked against the filename without a path. How to fix?

New Task Checklist:

  • Are the dependencies added to the composer.json suggestions?
  • Is the doc/tasks.md file updated?
  • Are the task parameters documented?
  • Is the task registered in the tasks.yml file?
  • Does the task contains phpunit tests?
  • Is the configuration having logical allowed types?
  • Does the task run in the correct context?
  • Is the run() method readable?
  • Is the run() method using the configuration correctly?
  • Are all CI services returning green?

@@ -59,7 +61,12 @@ public function canRunInContext(ContextInterface $context): bool
public function run(ContextInterface $context): TaskResultInterface
{
$config = $this->getConfig()->getOptions();
$files = $context->getFiles()->extensions($config['triggered_by']);
$files = new FilesCollection(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$files isn't really being used anywhere.
Instead of building the list of files, it might make more sense to count() the amount of files in either trigger.

That way we don't have to do all these lookups all of the time.

@@ -27,6 +27,7 @@ public function provideConfigurableOptions(): iterable
[
'scripts' => [],
'triggered_by' => ['php'],
'triggered_by_filenames' => [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll also need a test-case that covers how the task behaves on the newly added configuration.

@@ -50,10 +50,12 @@ protected static function sharedOptionsResolver(): OptionsResolver
$resolver = new OptionsResolver();
$resolver->setDefaults([
'triggered_by' => [],
'triggered_by_filenames' => [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why this one is altered? It's not being used anywhere?

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.

2 participants