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 cancel grace period to bootstrap #2910

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Jul 31, 2024

Description

The buildkite-agent bootstrap forked from buildkite-agent start needs both cancel-grace-period and signal-grace-period.

Context

In #2899 the cancel grace period was added as a flag and env var read by the bootstrap subcommand, but I forgot to set it from the job runner.

Changes

  • Pass the value through an env var just like BUILDKITE_SIGNAL_GRACE_PERIOD_SECONDS
  • Also a small cleanup across the whole agent codebase to replace fmt.Sprintf("%d", ...) with strconv.Itoa(...) (does the same thing, but it doesn't need the fmt package to parse a format string).

Note: the two env vars are different due to historical reasons. See https://github.com/buildkite/agent/blob/main/clicommand/cancel_signal.go

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 ./...)
  • Manually checked that it works

Copy link
Contributor

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

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

👍🏻 much better using strconv.Itoa 🚀

@DrJosh9000 DrJosh9000 merged commit ab0a68e into main Jul 31, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the pass-cancel-grace-period-to-bootstrap branch July 31, 2024 06:11
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