Skip to content

Conversation

@NathanFlurry
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rivetkit-serverless Ready Ready Preview Comment Nov 4, 2025 7:26pm
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rivet-cloud Ignored Ignored Nov 4, 2025 7:26pm
rivet-inspector Ignored Ignored Preview Nov 4, 2025 7:26pm
rivet-site Ignored Ignored Preview Nov 4, 2025 7:26pm

Copy link
Member Author

NathanFlurry commented Nov 3, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

This was referenced Nov 3, 2025
@claude
Copy link

claude bot commented Nov 3, 2025

Code Review

This PR adds a new development helper script for opening a subshell with Rivet engine environment variables. Overall, the implementation is clean and follows good practices. Here are my findings:

✅ Strengths

  1. Good Shell Practices: Uses set -euo pipefail for proper error handling
  2. Consistent Pattern: Follows the same structure as other scripts in scripts/run/
  3. Path Resolution: Properly resolves script directory and repo root
  4. User Feedback: Provides clear informational output about the environment setup
  5. Shell Flexibility: Respects the user's preferred shell via ${SHELL:-bash}

💡 Suggestions

1. Missing Postgres Availability Check

The script hardcodes the Postgres URL but doesn't verify that Postgres is actually running. Consider adding a check similar to engine-postgres.sh:7-29:

if ! command -v nc >/dev/null 2>&1; then
  echo "warning: 'nc' not found, cannot verify postgres availability"
else
  if ! nc -z localhost 5432 >/dev/null 2>&1; then
    echo "warning: Postgres is not reachable at localhost:5432."
    echo "You may need to start postgres with: ./scripts/run/postgres.sh"
  fi
fi

This would provide a better developer experience by catching the issue early.

2. Documentation Consideration

Since this is a new development tool, consider:

  • Adding a comment at the top of the script explaining its purpose and use cases
  • Mentioning this script in the repo's development documentation (if it exists)

Example header:

#!/usr/bin/env bash
# Opens a subshell with Rivet engine environment variables configured.
# Useful for running engine commands without cargo run, or for debugging.
# Example: After running this, you can use 'rivet-engine' directly.

3. Minor: PATH Order

The PATH prepends debug before release binaries. This is likely intentional (prefer debug builds), but worth confirming this is the desired behavior for all use cases.

🔒 Security

No security concerns. The script:

  • Uses local development credentials only
  • Doesn't persist any sensitive data
  • Properly quotes all variables

🧪 Testing

The script is straightforward and follows established patterns. Manual testing should verify:

  • Works when Postgres is running
  • Handles missing SHELL variable gracefully
  • Correctly sets environment variables in the subshell

📊 Performance

N/A - This is a simple shell script with negligible performance impact.

✅ Conclusion

LGTM with suggestions! The script is functional and follows good practices. The suggestions above would enhance the developer experience but aren't blocking issues.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 3, 2025

More templates

@rivetkit/actor

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/actor@3311

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@3311

@rivetkit/core

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/core@3311

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@3311

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@3311

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@3311

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@3311

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@3311

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@3311

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@3311

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@3311

commit: 2d5829b

@claude
Copy link

claude bot commented Nov 4, 2025

Code Review

Thank you for this contribution! This is a useful developer utility script. Here's my review:

✅ Strengths

  1. Good bash practices: Uses set -euo pipefail for proper error handling
  2. Consistent structure: Follows the same pattern as other scripts in scripts/run/ (proper shebang, directory resolution)
  3. Clear user feedback: Informative echo statements help users understand what's happening
  4. Executable permissions: Correctly set as executable

💡 Suggestions

1. Consider PostgreSQL availability check

The script sets RIVET__POSTGRES__URL=postgres://postgres:postgres@localhost:5432/postgres but doesn't verify that PostgreSQL is actually running. Consider adding a check similar to engine-postgres.sh:

# Check if postgres is running
if ! command -v nc >/dev/null 2>&1; then
  echo "warning: 'nc' not found. Cannot verify postgres is running."
elif ! nc -z localhost 5432 >/dev/null 2>&1; then
  echo "warning: postgres does not appear to be running at localhost:5432"
  echo "consider running: ./scripts/run/postgres.sh"
fi

This would provide better developer experience by catching configuration issues early.

2. Script naming clarity

The script name engine-postgres-shell.sh is a bit ambiguous - it could be interpreted as:

  • A shell/REPL for the postgres database
  • A shell environment for running engine commands

Consider either:

  • Adding a comment at the top explaining the purpose
  • Or renaming to something like engine-postgres-env.sh or engine-dev-shell.sh

Example header comment:

#!/usr/bin/env bash
# Opens a subshell with environment variables configured for running rivet-engine
# with PostgreSQL backend. Useful for manual testing and debugging.
set -euo pipefail

3. Document the script's purpose

Since this is a developer utility, consider adding it to project documentation or a README in the scripts/run/ directory so developers know it exists and when to use it.

🔒 Security

No security concerns - this is a local development script with hardcoded localhost credentials, which is appropriate for dev environments.

🎯 Use Cases

This script would be particularly useful for:

  • Manual debugging of engine commands
  • Running quick one-off engine operations
  • Testing different engine configurations

Overall Assessment

This is a solid addition to the developer tooling. The suggestions above are minor improvements that would enhance discoverability and user experience, but the script is functional and follows repository conventions as-is.

Recommendation: Approve with optional improvements

@claude
Copy link

claude bot commented Nov 4, 2025

PR Review: Add engine shell command

Summary

This PR adds a new utility script engine-postgres-shell.sh that opens a subshell with pre-configured environment variables for working with the Rivet engine and PostgreSQL. This is a helpful developer tool for debugging and manual testing.

Code Quality ✅

Positives:

  • Follows existing script conventions (shebang, set -euo pipefail, path resolution)
  • Consistent with other scripts in scripts/run/ directory
  • Clear, helpful output messages for the user
  • Properly uses exec to replace the current shell process
  • Respects user's preferred shell via ${SHELL:-bash}

Suggestions:

  1. Add PostgreSQL availability check (Low Priority)

    Similar to engine-postgres.sh (lines 12-29), consider adding a check to ensure PostgreSQL is running:

    if ! command -v nc >/dev/null 2>&1; then
      echo "warning: 'nc' not found, skipping postgres availability check"
    elif ! nc -z localhost 5432 >/dev/null 2>&1; then
      echo "warning: Postgres may not be reachable at localhost:5432"
      echo "Consider running: ./scripts/run/postgres.sh"
    fi

    This would improve the user experience by catching configuration issues early.

  2. Documentation (Low Priority)

    Consider adding a brief comment at the top of the file explaining the script's purpose:

    #!/usr/bin/env bash
    # Opens a subshell with Rivet engine environment variables configured
    # for PostgreSQL development. Useful for running engine commands manually.
    set -euo pipefail

Potential Issues

None identified - The script is straightforward and doesn't have any bugs or security concerns.

Performance Considerations

N/A - This is a simple shell script with negligible performance impact.

Security Concerns

Low Risk - The hardcoded credentials (postgres:postgres@localhost:5432) are appropriate for local development environments. The script clearly targets local development only, as indicated by the localhost connection string.

Test Coverage

N/A - This is a developer utility script. Manual testing is sufficient.

Overall Assessment

LGTM! ✅

This is a clean, simple utility that follows repository conventions. The suggestions above are minor improvements that could enhance usability but are not blockers. The script is ready to merge as-is.


Review generated with assistance from Claude Code

@claude
Copy link

claude bot commented Nov 4, 2025

Code Review

Overview

This PR adds a new utility script engine-postgres-shell.sh that provides a convenient subshell environment with Rivet engine PostgreSQL configuration pre-loaded. Overall, this is a useful developer tool that follows good practices.

✅ Positive Observations

  1. Consistent Structure: The script follows the same patterns as other scripts in scripts/run/:

    • Uses set -euo pipefail for proper error handling
    • Calculates SCRIPT_DIR and REPO_ROOT using the same approach
    • Follows the executable permissions convention
  2. Good User Experience:

    • Clear echo messages explaining what's happening
    • Instructions on how to exit the subshell
    • Uses the user's preferred shell via ${SHELL:-bash}
  3. PATH Extension: Smart addition of both debug and release target directories to PATH, allowing easy execution of built binaries

💡 Suggestions for Improvement

1. Consider PostgreSQL Availability Check

The related script engine-postgres.sh includes a check to ensure PostgreSQL is running before proceeding. Consider adding a similar check here to provide better UX:

if ! command -v nc >/dev/null 2>&1; then
  echo "warning: 'nc' not found, cannot verify postgres connectivity"
elif ! nc -z localhost 5432 >/dev/null 2>&1; then
  echo "warning: Postgres may not be reachable at localhost:5432"
  echo "Consider running ./scripts/run/postgres.sh first"
fi

This is optional since a shell environment might be used for various purposes, not just immediate database access.

2. Environment Variable Documentation

Consider adding a brief comment at the top explaining what this script does and when to use it:

#!/usr/bin/env bash
# Opens a subshell with Rivet engine environment variables configured
# Useful for running engine binaries or debugging without starting the full engine
set -euo pipefail

3. Hardcoded Credentials

The PostgreSQL URL contains hardcoded credentials (postgres:postgres). While this is consistent with other scripts in the repository and appropriate for local development, consider:

  • Adding a comment noting these are local dev credentials only
  • Or supporting an optional override via environment variable check

🔍 Security Considerations

  • ✅ No security concerns for a local development script
  • ✅ Credentials are appropriate for local Docker environments
  • ✅ Script properly validates paths and uses safe variable expansion

🧪 Testing Considerations

  • Manual testing recommended: Verify the script works with different shells (bash, zsh, fish)
  • Verify PATH extension allows running engine binaries as expected
  • Test behavior when PostgreSQL is not running

📊 Performance

  • ✅ No performance concerns - this is a lightweight utility script

Summary

This is a solid addition to the developer tooling. The script is well-structured, follows repository conventions, and provides clear value. The suggestions above are optional enhancements that could improve the user experience slightly, but the script is merge-ready as-is.

Recommendation: ✅ Approve

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 4, 2025

Merge activity

  • Nov 4, 8:09 PM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Nov 4, 8:11 PM UTC: CI is running for this pull request on a draft pull request (#3349) due to your merge queue CI optimization settings.
  • Nov 4, 8:41 PM UTC: The Graphite merge queue removed this pull request due to removal of a downstack PR #3342.
  • Nov 4, 8:49 PM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Nov 4, 8:50 PM UTC: CI is running for this pull request on a draft pull request (#3352) due to your merge queue CI optimization settings.
  • Nov 4, 8:52 PM UTC: Merged by the Graphite merge queue via draft PR: #3352.

graphite-app bot pushed a commit that referenced this pull request Nov 4, 2025
@NathanFlurry NathanFlurry force-pushed the 11-02-chore_set_minimum_node_version_to_20 branch from 141efff to 33ba42a Compare November 4, 2025 20:25
@NathanFlurry NathanFlurry force-pushed the 11-02-chore_scripts_add_engine_shell_command branch from 87a9fb6 to 2d5829b Compare November 4, 2025 20:25
@vercel
Copy link

vercel bot commented Nov 4, 2025

Deployment failed with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@claude
Copy link

claude bot commented Nov 4, 2025

Code Review

Summary

This PR adds a new shell script engine-postgres-shell.sh that opens a subshell with Rivet engine environment variables pre-configured for Postgres development. The script is well-structured and follows existing patterns in the codebase.

✅ Strengths

  1. Consistent with existing patterns: The script follows the same structure as other scripts in scripts/run/, using set -euo pipefail and the same directory resolution pattern.

  2. Good user experience: Clear echo statements inform the user about the environment and how to exit the subshell.

  3. PATH modification: Smart addition of both debug and release build directories to PATH, making it easy to run compiled binaries.

  4. Shell flexibility: Uses the user's preferred shell with a bash fallback.

🔍 Observations & Suggestions

1. Missing Postgres availability check

Unlike engine-postgres.sh (lines 7-29), this script doesn't check if Postgres is running or start it automatically. Users might be confused if they run this script without Postgres running.

Suggestion: Consider adding a check similar to engine-postgres.sh:

  • Check if Postgres is reachable on localhost:5432
  • If not, either start it automatically or print a helpful error message

2. Environment variable consistency

The script exports RIVET__POSTGRES__URL and RUST_LOG, which is good. However, engine-postgres.sh doesn't export these (uses inline environment variables on line 33-35).

Question: Is there a reason for this difference? If this script is meant to provide an interactive development environment, exporting makes sense. Just want to ensure this is intentional.

3. Documentation/Comments

The script lacks a header comment explaining its purpose and usage.

Suggestion: Add a brief comment at the top explaining the script's purpose.

4. Hard-coded credentials

The Postgres URL contains hard-coded credentials (postgres:postgres), which matches postgres.sh and engine-postgres.sh. This is fine for local development.

Security: ✅ No concerns - these are local development credentials only.

📊 Code Quality Assessment

Aspect Rating Notes
Code Quality ⭐⭐⭐⭐ Clean, readable, follows conventions
Error Handling ⭐⭐⭐ Basic bash safety, could add Postgres check
Documentation ⭐⭐⭐ Good inline output, missing header comment
Security ⭐⭐⭐⭐⭐ No security concerns for dev script
Consistency ⭐⭐⭐⭐ Matches existing script patterns

🎯 Verdict

Recommendation: ✅ Approve with minor suggestions

This is a useful developer experience improvement. The script is solid and ready to merge. The suggestions above are optional enhancements that could improve consistency and user experience, but they're not blockers.

📝 Optional Enhancements (Non-blocking)

  1. Add Postgres availability check or at least a warning message
  2. Add header comment explaining the script's purpose
  3. Consider verifying consistency with other scripts regarding environment variable exports

Great work on improving the developer workflow! 🚀

@claude
Copy link

claude bot commented Nov 4, 2025

Code Review Summary

This PR adds a helper script to open a subshell with engine environment variables pre-configured for local development. Overall, the implementation is clean and follows good shell scripting practices.

✅ Positives

  • Good error handling: Uses set -euo pipefail for safe shell execution
  • Clean path resolution: Properly resolves script directory and repo root using standard patterns
  • User-friendly output: Provides clear feedback about what environment is being set up
  • Shell flexibility: Respects user's $SHELL preference with sensible fallback
  • Executable permissions: File is properly marked as executable (0755)
  • Consistent style: Follows the same patterns as existing scripts in the repository (e.g., engine-postgres.sh)

🔍 Observations & Suggestions

1. Security Note: Hardcoded Credentials

The script contains hardcoded postgres credentials (postgres:postgres@localhost:5432). While this is acceptable for local development scripts, it's worth noting:

  • ✅ Safe for local development environments
  • ✅ Consistent with engine-postgres.sh which uses the same credentials
  • Consider adding a comment explaining these are local dev credentials only

2. Potential Enhancement: Postgres Availability Check

Unlike engine-postgres.sh (lines 7-29), this script doesn't verify that Postgres is running at localhost:5432 before opening the shell. Consider:

  • Adding a similar check or warning if Postgres isn't reachable
  • Or documenting that users should run ./scripts/run/postgres.sh first
  • This would prevent confusion when users try to run commands that need the database

3. Minor: Path Export Order

export PATH="${REPO_ROOT}/target/debug:${REPO_ROOT}/target/release:${PATH}"

This prepends both debug and release directories, with debug taking precedence. This is fine, but worth noting that debug builds will shadow release builds. Consider if this is intentional or if only one should be included based on build mode.

🎯 Code Quality Assessment

  • Best Practices: ✅ Excellent
  • Security: ✅ Appropriate for local dev scripts
  • Performance: ✅ N/A (script is lightweight)
  • Test Coverage: ⚠️ Shell scripts typically aren't unit tested, but manual testing recommended
  • Documentation: ⚠️ Could benefit from a comment block at the top explaining purpose and usage

📝 Recommendation

Approve with minor suggestions. The code is production-ready for its intended purpose. The suggestions above are optional enhancements that could improve user experience but aren't blockers.

Optional Enhancement Example

If you want to add the Postgres check, here's a pattern from engine-postgres.sh:

if ! command -v nc >/dev/null 2>&1; then
  echo "warning: 'nc' not found, cannot check if postgres is running"
elif ! nc -z localhost 5432 >/dev/null 2>&1; then
  echo "warning: postgres is not reachable at localhost:5432"
  echo "Run './scripts/run/postgres.sh' to start postgres"
fi

Great addition to the developer tooling! 🚀

graphite-app bot pushed a commit that referenced this pull request Nov 4, 2025
@graphite-app graphite-app bot closed this Nov 4, 2025
@graphite-app graphite-app bot deleted the 11-02-chore_scripts_add_engine_shell_command branch November 4, 2025 20:52
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.

3 participants