Fix step caching
Created by: eseliger
This fixes two things, that I found today:
- It changes Stdout and Stderr on the StepResult struct to string, it is part of the marshalled cache result and *bytes.Buffer cannot be marshalled into JSON. This caused stdout/stderr to always be empty, thus breaking executions where
${{ previous_step.stdout }}
is used. - It fixes a misconception of the
PreviousStepResult
. When running the actual execution, it will eventually become the result of the previous step, but from the perspective of that particular cache result, it has to be the result from THAT step execution. Otherwise caching would only work from step 2 on and skip 1 step still.
This will follow a PR on the src side to make use of it and properly populate the step result.
Note that I intentionally changed the json key of step result, to invalidate all step caches that had this broken state stored.
Test plan
Validated with the src side change that it has the desired effect.