[API Server] Fill in finish time when pipeline instance is marked with final state
#5 Updated by Lucas Di Pentima almost 5 years ago
Test run: https://ci.curoverse.com/job/developer-run-tests/111/ (test run 110 failed on
sdk/python but didn't on my local run, so re-running to see if it was just a temporary issue)
before_save filter to
PipelineInstance model to update
finished_at dates when changing states.
#6 Updated by Tom Clegg almost 5 years ago
I think it would be good to ensure started_at isn't nil when changing state to Failed or Complete too, in case a client creates a new object with state=Complete.
I don't think it would affect anything in practice as things stand, but I think conceptually (and for the sake of our future selves) this should be before_validation rather than before_save -- e.g., if we were validating started_at and finished_at, we would want to validate after applying these defaults, not after.
other than those points, LGTM
#7 Updated by Lucas Di Pentima almost 5 years ago
Test running at https://ci.curoverse.com/job/developer-run-tests/114/
When the pipeline instances is finished (either completed or failed) and
nil, it will have the exact same time as