-
Notifications
You must be signed in to change notification settings - Fork 300
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
Rename env var to BUILDKITE_STEP_CANCEL_FORCE_GRACE_PERIOD_SECONDS
#3087
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good improvement (I did suggest it 😅).
My only hesitation is around whether its aligned with the rest of the agent that the ENV var name doesn't match the flag name 1:1.
clicommand/step_cancel.go
Outdated
@@ -74,7 +74,7 @@ var StepCancelCommand = cli.Command{ | |||
Name: "force-grace-period-seconds", | |||
Value: defaultCancelGracePeriod, | |||
Usage: "The number of seconds to wait for agents to finish uploading artifacts before transitioning unfinished jobs to a canceled state. ′--force′ must also be supplied for this to take affect", | |||
EnvVar: "BUILDKITE_FORCE_GRACE_PERIOD_SECONDS,BUILDKITE_CANCEL_GRACE_PERIOD", | |||
EnvVar: "BUILDKITE_FORCE_CANCEL_GRACE_PERIOD_SECONDS,BUILDKITE_CANCEL_GRACE_PERIOD", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DrJosh9000, @wolfeidau is it ok that this environment variable doesn't 1:1 match the flag? It feels a bit redundant to include the work "cancel" in the flag name - but fairly important to have it in the global ENV var name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some similar differences in other flags such as https://github.com/buildkite/agent/blob/main/clicommand/tool_sign.go#L123
Env vars are a global space so prefixing seems legit to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a legitimate prefix (that matches the command name) would technically be BUILDKITE_STEP_CANCEL_FORCE_GRACE_PERIOD_SECONDS
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good - it's clear that this env var goes with this flag, and the flag belongs in the context of the command but the env var stands alone.
9786332
to
7f81f58
Compare
BUILDKITE_STEP_CANCEL_FORCE_GRACE_PERIOD_SECONDS
@@ -74,7 +74,7 @@ var StepCancelCommand = cli.Command{ | |||
Name: "force-grace-period-seconds", | |||
Value: defaultCancelGracePeriod, | |||
Usage: "The number of seconds to wait for agents to finish uploading artifacts before transitioning unfinished jobs to a canceled state. ′--force′ must also be supplied for this to take affect", | |||
EnvVar: "BUILDKITE_FORCE_GRACE_PERIOD_SECONDS,BUILDKITE_CANCEL_GRACE_PERIOD", | |||
EnvVar: "BUILDKITE_STEP_CANCEL_FORCE_GRACE_PERIOD_SECONDS,BUILDKITE_CANCEL_GRACE_PERIOD", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Description
Meant to include a3b8339 in #3084 but messed up the rebase.
BUILDKITE_STEP_CANCEL_FORCE_GRACE_PERIOD_SECONDS
feels like a better name for this env variable.Testing
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)