Add target for validation only when no "availableInStores" specified#1358
Add target for validation only when no "availableInStores" specified#1358jdcasey merged 2 commits intoCommonjava:masterfrom
Conversation
pkocandr
left a comment
There was a problem hiding this comment.
This will allow us to change the behaviour, but I would rather make it not check the target by default unless you don't specify any other store to check. But overall it seems clearer to me to add the target in availableInStores param instead of introducing another param to control addition of the target. So I would drop that completely to make it simple.
Also with this the includeTarget param is unused and should be removed along with current overloaded method without the param.
jdcasey
left a comment
There was a problem hiding this comment.
I think I agree. Unless we explicitly say so, using any extra validation targets should turn off validation vs. the target repo.
|
Ok. Now the new commits will try to validate against target only when no "availableInStores" specified in rule-sets. |
There was a problem hiding this comment.
This is better, but I would still change the method signature to remove includeTarget param. And it is the same case for includeSource - I would remove the param and the addition of it. Not sure if this method is used in any other validation rule, but in no-preexisting-paths all files are in the source, so validating that they are not in the source make really no sense.
If we need to keep the current method signature I would mark it deprecated and delegate to getValidationStoreKeys(ValidationRequest) ignoring both include* params.
|
Ok. I've changed the signature. The new added one getValidationKeys(request) will ignore both source and target. But I still left the 3 params one and the 2 params one to make sure of backward compatible if any other scripts are using them. |
|
Seems good, although I would remove the "if (includeSource)" block and put the logic into getValidationStoreKeys(ValidationRequest) and call that from the deprecated ones. Also getValidationStoreKeys(ValidationRequest, boolean) is not deprecated, which I believe should be. But that's not a big issue now. So leaving it up to you :-) Thanks! |
No description provided.