-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: handle environment.json file in cn serve #7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 2 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="extensions/cli/src/commands/serve.ts">
<violation number="1" location="extensions/cli/src/commands/serve.ts:61">
Blocks server startup via synchronous execSync; consider deferring until after the server starts or running asynchronously to avoid long startup delays.</violation>
<violation number="2" location="extensions/cli/src/commands/serve.ts:61">
Automatically executes an install command from .continue/environment.json on startup, enabling arbitrary command execution without user confirmation. Gate behind an explicit flag/confirmation or restrict allowed commands.</violation>
<violation number="3" location="extensions/cli/src/commands/serve.ts:63">
Rule violated: **Don't use console.log**
Replace console.error with logger.error per logging guideline.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
extensions/cli/src/commands/serve.ts
Outdated
|
|
||
| // Run environment install script if available | ||
| try { | ||
| await runEnvironmentInstall(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocks server startup via synchronous execSync; consider deferring until after the server starts or running asynchronously to avoid long startup delays.
Prompt for AI agents
Address the following comment on extensions/cli/src/commands/serve.ts at line 61:
<comment>Blocks server startup via synchronous execSync; consider deferring until after the server starts or running asynchronously to avoid long startup delays.</comment>
<file context>
@@ -55,6 +56,16 @@ export async function serve(prompt?: string, options: ServeOptions = {}) {
+ // Run environment install script if available
+ try {
+ await runEnvironmentInstall();
+ } catch (error) {
+ console.error(
</file context>
✅ Addressed in 012585a
extensions/cli/src/commands/serve.ts
Outdated
|
|
||
| // Run environment install script if available | ||
| try { | ||
| await runEnvironmentInstall(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically executes an install command from .continue/environment.json on startup, enabling arbitrary command execution without user confirmation. Gate behind an explicit flag/confirmation or restrict allowed commands.
Prompt for AI agents
Address the following comment on extensions/cli/src/commands/serve.ts at line 61:
<comment>Automatically executes an install command from .continue/environment.json on startup, enabling arbitrary command execution without user confirmation. Gate behind an explicit flag/confirmation or restrict allowed commands.</comment>
<file context>
@@ -55,6 +56,16 @@ export async function serve(prompt?: string, options: ServeOptions = {}) {
+ // Run environment install script if available
+ try {
+ await runEnvironmentInstall();
+ } catch (error) {
+ console.error(
</file context>
extensions/cli/src/commands/serve.ts
Outdated
| try { | ||
| await runEnvironmentInstall(); | ||
| } catch (error) { | ||
| console.error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule violated: Don't use console.log
Replace console.error with logger.error per logging guideline.
Prompt for AI agents
Address the following comment on extensions/cli/src/commands/serve.ts at line 63:
<comment>Replace console.error with logger.error per logging guideline.</comment>
<file context>
@@ -55,6 +56,16 @@ export async function serve(prompt?: string, options: ServeOptions = {}) {
+ try {
+ await runEnvironmentInstall();
+ } catch (error) {
+ console.error(
+ chalk.red("Failed to run environment install script:"),
+ formatError(error),
</file context>
✅ Addressed in 012585a
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.22.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.21.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
this was shortest path to set up the husky pre-commit hook in background
Summary by cubic
Adds support for .continue/environment.json in cn serve. If the file defines an install command, it runs before the server starts to auto-setup the local environment (e.g., Husky hooks).