Skip to content

Conversation

Oksamies
Copy link
Contributor

@Oksamies Oksamies commented Sep 30, 2025

Summary by CodeRabbit

  • Chores
    • Updated environment-based domain allowlisting: development builds now accept temporary preview domains, while production builds accept official service domains. A new runtime flag controls which set is used, ensuring correct access behavior per environment without changing app features.

Copy link

coderabbitai bot commented Sep 30, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The Vite configuration in apps/cyberstorm-remix/vite.config.ts was converted from a static object to a function-based export via defineConfig(({ mode }) => { ... }). This enables mode-aware server.allowedHosts: development uses [".thunderstore.temp"], while other modes use [".thunderstore.dev", ".thunderstore.io"]. Existing plugins (reactRouter, tsconfigPaths, withSentry), build, HMR, watch, and assetsDir settings were relocated inside the returned object without altering their semantics. The exported signature now returns the config based on the provided mode.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request contains no author-provided description, leaving reviewers without any contextual summary or rationale for the changes beyond the title. Please add a brief description that outlines the motivation for dynamically resolving allowedHosts, summarizes the key implementation changes, and any relevant testing or usage instructions.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Dynamically resolve allowedHosts for local dev envs” clearly and concisely describes the primary change of the pull request, focusing on adjusting the allowedHosts configuration based on the development environment without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59e39b7 and 798c676.

📒 Files selected for processing (1)
  • apps/cyberstorm-remix/vite.config.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Visual diff
apps/cyberstorm-remix/vite.config.ts

[error] 13-13: TypeError: Cannot read properties of undefined (reading 'DEV') while loading Vite config during 'yarn workspace @thunderstore/cyberstorm-remix build'.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: CodeQL

@Oksamies Oksamies force-pushed the 09-30-dynamically_resolve_allowedhosts_for_local_dev_envs branch from 798c676 to b66981a Compare September 30, 2025 11:05
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/cyberstorm-remix/.env (1)

7-7: Document the expected value format for VITE_DEVELOPMENT.

The empty value here combined with the check Object.hasOwn(env, "VITE_DEVELOPMENT") && env.VITE_DEVELOPMENT in vite.config.ts means developers must set a truthy value (e.g., VITE_DEVELOPMENT=true or VITE_DEVELOPMENT=1) to enable local dev mode. An empty string will evaluate as falsy.

Consider adding an inline comment to clarify the expected value:

-VITE_DEVELOPMENT=
+VITE_DEVELOPMENT= # Set to 'true' or '1' for local development
apps/cyberstorm-remix/vite.config.ts (1)

16-19: Consider explicit boolean value checking for clarity.

The current check relies on JavaScript truthiness, where any non-empty string will enable development mode. For more predictable behavior, consider explicitly checking for specific values:

     allowedHosts:
-      Object.hasOwn(env, "VITE_DEVELOPMENT") && env.VITE_DEVELOPMENT
+      env.VITE_DEVELOPMENT === "true" || env.VITE_DEVELOPMENT === "1"
         ? [".thunderstore.temp"]
         : [".thunderstore.dev", ".thunderstore.io"],

This makes the expected values explicit and prevents unintended activation from typos like VITE_DEVELOPMENT=false (which would be truthy as a non-empty string).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 798c676 and b66981a.

📒 Files selected for processing (2)
  • apps/cyberstorm-remix/.env (1 hunks)
  • apps/cyberstorm-remix/vite.config.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test
  • GitHub Check: Generate visual diffs
  • GitHub Check: CodeQL
🔇 Additional comments (1)
apps/cyberstorm-remix/vite.config.ts (1)

5-7: Environment loading is correct. There is only a single .env file in apps/cyberstorm-remix, so loadEnv("", process.cwd(), "VITE_") already covers it. If you introduce mode-specific files later (e.g. .env.development), switch to the defineConfig(({ mode }) => { const env = loadEnv(mode, …); … }) form to load them.

@Oksamies Oksamies force-pushed the 09-30-dynamically_resolve_allowedhosts_for_local_dev_envs branch from b66981a to 3bbacc2 Compare September 30, 2025 16:42
@Oksamies Oksamies changed the base branch from master to graphite-base/1557 October 2, 2025 22:44
@Oksamies Oksamies force-pushed the 09-30-dynamically_resolve_allowedhosts_for_local_dev_envs branch from 3bbacc2 to 2b91be9 Compare October 2, 2025 22:44
@Oksamies Oksamies changed the base branch from graphite-base/1557 to tests-and-coverage October 2, 2025 22:44
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 10.69%. Comparing base (a8426a5) to head (15c1c7c).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1557   +/-   ##
=======================================
  Coverage   10.69%   10.69%           
=======================================
  Files         285      285           
  Lines       19876    19876           
  Branches      385      385           
=======================================
  Hits         2126     2126           
  Misses      17750    17750           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oksamies Oksamies force-pushed the 09-30-dynamically_resolve_allowedhosts_for_local_dev_envs branch from 2b91be9 to f3a2fdd Compare October 2, 2025 22:57
@Oksamies Oksamies force-pushed the tests-and-coverage branch from 9e4bbd9 to 4458b9f Compare October 2, 2025 22:57
We want to enforce the usage of thunderstore.temp local dev domain, to ensure consistency in everyday debugging and development.
@Oksamies Oksamies requested a review from anttimaki October 2, 2025 23:09
@Oksamies Oksamies force-pushed the 09-30-dynamically_resolve_allowedhosts_for_local_dev_envs branch from f3a2fdd to 15c1c7c Compare October 2, 2025 23:29
@Oksamies Oksamies force-pushed the tests-and-coverage branch from 4458b9f to a8426a5 Compare October 2, 2025 23:29
Copy link
Contributor

@anttimaki anttimaki left a comment

Choose a reason for hiding this comment

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

Nice, clean solution 👍🏻

Base automatically changed from tests-and-coverage to master October 3, 2025 13:00
@Oksamies Oksamies merged commit d0c6c73 into master Oct 3, 2025
41 checks passed
@Oksamies Oksamies deleted the 09-30-dynamically_resolve_allowedhosts_for_local_dev_envs branch October 3, 2025 13:01
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