Skip to content

Conversation

@NathanFlurry
Copy link
Member

No description provided.

@vercel vercel bot temporarily deployed to Preview – rivetkit-serverless December 1, 2025 05:47 Inactive
@vercel
Copy link

vercel bot commented Dec 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
rivet-inspector Error Error Dec 3, 2025 2:00am
rivetkit-serverless Error Error Dec 3, 2025 2:00am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rivet-cloud Ignored Ignored Dec 3, 2025 2:00am
rivet-site Ignored Ignored Preview Dec 3, 2025 2:00am

Copy link
Member Author

NathanFlurry commented Dec 1, 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.

@claude
Copy link

claude bot commented Dec 1, 2025

PR Review: fix(frontend): update env vars for dev

Summary

This PR simplifies the frontend environment variable configuration by removing the __AUTO__ endpoint detection logic and cleaning up redundant schema definitions. Overall, this is a good cleanup that makes the configuration more explicit and easier to understand.


✅ Positive Changes

  1. Removed Complex Auto-Detection Logic: The removal of __AUTO__ logic that attempted to map hub. hostnames to api. endpoints simplifies the codebase and reduces potential failure points.

  2. Better Comments: Added helpful comments explaining what __SAME__ is used for and the purpose of different API endpoint variables.

  3. Simplified Schema: Removed the redundant VITE_APP_API_URL transformation in cloudEnvSchema and the unused VITE_APP_CLOUD_ENGINE_URL.

  4. Explicit Dev Configuration: The .env file now explicitly sets both API URLs to localhost, making local development configuration clearer.


🔍 Code Quality Observations

1. Inconsistent window Check (Minor)

Location: frontend/src/components/lib/config.ts:28

The getApiEndpoint function in src/components/lib/config.ts still checks typeof window !== "undefined" before accessing window.location.origin:

if (typeof window !== "undefined" && apiEndpoint === "__SAME__") {
    return window.location.origin;
}

However, in frontend/packages/components/src/lib/config.ts:29, the same function uses location.origin directly without the check:

if (apiEndpoint === "__SAME__") {
    return location.origin;
}

Recommendation: Standardize this behavior. If the packages/components version is client-only (marked with "use client"), both should be consistent. If SSR is a concern, both should have the window check.

2. Code Duplication

Locations:

  • frontend/packages/components/src/lib/config.ts
  • frontend/src/components/lib/config.ts

These two files have nearly identical getApiEndpoint functions. Consider:

  • Consolidating them into a shared utility
  • Or documenting why they need to be separate

🧪 Testing Considerations

Test Coverage Needed:

  1. Verify that local development works correctly with the new VITE_APP_CLOUD_API_URL=http://localhost:43708/api setting
  2. Ensure Docker builds still work correctly with the __SAME__ endpoint resolution
  3. Confirm that the removal of VITE_APP_CLOUD_ENGINE_URL doesn't break any cloud-specific functionality

Manual Testing Checklist:

  • Local dev environment connects to correct API endpoint
  • Cloud API calls use the correct VITE_APP_CLOUD_API_URL
  • Docker build serves API from same origin when using __SAME__

🔒 Security Review

No security concerns identified

  • The Clerk publishable key (pk_test_*) is correctly a test key safe for dev environments
  • API URLs point to localhost for development, which is appropriate
  • No secrets or credentials are exposed

⚡ Performance Considerations

No performance impact

  • The removal of the __AUTO__ logic actually simplifies runtime processing
  • Direct URL usage is more efficient than string manipulation

📦 Dependencies

The pnpm-lock.yaml shows an update to the @rivet-gg/cloud package from bf2ebb2 to 1fcfb72. This appears to be from pkg.pr.new (a PR preview service).

Question: Is this dependency change intentional or should it be reverted? If intentional, what changes in the cloud package are required for this PR?


📝 Minor Suggestions

  1. Schema Validation: The VITE_APP_CLOUD_API_URL now uses .url() validation which will fail if set to __SAME__. Ensure this is the intended behavior (likely correct since cloud API should always be a full URL).

  2. Documentation: Consider adding a comment in the .env file explaining that VITE_APP_CLOUD_API_URL is for cloud-specific operations and differs from the engine API URL.


✨ Verdict

Approval Status: ✅ Approve with minor suggestions

This is a solid cleanup PR that simplifies the configuration system. The only potential concern is the dependency update to @rivet-gg/cloud - please confirm this is intentional. The minor inconsistency in window checking should be addressed for code consistency, but it's not a blocker.

Recommended Actions:

  1. Clarify the @rivet-gg/cloud dependency change
  2. Standardize the window check in both getApiEndpoint functions
  3. Test local dev environment thoroughly before merging

@NathanFlurry NathanFlurry changed the base branch from main to graphite-base/3557 December 1, 2025 05:57
@NathanFlurry NathanFlurry force-pushed the 11-30-fix_frontend_update_env_vars_for_dev branch from 91c693f to f28b5ac Compare December 1, 2025 05:57
@NathanFlurry NathanFlurry changed the base branch from graphite-base/3557 to 11-24-docs_clean_up_last_few_missing_pieces_of_content December 1, 2025 05:57
@graphite-app graphite-app bot changed the base branch from 11-24-docs_clean_up_last_few_missing_pieces_of_content to graphite-base/3557 December 1, 2025 05:59
@graphite-app graphite-app bot force-pushed the 11-30-fix_frontend_update_env_vars_for_dev branch from f28b5ac to e211bb1 Compare December 1, 2025 06:00
@graphite-app graphite-app bot force-pushed the graphite-base/3557 branch from 799cad2 to def9fd8 Compare December 1, 2025 06:00
@vercel vercel bot temporarily deployed to Preview – rivetkit-serverless December 1, 2025 06:00 Inactive
@graphite-app graphite-app bot changed the base branch from graphite-base/3557 to main December 1, 2025 06:00
@graphite-app graphite-app bot force-pushed the 11-30-fix_frontend_update_env_vars_for_dev branch from e211bb1 to 6134af8 Compare December 1, 2025 06:01
@vercel vercel bot temporarily deployed to Preview – rivetkit-serverless December 1, 2025 06:01 Inactive
@NathanFlurry NathanFlurry force-pushed the 11-30-fix_frontend_update_env_vars_for_dev branch from 6134af8 to bded0cb Compare December 2, 2025 05:18
@NathanFlurry NathanFlurry force-pushed the 11-30-fix_frontend_update_env_vars_for_dev branch from bded0cb to ee7fdbd Compare December 2, 2025 10:01
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 3, 2025

Merge activity

  • Dec 3, 8:06 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Dec 3, 8:07 AM UTC: CI is running for this pull request on a draft pull request (#3582) due to your merge queue CI optimization settings.
  • Dec 3, 8:08 AM UTC: Merged by the Graphite merge queue via draft PR: #3582.

graphite-app bot pushed a commit that referenced this pull request Dec 3, 2025
@graphite-app graphite-app bot closed this Dec 3, 2025
@graphite-app graphite-app bot deleted the 11-30-fix_frontend_update_env_vars_for_dev branch December 3, 2025 08:08
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.

2 participants