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

Emit a better error if the job API token is missing #2789

Merged
merged 1 commit into from
May 22, 2024

Conversation

moskyb
Copy link
Contributor

@moskyb moskyb commented May 22, 2024

Description

At the moment, if the job api is missing a token, we emit an error about something completely different:

fatal: failed to create Job API client: BUILDKITE_AGENT_JOB_API_SOCKET empty or undefined

This PR changes it so that we emit an error that doesn't actively lead users astray:

fatal: failed to create Job API client: BUILDKITE_AGENT_JOB_API_TOKEN empty or undefined

Context

Slack convo

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

@moskyb moskyb requested review from DrJosh9000 and dabarrell May 22, 2024 01:16
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! With one suggestion

jobapi/client.go Outdated Show resolved Hide resolved
@moskyb moskyb force-pushed the better-no-job-socket-token-error branch 2 times, most recently from 5e324ce to 44c685f Compare May 22, 2024 01:25
@moskyb moskyb enabled auto-merge May 22, 2024 01:26
@moskyb moskyb disabled auto-merge May 22, 2024 01:28
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@moskyb moskyb force-pushed the better-no-job-socket-token-error branch 2 times, most recently from e9ba654 to d704ca1 Compare May 22, 2024 01:30
@moskyb moskyb force-pushed the better-no-job-socket-token-error branch from d704ca1 to 3b0e6e5 Compare May 22, 2024 01:30
@moskyb moskyb enabled auto-merge May 22, 2024 01:31
@moskyb moskyb merged commit d31d6cc into main May 22, 2024
1 check passed
@moskyb moskyb deleted the better-no-job-socket-token-error branch May 22, 2024 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants