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

SUP-1619: Agent bulk stopping #178

Merged
merged 9 commits into from
Dec 22, 2023
Merged

SUP-1619: Agent bulk stopping #178

merged 9 commits into from
Dec 22, 2023

Conversation

james2791
Copy link
Contributor

@james2791 james2791 commented Dec 22, 2023

Adds the ability to stop agents in bulk - passing in an arbitrary number as arguments to the bk agent stop command

Example input:
bk agent stop 45c92047-689e-45b8-a3f7-601b6ac14cc9 92c614c0-8d8f-4857-93c6-d499e21a755b 06bb968f-1fd7-4210-9c34-c9f456b41e44

Output (on executing the command)

●∙ Stopping agent 45c92047-689e-45b8-a3f7-601b6ac14cc9 

Final output (with an example of errors surfacing):

Stopped agent 45c92047-689e-45b8-a3f7-601b6ac14cc9 
Stopped agent 92c614c0-8d8f-4857-93c6-d499e21a755b
Error: PUT https://api.buildkite.com/v2/organizations/my-org/agents/06bb968f-1fd7-4210-9c34-c9f456b41e44/stop: 404 Not Found

Each stop is subsequently made with a new bubble tea program: and as each API request is completed - either success or outputted error surfaces (with the status code/message)

On the case of no agents slug/UUIDs passed through to bk agent stop, this also introduces SilenceUsage to the root command: which will not surface usage prompts when an error is returned by any command on bk.

@james2791 james2791 force-pushed the SUP-1619-Agent-Bulk-Stop branch from b41b278 to 4345d5c Compare December 22, 2023 03:33
@james2791 james2791 marked this pull request as ready for review December 22, 2023 04:31
pkg/cmd/agent/stop.go Outdated Show resolved Hide resolved
mcncl
mcncl previously approved these changes Dec 22, 2023
@james2791 james2791 merged commit 09fd315 into 3.x Dec 22, 2023
1 check passed
@james2791 james2791 deleted the SUP-1619-Agent-Bulk-Stop branch December 22, 2023 05:12
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