-
Notifications
You must be signed in to change notification settings - Fork 283
Add --quiet flag to shuttle run #2130
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
base: main
Are you sure you want to change the base?
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.
Greptile Overview
Greptile Summary
This PR successfully implements a --quiet/-q flag for the shuttle run command that suppresses non-error output while preserving error messages and signal handling.
Key changes:
- Added
quietflag toRunArgsstruct incargo-shuttle/src/args.rs - Threaded the quiet flag through
local_build,local_docker_build, andfind_available_portmethods - Suppressed build messages, port change notifications, Docker warnings, and startup messages when quiet mode is enabled
- Passed quiet flag to runtime via
SHUTTLE_QUIETenvironment variable - Runtime correctly suppresses startup and tracing initialization messages in quiet mode
Minor observations:
- The modified functions (
local_build,local_docker_build,find_available_port) lack documentation explaining the newquietparameter, which is recommended per the custom instructions for new or complex functionality - The implementation correctly hardcodes
quiet=falsein thebuildcommand (line 1407, 1410) since the build command doesn't have a quiet flag
Confidence Score: 4/5
- This PR is safe to merge with minimal risk - the changes are well-contained and only affect output behavior
- The implementation is straightforward and correct, with all quiet checks properly guarding output statements. Error messages remain visible as intended. Minor documentation improvements suggested per custom instructions, but functionality is solid
- No files require special attention - all changes are straightforward output suppression
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| cargo-shuttle/src/args.rs | 5/5 | Added quiet flag to RunArgs struct with proper documentation |
| cargo-shuttle/src/lib.rs | 4/5 | Threaded quiet flag through build and run methods, suppressing non-error output |
| runtime/src/start.rs | 5/5 | Added quiet mode support via SHUTTLE_QUIET environment variable to suppress startup messages |
Additional Comments (1)
3 files reviewed, 3 comments
| } | ||
|
|
||
| async fn local_build(&self, build_args: &BuildArgsShared) -> Result<BuiltService> { | ||
| async fn local_build(&self, build_args: &BuildArgsShared, quiet: bool) -> Result<BuiltService> { |
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.
style: Missing function documentation explaining the purpose of the new quiet parameter
| async fn local_build(&self, build_args: &BuildArgsShared, quiet: bool) -> Result<BuiltService> { | |
| /// Builds the project locally, optionally suppressing non-error output | |
| async fn local_build(&self, build_args: &BuildArgsShared, quiet: bool) -> Result<BuiltService> { |
Context Used: Context from dashboard - Include comments explaining the purpose of functions, especially for new or complex functionality. (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: cargo-shuttle/src/lib.rs
Line: 1414:1414
Comment:
**style:** Missing function documentation explaining the purpose of the new `quiet` parameter
```suggestion
/// Builds the project locally, optionally suppressing non-error output
async fn local_build(&self, build_args: &BuildArgsShared, quiet: bool) -> Result<BuiltService> {
```
**Context Used:** Context from `dashboard` - Include comments explaining the purpose of functions, especially for new or complex functionality. ([source](https://app.greptile.com/review/custom-context?memory=fe8549ea-5239-4b00-a674-867d405455c8))
How can I resolve this? If you propose a fix, please make it concise.| } | ||
|
|
||
| fn find_available_port(run_args: &mut RunArgs) { | ||
| fn find_available_port(run_args: &mut RunArgs, quiet: bool) { |
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.
style: Missing function documentation explaining the purpose of the new quiet parameter
| fn find_available_port(run_args: &mut RunArgs, quiet: bool) { | |
| /// Finds an available port for the service, optionally suppressing port change messages | |
| fn find_available_port(run_args: &mut RunArgs, quiet: bool) { |
Context Used: Context from dashboard - Include comments explaining the purpose of functions, especially for new or complex functionality. (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: cargo-shuttle/src/lib.rs
Line: 1424:1424
Comment:
**style:** Missing function documentation explaining the purpose of the new `quiet` parameter
```suggestion
/// Finds an available port for the service, optionally suppressing port change messages
fn find_available_port(run_args: &mut RunArgs, quiet: bool) {
```
**Context Used:** Context from `dashboard` - Include comments explaining the purpose of functions, especially for new or complex functionality. ([source](https://app.greptile.com/review/custom-context?memory=fe8549ea-5239-4b00-a674-867d405455c8))
How can I resolve this? If you propose a fix, please make it concise.
Closes #1602. Adds -q/--quiet flag to suppress non-error output from cargo-shuttle and runtime. Error messages and signal handling output remain visible.