Skip to content

Conversation

@dcodesdev
Copy link
Collaborator

@dcodesdev dcodesdev commented Nov 5, 2025

Closes #1602. Adds -q/--quiet flag to suppress non-error output from cargo-shuttle and runtime. Error messages and signal handling output remain visible.

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 quiet flag to RunArgs struct in cargo-shuttle/src/args.rs
  • Threaded the quiet flag through local_build, local_docker_build, and find_available_port methods
  • Suppressed build messages, port change notifications, Docker warnings, and startup messages when quiet mode is enabled
  • Passed quiet flag to runtime via SHUTTLE_QUIET environment 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 new quiet parameter, which is recommended per the custom instructions for new or complex functionality
  • The implementation correctly hardcodes quiet=false in the build command (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)

  1. cargo-shuttle/src/lib.rs, line 1737-1742 (link)

    style: Missing function documentation explaining the purpose of the new quiet parameter

    Context Used: Context from dashboard - Include comments explaining the purpose of functions, especially for new or complex functionality. (source)

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

}

async fn local_build(&self, build_args: &BuildArgsShared) -> Result<BuiltService> {
async fn local_build(&self, build_args: &BuildArgsShared, quiet: bool) -> Result<BuiltService> {
Copy link
Contributor

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

Suggested change
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) {
Copy link
Contributor

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

Suggested change
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.

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.

[Improvement]: --quiet flag for local runs

2 participants