Skip to content

Conversation

NathanFlurry
Copy link
Member

Changes

Copy link
Member Author

NathanFlurry commented Jun 4, 2025


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@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.

PR Summary

This PR adds non-interactive mode and route management options to the Rivet CLI, enabling automated deployments and fine-grained control over route handling.

  • Added skip_route_creation and keep_existing_routes options in deploy.rs to control route behavior, but these are not properly exposed in actor/create.rs
  • New function module with list and endpoint commands for route management, but endpoint.rs has potential issues with route ID vs function name matching
  • Modified setup_function_routes in deploy.rs to support non-interactive mode with detailed logging, but could benefit from more robust error handling
  • Added environment credential persistence in toolchain_ctx.rs when loading from env vars
  • Inconsistent naming between 'function' and 'route' throughout the codebase (e.g., command aliases) could cause confusion

8 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 24 to 25
#[clap(long)]
skip_route_creation: Option<bool>,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Missing help text for skip_route_creation option. Add doc comment explaining what this flag does.

Comment on lines 27 to 28
#[clap(long)]
keep_existing_routes: Option<bool>,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Missing help text for keep_existing_routes option. Add doc comment explaining what this flag does.

/// List all functions for an environment
#[derive(Parser)]
pub struct Opts {
/// Specify the environment to list function for (will prompt if not specified)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Typo in help text: 'list function for' should be 'list functions for'

Suggested change
/// Specify the environment to list function for (will prompt if not specified)
/// Specify the environment to list functions for (will prompt if not specified)

Comment on lines 203 to 205
skip_route_creation: None,
keep_existing_routes: None,
non_interactive: false,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: These new deploy options are hardcoded but not exposed in the actor creation CLI. Should add corresponding CLI options if these parameters are meant to be configurable.

async fn get_route(
ctx: &ToolchainCtx,
env: &str,
route_id: &str,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Parameter name route_id is misleading since it's actually receiving a function name

Suggested change
route_id: &str,
function_name: &str,

let matching_route = routes_response
.routes
.iter()
.find(|route| route.id == *route_id)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Route lookup compares route.id with route_id but receives a function name - these may not match. Should likely compare against a different route field

pub mod endpoint;
pub mod list;

/// Commands for managing routes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Module comment describes 'routes' but module name is 'function'. Consider updating comment or module name for consistency.

Comment on lines 62 to 68
/// Commands for managing routes
#[clap(alias = "f", alias = "func", alias = "route")]
Function {
#[clap(subcommand)]
subcommand: function::SubCommand,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The docstring says 'Commands for managing routes' but the command is named 'Function'. Consider renaming to 'Route' for consistency with the documentation, or update the docstring to match the command name.

Comment on lines +68 to +70
/// Get information about a specific route endpoint
Endpoint(function::endpoint::Opts),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: The Endpoint command appears to duplicate functionality that should be under the Function subcommand. Consider moving this under Function instead of having it as a top-level command.

Comment on lines 22 to 24
pub skip_route_creation: Option<bool>,
pub keep_existing_routes: Option<bool>,
pub non_interactive: bool,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider making skip_route_creation and keep_existing_routes required bools when non_interactive is true

@NathanFlurry NathanFlurry force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 66e1fea to 9a6121a Compare June 4, 2025 08:52
Copy link

cloudflare-workers-and-pages bot commented Jun 4, 2025

Deploying rivet-studio with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98c7762
Status:⚡️  Build in progress...

View logs

Copy link

cloudflare-workers-and-pages bot commented Jun 4, 2025

Deploying rivet-hub with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3cd15b1
Status: ✅  Deploy successful!
Preview URL: https://5cb2ba00.rivet-hub-7jb.pages.dev
Branch Preview URL: https://feat-add-non-interactive-mod.rivet-hub-7jb.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Jun 4, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98c7762
Status: ✅  Deploy successful!
Preview URL: https://c834f55d.rivet.pages.dev
Branch Preview URL: https://feat-add-non-interactive-mod.rivet.pages.dev

View logs

@NathanFlurry NathanFlurry force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 9a6121a to 8dd2e07 Compare June 5, 2025 01:36
@NathanFlurry NathanFlurry force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 8dd2e07 to 599e320 Compare June 5, 2025 04:45
@NathanFlurry NathanFlurry force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 599e320 to 6f9b0ac Compare June 8, 2025 19:09
@NathanFlurry NathanFlurry force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 6f9b0ac to e336e8e Compare June 9, 2025 18:59
@MasterPtato MasterPtato changed the base branch from main to graphite-base/2532 June 9, 2025 19:25
@MasterPtato MasterPtato force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from e336e8e to 571ab68 Compare June 9, 2025 19:26
@MasterPtato MasterPtato changed the base branch from graphite-base/2532 to 06-09-fix_pegboard_fix_container_runner_orphaning June 9, 2025 19:26
@MasterPtato MasterPtato force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 259d912 to 540f9d2 Compare June 16, 2025 21:56
@MasterPtato MasterPtato force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 540f9d2 to 3cd15b1 Compare June 17, 2025 00:33
@abcxff abcxff force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 3cd15b1 to 259d912 Compare June 18, 2025 16:37
@MasterPtato MasterPtato force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 259d912 to 3cd15b1 Compare June 18, 2025 23:47
@NathanFlurry NathanFlurry force-pushed the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch from 3cd15b1 to 98c7762 Compare June 20, 2025 18:54
Copy link
Contributor

graphite-app bot commented Jun 20, 2025

Merge activity

  • Jun 20, 7:02 PM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Jun 20, 7:03 PM UTC: CI is running for this pull request on a draft pull request (#2629) due to your merge queue CI optimization settings.
  • Jun 20, 7:04 PM UTC: Merged by the Graphite merge queue via draft PR: #2629.

graphite-app bot pushed a commit that referenced this pull request Jun 20, 2025
…2532)

<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
@graphite-app graphite-app bot closed this Jun 20, 2025
@graphite-app graphite-app bot deleted the feat_add_non-interactive_mode_and_route_management_options_to_CLI branch June 20, 2025 19:04
@NathanFlurry NathanFlurry mentioned this pull request Jul 3, 2025
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.

1 participant