Skip to content

Conversation

@exKAZUu
Copy link
Member

@exKAZUu exKAZUu commented Dec 8, 2025

Close #

Self Check

  • I've confirmed All checks have passed on this page.
    • PR title follows Angular's commit message format.
    • PR title doesn't have WIP:.
    • The test command (e.g., yarn test) passed.
    • The lint command (e.g., yarn lint) passed.
    • You may leave this box unchecked due to long workflows.
  • I've reviewed my changes on the GitHub diff view.
  • I've written the steps to test my changes.
  • I've added screenshots (if the UI changed).
    • You may leave this box unchecked if you didn't modify the UI.

Copilot AI review requested due to automatic review settings December 8, 2025 04:00
@gemini-code-assist
Copy link

Summary of Changes

Hello @exKAZUu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the testStart script might cause Blitz.js to operate in an unintended 'production' mode. By explicitly setting the NODE_ENV environment variable to an empty string, the change ensures that the testing environment behaves predictably, avoiding potential misconfigurations or performance optimizations that are not suitable for testing.

Highlights

  • Environment Variable Control: The testStart script now explicitly sets the NODE_ENV environment variable to an empty string before execution.
  • Blitz.js Compatibility: This change prevents Blitz.js from inadvertently running in 'production' mode during testing, ensuring a consistent and expected test environment.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

このプルリクエストは、testStartコマンドにNODE_ENV=""を追加することで、テスト開始時の問題を修正するものです。コメントによると、これはBlitz.jsが本番モードで起動するのを防ぐためのようです。変更はBaseScriptsという基底クラスに行われており、Blitz.js以外のフレームワークにも影響を与える可能性があります。この点が意図したものでない場合、意図しない副作用を避けるために、変更をBlitz.js専用のスクリプトファイルに限定することを提案しました。

Comment on lines 87 to 88
// Use empty NODE_ENV to avoid "production" mode in Blitz.js.
return `NODE_ENV="" YARN concurrently --kill-others --raw --success first "${this.startDevProtected(project, argv)}" "${this.waitApp(project)}"`;

Choose a reason for hiding this comment

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

medium

この変更は基底クラスであるBaseScriptsに行われていますが、コメントではBlitz.jsに特化した理由が述べられています。もしこのNODE_ENVの設定がBlitz.jsでのみ必要な場合、他のフレームワーク(Next.js, Remixなど)への意図しない影響を避けるため、testStartメソッドをblitzScripts.ts内でオーバーライドする方が適切かもしれません。

もしこの変更がすべてのフレームワークにとって安全かつ有益である場合は、その旨をコメントに反映させることをご検討ください。例えば、「NODE_ENVが未設定の場合に一部のフレームワーク(Blitz.jsなど)が本番モードで起動するのを防ぐため」のように一般化するなどです。

提案 (もしBlitz.js専用の場合):

packages/wb/src/scripts/execution/blitzScripts.ts に以下のように追加します:

// (ファイルの先頭に以下を追加)
// import { checkAndKillPortProcess } from '../../utils/port.js';

// class BlitzScripts 内に以下を追加
override async testStart(project: Project, argv: ScriptArgv): Promise<string> {
  await checkAndKillPortProcess(project.env.PORT, project);
  // Use empty NODE_ENV to avoid "production" mode in Blitz.js.
  return `NODE_ENV=\"\" YARN concurrently --kill-others --raw --success first \"${this.startDevProtected(project, argv)}\" \"${this.waitApp(project)}\"`;
}

そして packages/wb/src/scripts/execution/baseScripts.ts の変更を元に戻します。

References
  1. レビューは日本語で行う必要があります。 (link)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the testStart method in the BaseScripts class by adding NODE_ENV="" to prevent Blitz.js from running in production mode during test execution. The change ensures that when tests are run, the development server starts in development mode rather than production mode, which is the intended behavior for testing.

Key Changes:

  • Added NODE_ENV="" environment variable prefix to the testStart command
  • Added a comment explaining the purpose of the change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 87 to 88
// Use empty NODE_ENV to avoid "production" mode in Blitz.js.
return `NODE_ENV="" YARN concurrently --kill-others --raw --success first "${this.startDevProtected(project, argv)}" "${this.waitApp(project)}"`;
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using NODE_ENV="development" instead of NODE_ENV="". An empty string might cause unexpected behavior in frameworks that explicitly check for values like "development", "production", or "test". Setting it to "development" would be more explicit and align better with the intent of running in development mode for testing purposes.

Suggested change
// Use empty NODE_ENV to avoid "production" mode in Blitz.js.
return `NODE_ENV="" YARN concurrently --kill-others --raw --success first "${this.startDevProtected(project, argv)}" "${this.waitApp(project)}"`;
// Use NODE_ENV="development" to avoid "production" mode in Blitz.js.
return `NODE_ENV="development" YARN concurrently --kill-others --raw --success first "${this.startDevProtected(project, argv)}" "${this.waitApp(project)}"`;

Copilot uses AI. Check for mistakes.
@exKAZUu exKAZUu enabled auto-merge (squash) December 8, 2025 04:08
@exKAZUu exKAZUu merged commit 3ea2b40 into main Dec 8, 2025
7 checks passed
@exKAZUu exKAZUu deleted the wb branch December 8, 2025 04:11
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