Open reimic opened 5 months ago
A fix would be useful but I wouldn’t prioritize it. It’s rare to allow failures. Anyway — you suggested, we should log a warning and continue :+1:. As for the details, the resource resolver would ideally return something that the step wouldn’t have to treat any differently than a regular file. I’m thinking of a noop-like object, like 1
in multiplications - you can multiply by 1, but it doesn’t change anything.
Issue:
While writing e2e tests I've noticed the
continueOnError
functionality does not fully work for steps that download resources. The client will throw an error that will fail the whole blueprint run if any headers for at least one stream return with a code$code > 399 || $code < 200
. This is unexpected as one might think that a CoE step should be able to fail for any reason and do not impact the whole run.Current behavior is due to this code in
streams_send_http_requests
:Example:
For this blueprint:
...it can be noticed that the blueprint failed at step 0, while it should not fail at all:
Solution:
It seems that doing nothing is better than throwing an exception there.
In my setup the code above is commented out, and multiple
InstallPluginSteps
are run. An exception for the step with the invalid url is still thrown, but for an issue with activation. (Duh! The resource is not there.) This is then caught in the runner and since that step iscontinueOnError
the exception is suppressed and the blueprint completes. Which is mostly what we want.But not entirely. Now the issue would be that the
InstallPluginStepRunner
tries to activate the inexistent plugin and fails. This generates a message that the activation failed, which is only semi-true, because what actually failed is the download.I imagine the stream context could carry more info on how and why the resource was not procured. This should be checked before activation attempts and a relevant exception should be thrown then. Saying something along the lines of
Download failed. Sorry!
:)I have to ponder for a moment how this could be done in detail, however the end result should look more or less like that: