Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jul 28, 2025

Description

  • add annotations for environment variables
  • selectively enable vercel speed insights

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 6:17pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 28, 2025 6:17pm

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 Summary

This PR makes the SimStudio application more suitable for standalone deployments by addressing two key issues. First, it adds comprehensive inline documentation to all environment variables in apps/sim/lib/env.ts, transforming an undocumented configuration file into a well-organized reference. The variables are now grouped logically (Core Database & Authentication, Payment & Billing, AI/LLM Provider API Keys, etc.) with clear descriptions of their purpose and usage. This significantly improves the developer experience when setting up the application in different environments.

Second, the PR fixes issues with Vercel-specific analytics components by making them conditional in apps/sim/app/layout.tsx. A new shouldEnableAnalytics() function checks whether the application is running in a Docker build or outside of Vercel's infrastructure (VERCEL_ENV not set) and disables the SpeedInsights and Analytics components accordingly. This prevents errors and unnecessary network requests when deploying the application in non-Vercel environments.

The changes also include a minor refactoring of the getEnv function, removing its explicit return type annotation while maintaining the same functionality, and adding a biome-ignore comment to preserve the aligned formatting structure in the environment configuration.

Confidence score: 5/5

  • This PR is very safe to merge and addresses legitimate deployment issues without breaking existing functionality.
  • The changes are well-structured documentation improvements and defensive programming practices that prevent runtime errors in different deployment environments.
  • All modified files (apps/sim/lib/env.ts and apps/sim/app/layout.tsx) contain straightforward, low-risk changes that improve maintainability and deployment flexibility.

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – docs July 28, 2025 18:06 Inactive
@waleedlatif1 waleedlatif1 merged commit abed816 into staging Jul 28, 2025
3 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/standalone branch July 28, 2025 18:11
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…tions for envvars (simstudioai#808)

* add annotations for environment variables

* selectively enable vercel speed insights

* use DOCKER_BUILD flag to selectively disable vercel speed insights and analytics

* lint

* additional info

---------

Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
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