Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JordanSussman opened this issue Jun 29, 2023 · 0 comments
Labels
area/server Indicates a change to the server enhancement Indicates an improvement to a feature

Comments

@JordanSussman
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/server Indicates a change to the server enhancement Indicates an improvement to a feature
Projects
None yet
Development

No branches or pull requests

2 participants