community
community copied to clipboard
Pass `context.Context` as the first argument to every function within go-vela/server
Description
Every function should be updated to have context.Context as the first argument.
Value
In many Go APIs, especially modern ones, the first argument to functions and methods is often context.Context. Context provides a means of transmitting deadlines, caller cancellations, and other request-scoped values across API boundaries and between processes. It is often used when a library interacts — directly or transitively — with remote servers, such as databases, APIs, and the like. - https://go.dev/blog/context-and-structs
The initial use-case for this data is to enable opentelemetry to have a consistent trace ID across function calls within a single HTTP request.
Definition of Done
context.Context
has been added to every function within https://github.com/go-vela/server.
Effort (Optional)
2 days
Impacted Personas (Optional)
Vela developers