Support linking downstream pipelines to upstream pipelines in CI Visibility#405
Merged
nikita-tkachenko-datadog merged 5 commits intoMar 26, 2024
Conversation
…to provisioned jobs
nikita-tkachenko-datadog
marked this pull request as ready for review
March 22, 2024 17:19
drodriguezhdez
left a comment
Collaborator
There was a problem hiding this comment.
I've dropped some comments.
Co-authored-by: Daniel Rodriguez Hernandez <[email protected]>
nikita-tkachenko-datadog
deleted the
nikita-tkachenko/downstream-pipelines-support
branch
March 26, 2024 14:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Implements linking downstream pipelines to upstream pipelines in CI Visibility.
In order to link the two pipelines, the downstream pipeline's webhook payload should contain an additional section that has the URL and trace ID of its upstream pipeline.
The needed data are obtained from the
CauseActionof the downstream's pipeline and from theBuildSpanManagerin-memory cache.The
BuildSpanManageris changed from only storing info about the running jobs to also storing info about the latest N (1024 by default) finished jobs.Storing info about the finished jobs is required because the downstream pipeline event handler needs to obtain the trace ID of the upstream pipeline (by the time this happens the upstream pipeline has already finished its execution).
The size of the cache should be in the hundreds of kilobytes.
It should be very unlikely that the upstream pipeline trace context is already removed by the time the downstream pipeline is executed, but if it happens the only logic that stops working is the one that links upstream to downstream.
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-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.