Updated: Comment #N
Problem/Motivation
a) No UI to configure requirement keys that should be ignored
b) The output doesn't contain the key, so you don't know what to exclude
Updated: Comment #N
a) No UI to configure requirement keys that should be ignored
b) The output doesn't contain the key, so you don't know what to exclude
Comments
Comment #1
miro_dietikerLet's start with this in D8 first.
It should be pretty easy to extend the output and allow the configuration of exclude keys.
Recently, we started to disable requirements sensors for modules due to some unwanted escalation.
Comment #2
Anushka-mp commentedText field added to configure the keys to be excluded. and the keys are displayed in the verbose message.
Comment #3
berdirCan you add the new buildConfigurationForm() method below runSensor() ? This makes it harder to review.
That thing is called semicolon, not colan :)
Is the is new check necessary because it is not yet an array then? Maybe do an (array) cast instead?
Missing docblock.
You can do this with $keys = array_map('trim', $keys), the current code also doesn't define $exclude_keys, so it could be undefined.
Also make sure that we are not saving an empty string here, "var_dump(explode(';', '')); returns an array with an empty string inside. So run array_filter() around it.
Comment #4
miro_dietikerI do prefer to switch to textarea and split by newline. This is common with Drupal pattern matching.
Plus... did i mention that test coverage is missing... ;-)
Comment #6
Anushka-mp commentedChanges made according to above suggestions, tests are pending.
Comment #8
miro_dietikerThis is not relevant for the regular message. Only add the key to the verbose output.
You dropped the functionality of exclude with this patch...
Check for getSetting('exclude_keys') instead.
Comment #9
Anushka-mp commentedVerbose message and the functionality added.
failing tests are corrected.
working on creating new tests for these changes.
Comment #10
berdirShould be 'exclude_keys' instead of query.
Also, try making this a list instead now that we can return HTML and render arrays. #type item_list, and then #items as array of string.
I think we still need the trim part here, between explode and array_filter.
Comment #11
miro_dietikerNote that the b) from the original issue summary is not started yet.
We need verbose output that shows the key. Otherwise a user never knows what key to exclude.
Comment #12
Anushka-mp commentedTable added for verbose output,
tests are also here with this patch.
Comment #17
Anushka-mp commentedCore test failure fixed.
Comment #18
miro_dietikerNice verbose improvement.
Reworked the patch a bit, adding more comments.
Improved tests to check more verbose output in core tests.
Switched style for test checks after setRawContent to use assertText. Makes it much more readable.
Will commit when green. :-)
Comment #20
miro_dietikerAwesome. Committed, pushed.