Add context propagation

What does this MR do?

  • Propagate context through the build pipeline for better tracing
  • Pass context to all major operations instead of using context.Background()

Apologies for the massive patch. I tried to make individual commits, but unfortunately context threading necessitates a lot of changed lines, especially in tests.

Why was this MR needed?

Context has been a staple in Go since 1.7 which was released in 2016. It brings consistent context propagation and cancellation.

While this patch does not change any existing behaviour, it creates the foundation to add tracing (e.g. otel), improved logging (consistent correlation id), propagation of job context, as well as other things like timeouts (example).

I would consider this patch a modernization effort, that we can use to build on top of.

What's the best way to test this MR?

I've tested it locally.

What are the relevant issue numbers?

Edited by Igor

Merge request reports

Loading