Skip to content

Pass context.Context as the first argument to every function within go-vela/server #832

@JordanSussman

Description

@JordanSussman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/serverIndicates a change to the serverenhancementIndicates an improvement to a feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions