Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request enables a configurable command timeout flag for SSH operations, replacing the previous hardcoded 300-second timeout. The changes introduce context-based timeout management throughout the codebase, allowing users to customize timeout behavior via a --run.cmd-timeout flag.
Changes:
- Added
--run.cmd-timeoutflag (default: 300 seconds) to control SSH command and copy operation timeouts - Refactored Target interface to accept context parameters for Run and Copy operations
- Introduced Options struct pattern for constructor parameters across target, service, and agent packages
- Added context propagation from root command through all service and agent operations
- Improved error handling for JSON marshaling operations
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/root.go | Added persistent --run.cmd-timeout flag and signal-based context cancellation |
| internal/target/target.go | Updated Target interface to accept context, introduced Options struct, renamed NewTarget to New |
| internal/target/local.go | Updated to use context-based timeouts for local command execution |
| internal/target/remote.go | Updated to use context-based timeouts for remote SSH operations |
| internal/service/service.go | Added context field and Options struct for service configuration |
| internal/agent/agent.go | Added context field and Options struct for agent configuration |
| cmd/service/*.go | Updated all service commands to pass timeout via Options |
| cmd/agent/*.go | Updated all agent commands to pass timeout via Options |
| internal/service/*.go | Updated all service operations to use context from service instance |
| internal/agent/*.go | Updated all agent operations to use context from agent instance |
| *_test.go | Updated tests to use new API with Options struct and context |
| cmd/errors/errors.go | Added error handling for JSON marshaling failures |
336ec07 to
9339040
Compare
9339040 to
0e5ba1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.