Do not submit running pipelines data until accurate start time is known #490
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements for Contributing to this repository
What does this PR do?
Updates the code to not submit pipeline trace if its accurate start time is not known.
This is needed because the backend relies on start time being constant (otherwise the finished pipeline record will not converge with its running pipeline record).
The accurate start time for a pipeline (
WorkflowRun
) is only known once the first step starts executing.Everything before that counts as queued time: for example, a pipeline might be waiting for available executor.
Previous version of the code simply avoided sending pipeline data inside the
#onStarted()
callback (since the callback is executed before the available executor check).This is not always sufficient: other callbacks that happen before the first step execution (such as the SCM callback for checking out a shared library) need to be excluded as well.
The new approach is more robust, as it checks that the pipeline queue time has been calculated (which only happens once the pipeline leaves the buildable queue).
Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/
label attached. If applicable it should have thebackward-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.