-
-
Notifications
You must be signed in to change notification settings - Fork 4
🚀 Week 1 Foundation: Environment Schema & Types Package #33
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
🚀 Week 1 Foundation: Environment Schema & Types Package #33
Conversation
- Add Environment model with cloud configuration - Add EnvironmentStatus enum (creating/running/stopped/error) - Add Template model for base images - Add ResourceUsage model for future metrics - Create seed script with Node.js, Python, and Go templates - Update User model to include environments relation Implements Week 1 Day 3 from MVP roadmap
- Add TypeScript types for environments, templates, and resources - Add Zod validation schemas for create/update operations - Add constants for hardware presets and base images - Add status labels, colors, and resource limits - Include comprehensive documentation Implements Week 1 Day 4 from MVP roadmap
- Add MVP roadmap with 4-week implementation plan - Add comprehensive agent documentation - Move AGENT.md to agent/README.md - Include setup guides and architecture docs
- Update pnpm-lock.yaml to include environment-types package dependencies - Upgrade zod from ^3.22.4 to ^4.1.1 for latest features - Change EnvironmentStatus enum to uppercase (matching Prisma schema) - Update STATUS_LABELS and STATUS_COLORS to use uppercase keys This fixes the CI failure: ERR_PNPM_OUTDATED_LOCKFILE
WalkthroughAdds comprehensive documentation and agent architecture docs; introduces a new workspace package Changes
Sequence Diagram(s)sequenceDiagram
participant FE as Frontend (Next.js)
participant API as API / Backend (Go/TS)
participant DB as Postgres (Prisma)
participant Azure as Azure (ACI & Blob/Files)
FE->>API: POST /environments (CreateEnvironmentRequest)
API->>DB: create environment record (status: CREATING)
DB-->>API: environment id & record
API->>Azure: provision ACI container + mount Blob/Files (async)
Azure-->>API: provisioning result / endpoints (vsCodeUrl, ips)
API->>DB: update environment (STARTING -> RUNNING, persistence fields)
DB-->>FE: GET /environments returns environment list/status
Note right of API: polling & timeouts use constants from @repo/environment-types
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
Add eslint.config.mjs to fix linting CI failure in environment-types package
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.
Actionable comments posted: 8
🧹 Nitpick comments (8)
apps/web/prisma/seed.ts (1)
9-34: Hardcoded Azure Container Registry URLs create tight coupling.Lines 14, 22, and 30 contain hardcoded registry URLs (
dev8mvpregistry.azurecr.io). This creates several issues:
- Cannot easily use different registries for dev/staging/prod environments
- Makes testing with alternative registries difficult
- Registry name changes require code updates
Consider using environment variables for the registry URL:
+const REGISTRY_URL = process.env.AZURE_CONTAINER_REGISTRY || 'dev8mvpregistry.azurecr.io'; + async function main() { console.log('🌱 Starting database seed...'); // Seed templates const templates = [ { name: 'node', displayName: 'Node.js', description: 'JavaScript and TypeScript development with Node.js LTS, npm, and common tools', - baseImage: 'dev8mvpregistry.azurecr.io/vscode-node:latest', + baseImage: `${REGISTRY_URL}/vscode-node:latest`, defaultCPU: 2, defaultMemory: 4, }, // ... apply same pattern to python and golang templatesAlternatively, move the registry URL to the constants package for centralized configuration.
packages/environment-types/package.json (1)
21-21: Consider upgrading TypeScript to 5.5+.Zod 4.x recommends TypeScript >= 5.5 for optimal type inference and strict mode compatibility. The current version (5.3.3) may work but could miss improvements in type performance and error reporting.
Based on learnings.
Apply this diff to upgrade:
- "typescript": "^5.3.3" + "typescript": "^5.5.0"apps/web/prisma/schema.prisma (2)
95-129: Consider adding explicit relations and validation constraints.The Environment model is well-structured, but a few enhancements would improve data integrity and clarity:
Missing relation to Template: The
baseImagefield (line 117) stores a string but there's no foreign key to the Template model. Consider adding atemplateIdfield with a relation to enforce referential integrity.Azure-specific fields lack validation: Fields like
aciContainerGroupId,aciPublicIp,azureFileShareName(lines 104-108) are Azure-specific but the schema allows anycloudProvider. Consider adding validation or documentation to clarify when these fields are populated.Resource limits not enforced: The CPU/memory/storage fields (lines 112-114) have defaults but no min/max constraints at the database level.
Option 1: Add Template relation (recommended for referential integrity):
// Template baseImage String @default("node") + templateId String? + template Template? @relation(fields: [templateId], references: [id])Option 2: Add check constraints for resources (if using PostgreSQL 12.13+):
Note: Prisma supports check constraints via raw SQL in migrations. Document expected ranges in comments if not adding constraints.
// Resources - cpuCores Int @default(2) - memoryGB Int @default(4) - storageGB Int @default(20) + cpuCores Int @default(2) // Min: 1, Max: 8 + memoryGB Int @default(4) // Min: 2, Max: 32 + storageGB Int @default(20) // Min: 10, Max: 500
131-144: Add missing relation from Template to Environment.The Template model is defined but has no relation back to environments that use it. If environments reference templates (see
baseImagefield in Environment), adding a relation would enable queries like "show all environments using this template."createdAt DateTime @default(now()) updatedAt DateTime @updatedAt + environments Environment[] @@map("templates")Note: Only add this if you plan to query environments by template. If
baseImageremains a simple string field, this relation isn't necessary.DOCUMENTATION_COMPLETE.md (1)
6-19: Add language specifier to fenced code block.The fenced code block lacks a language identifier, which improves syntax highlighting and readability.
Apply this diff:
-``` +```text agent/ ├── README.md # Main navigationAs per static analysis hints.
packages/environment-types/src/constants.ts (3)
28-32: Avoid:latesttag and consider parameterizing registry URL.Hard-coding the registry URL and using
:latesttags introduces risks:
:latestis non-deterministic and complicates rollback/debugging.- The registry name
dev8mvpregistry.azurecr.iomay need to vary by environment (dev/staging/prod).Consider:
- Parameterize the registry URL via environment variable or build-time configuration.
- Replace
:latestwith immutable tags (e.g., semantic versions or commit SHAs) for reproducibility.Example refactor (pseudo-code):
const REGISTRY_URL = process.env.AZURE_REGISTRY_URL || 'dev8mvpregistry.azurecr.io'; const IMAGE_TAG = process.env.IMAGE_TAG || 'v1.0.0'; export const BASE_IMAGES = { node: `${REGISTRY_URL}/vscode-node:${IMAGE_TAG}`, python: `${REGISTRY_URL}/vscode-python:${IMAGE_TAG}`, golang: `${REGISTRY_URL}/vscode-go:${IMAGE_TAG}`, } as const;This ensures traceability and environment flexibility.
46-50: Keep version numbers in sync with actual Docker images.Hardcoded version strings (Python 3.11, Go 1.21, Node.js LTS) in descriptions may drift from the actual images.
Consider:
- Documenting the version mapping in a single source of truth (e.g., a
VERSIONSconstant or in the Dockerfile comments).- Updating these descriptions when base images are updated to avoid user confusion.
81-84: Consider making default region configurable.The default region is hard-coded to
eastus. For deployments in other regions or multi-tenant scenarios, consider parameterizing this via environment variables.Example:
export const DEFAULT_CLOUD_CONFIG = { provider: 'azure' as const, region: process.env.DEFAULT_AZURE_REGION || 'eastus', };This allows flexibility without code changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
DOCUMENTATION_COMPLETE.md(1 hunks)agent/README.md(1 hunks)agent/architecture/README.md(1 hunks)agent/architecture/SYSTEM_ARCHITECTURE.md(1 hunks)agent/architecture/TECHNICAL_DECISIONS.md(1 hunks)agent/roadmaps/ANALYSIS_SUMMARY.md(1 hunks)agent/roadmaps/MVP_ROADMAP.md(1 hunks)apps/web/package.json(2 hunks)apps/web/prisma/schema.prisma(2 hunks)apps/web/prisma/seed.ts(1 hunks)packages/environment-types/README.md(1 hunks)packages/environment-types/package.json(1 hunks)packages/environment-types/src/constants.ts(1 hunks)packages/environment-types/src/index.ts(1 hunks)packages/environment-types/src/schemas.ts(1 hunks)packages/environment-types/src/types.ts(1 hunks)packages/environment-types/tsconfig.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
packages/environment-types/src/schemas.ts (1)
packages/environment-types/src/index.ts (5)
createEnvironmentSchema(23-23)updateEnvironmentSchema(24-24)environmentIdSchema(25-25)CreateEnvironmentInput(29-29)UpdateEnvironmentInput(30-30)
packages/environment-types/src/types.ts (1)
packages/environment-types/src/index.ts (10)
CloudProvider(9-9)EnvironmentStatus(10-10)BaseImage(11-11)HardwareConfig(12-12)Environment(13-13)Template(14-14)ResourceUsage(15-15)CreateEnvironmentRequest(16-16)UpdateEnvironmentRequest(17-17)EnvironmentActionResponse(18-18)
apps/web/prisma/seed.ts (1)
apps/web/lib/prisma.ts (1)
prisma(5-5)
packages/environment-types/src/constants.ts (2)
packages/environment-types/src/index.ts (14)
HARDWARE_PRESETS(35-35)HardwareConfig(12-12)BASE_IMAGES(36-36)BASE_IMAGE_LABELS(37-37)BASE_IMAGE_DESCRIPTIONS(38-38)STATUS_LABELS(39-39)STATUS_COLORS(40-40)DEFAULT_CLOUD_CONFIG(41-41)AZURE_REGIONS(42-42)POLLING_INTERVALS(43-43)TIMEOUTS(44-44)VSCODE_PORT(45-45)RESOURCE_LIMITS(46-46)MAX_ENVIRONMENTS_PER_USER(47-47)packages/environment-types/src/types.ts (1)
HardwareConfig(26-30)
🪛 markdownlint-cli2 (0.18.1)
DOCUMENTATION_COMPLETE.md
6-6: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
366-366: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
agent/roadmaps/ANALYSIS_SUMMARY.md
23-23: Bare URL used
(MD034, no-bare-urls)
38-38: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
43-43: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
50-50: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
56-56: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
219-219: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
agent/architecture/SYSTEM_ARCHITECTURE.md
103-103: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
153-153: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
162-162: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
206-206: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
223-223: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
246-246: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
255-255: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
287-287: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
294-294: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
301-301: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
307-307: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
308-308: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
444-444: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
516-516: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
522-522: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
528-528: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
536-536: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
580-580: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
624-624: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
631-631: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
638-638: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
647-647: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
agent/roadmaps/MVP_ROADMAP.md
43-43: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
411-411: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
434-434: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
495-495: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
536-536: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
612-612: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
645-645: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
668-668: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
690-690: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
710-710: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1440-1440: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
1448-1448: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
1506-1506: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🔇 Additional comments (25)
packages/environment-types/tsconfig.json (1)
1-9: LGTM! Standard TypeScript configuration for shared package.The TypeScript configuration is clean and follows monorepo best practices:
- Extends the base config appropriately
- Sets correct output and source directories
- Includes/excludes are properly configured
agent/architecture/TECHNICAL_DECISIONS.md (4)
1-13: LGTM! Well-structured ADR documentation.The ADR format and overview are clear and follow industry-standard patterns. The format is comprehensive and will serve as a good foundation for tracking architectural decisions.
321-375: LGTM! PostgreSQL with Prisma choice is well-justified.The decision to use PostgreSQL with Prisma ORM is sound and aligns with the actual dependencies in package.json (Prisma 6.14.0). The trade-offs are accurately presented.
600-667: LGTM! Comprehensive decision tracking and forward planning.The decision matrix and future decisions sections provide excellent visibility into the architecture roadmap. The reversibility assessment is particularly valuable for planning.
127-147: Go 1.24 is valid and matches your go.mod: Go 1.24 was officially released on February 11 2025 (go.dev), and yourapps/agent/go.modcorrectly declaresgo 1.24. No change needed here.Likely an incorrect or invalid review comment.
packages/environment-types/src/types.ts (2)
1-21: LGTM! Clean type definitions for cloud provider, status, and base images.The union types are well-defined and properly documented. These align with the Prisma schema's enum types mentioned in the PR summary.
70-109: LGTM! Request and response types are well-structured.The remaining interfaces follow good patterns:
- ResourceUsage appropriately uses optional fields for metrics
- CreateEnvironmentRequest correctly uses the
BaseImageunion type- UpdateEnvironmentRequest properly defines partial updates
- EnvironmentActionResponse follows a standard API response pattern
apps/web/package.json (3)
17-22: LGTM! Database seeding workflow properly configured.The new
db:seedscript and Prisma seed configuration are correctly set up:
- Uses
tsxto run TypeScript seed file- Prisma configuration points to the correct seed path
- Follows Prisma best practices for seeding
26-26: LGTM! Workspace dependency correctly added.The
@repo/environment-typesworkspace dependency enables type sharing across the monorepo, aligning with the PR's goal of introducing shared types.
47-47: LGTM! tsx added for TypeScript execution.The
tsxdev dependency is necessary for running the TypeScript seed script and follows modern practices for executing TypeScript in Node.js environments.apps/web/prisma/seed.ts (2)
1-7: LGTM! Proper seed script setup.Creating a new
PrismaClientinstance in the seed script is the correct pattern. Seed scripts run independently and should manage their own database connections.
36-57: LGTM! Robust seed implementation with proper error handling.The seed script follows best practices:
- Uses
upsertfor idempotency (safe to run multiple times)- Proper error handling with descriptive messages
- Ensures database connection cleanup in
finallyblock- Clear console logging for debugging
agent/architecture/README.md (1)
1-50: LGTM! Clean documentation structure.The architecture documentation index provides clear navigation and status indicators for the system architecture and technical decisions documents.
apps/web/prisma/schema.prisma (2)
24-24: LGTM! User relation to environments added correctly.The one-to-many relation from User to Environment is properly defined, supporting the environment ownership model.
85-93: LGTM! Environment status enum covers the lifecycle.The status values (CREATING, STARTING, RUNNING, STOPPING, STOPPED, ERROR, DELETING) appropriately represent all phases of environment lifecycle management.
packages/environment-types/README.md (1)
1-116: LGTM! Comprehensive package documentation.The README provides clear usage examples, API reference, and development instructions. The Zod validation examples follow best practices (using
safeParsefor error handling), and the constant usage examples demonstrate the package's value for shared configuration.agent/README.md (1)
1-50: LGTM! Clear agent documentation structure.The README provides good navigation for agent development, with clear pointers to roadmaps, guides, and GitHub issues. The structure supports future expansion as the agent component evolves.
agent/roadmaps/ANALYSIS_SUMMARY.md (1)
1-220: LGTM! Well-structured analysis and planning document.This analysis summary provides excellent context for the MVP roadmap and issue organization. The structure is clear, actionable, and aligns well with the technical implementation introduced in this PR.
Note: Static analysis flagged minor markdown style issues (bare URL at line 23, emphasis used instead of headings at lines 38, 43, 50, 56, 219). These are cosmetic and don't impact the document's usefulness, but you may optionally address them for consistency with markdown best practices.
agent/architecture/SYSTEM_ARCHITECTURE.md (1)
1-709: LGTM! Comprehensive architecture documentation.This architecture document provides excellent reference material covering all major aspects of the system design, from high-level component architecture to security, data flow, and scalability considerations. The mermaid diagrams and code examples enhance clarity.
Note: Static analysis flagged several fenced code blocks without language specifiers and some emphasis-as-heading usage. While these are minor markdown style issues, adding language specifiers (e.g.,
prisma,typescript,text) would improve syntax highlighting and readability.agent/roadmaps/MVP_ROADMAP.md (1)
1-1507: LGTM! Detailed and actionable MVP roadmap.This roadmap provides an excellent 4-week implementation plan with clear milestones, tasks, deliverables, and acceptance criteria. The day-by-day breakdown makes it easy to track progress and the code examples show expected implementation patterns.
Note: Static analysis flagged minor markdown formatting issues (missing language specifiers, emphasis as headings, table spacing). These are cosmetic but adding language identifiers to code blocks would improve readability.
packages/environment-types/src/schemas.ts (3)
35-54: Confirm intentional exclusion ofstorageGBandbaseImagefrom update schema.The
updateEnvironmentSchemaallows updatingname,cpuCores, andmemoryGB, but excludesstorageGBandbaseImage. This suggests:
- Storage resizing is not supported (or requires separate operation)
- Base image changes are not supported (would require container recreation)
If this is intentional and documented elsewhere, this is fine. Otherwise, please confirm:
- Should storage resizing be supported via updates?
- Should the schema include a comment explaining why these fields are excluded?
Consider adding a JSDoc comment to clarify the design decision:
/** * Schema for updating an environment + * + * Note: storageGB and baseImage cannot be updated after creation + * as they require container recreation. Use delete + create instead. */ export const updateEnvironmentSchema = z.object({
6-30: LGTM! Well-structured validation schemas with clear constraints.The
createEnvironmentSchemaprovides comprehensive validation with:
- Sensible string constraints for the name (1-50 chars, alphanumeric pattern)
- Clear enum validation for base images with custom error message
- Appropriate resource limits for CPU (1-8), memory (2-16GB), and storage (20-200GB)
- Helpful error messages for each constraint
59-59: Clarify updateEnvironmentSchema omissions
updateEnvironmentSchema only allows optionalname,cpuCores, andmemoryGB—storageGBandbaseImageare excluded. Confirm if this is intentional.packages/environment-types/src/index.ts (1)
1-49: LGTM! Clean and well-organized package exports.This index file provides a clear public API surface for the
@repo/environment-typespackage:
- Type exports are grouped logically (lines 8-19)
- Schema exports separate runtime values from types (lines 22-31)
- Constants are comprehensively listed (lines 34-48)
- JSDoc header clearly documents the package purpose
The barrel export pattern makes it easy for consumers to import what they need while maintaining a clean module structure.
packages/environment-types/src/constants.ts (1)
119-126: Verify Azure Container Instances vCPU Limit
Confirm via the official Azure documentation or your subscription quotas whether a single ACI container in your target region supports 8 vCPUs. AdjustMAX_CPU_CORESif it exceeds the supported limit.
| { | ||
| "name": "@repo/environment-types", | ||
| "version": "0.0.1", | ||
| "main": "./src/index.ts", | ||
| "types": "./src/index.ts", | ||
| "dependencies": { | ||
| "zod": "^3.22.4" | ||
| } | ||
| } |
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.
🧩 Analysis chain
Verify Zod version in package.json.
The roadmap specifies Zod ^3.22.4 (line 255), but according to the retrieved learnings, Zod v4.x is the current stable version (v4.1.1 as of 2025). The Zod v4 migration included breaking changes in error handling and several new validators.
Please verify the actual Zod version in packages/environment-types/package.json and ensure it aligns with the project's requirements. If using Zod v3, consider updating to v4 for better performance and type inference, or document why v3 is preferred.
🏁 Script executed:
#!/bin/bash
# Check the actual Zod version used in the environment-types package
cat packages/environment-types/package.json | jq '.dependencies.zod'Length of output: 8
Update Zod version in roadmap to ^4.1.1
The roadmap (agent/roadmaps/MVP_ROADMAP.md, line 255) lists Zod ^3.22.4, but packages/environment-types/package.json uses ^4.1.1. Please update the roadmap to reflect v4.1.1.
🤖 Prompt for AI Agents
In agent/roadmaps/MVP_ROADMAP.md around lines 249 to 257, the roadmap lists zod
dependency as ^3.22.4 but the actual package at
packages/environment-types/package.json uses ^4.1.1; update the JSON snippet in
the roadmap so the "zod" dependency version matches ^4.1.1 to keep documentation
consistent with the codebase.
- Update documentation dates to September 30, 2025 - Clarify NextAuth version (v4.24.11, not v5) - Update Zod version in roadmap (^3.22.4 -> ^4.1.1) - Add CloudProvider enum to Prisma schema - Add ResourceUsage relation to Environment model - Configure Next.js transpilePackages for workspace deps - Use BaseImage type instead of string for type safety - Update architecture references to Azure ACI - Update Python and Go versions in descriptions
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
agent/AGENT.md(4 hunks)agent/README.md(1 hunks)agent/architecture/README.md(1 hunks)agent/architecture/TECHNICAL_DECISIONS.md(1 hunks)agent/roadmaps/MVP_ROADMAP.md(1 hunks)apps/web/next.config.js(1 hunks)apps/web/prisma/schema.prisma(2 hunks)packages/environment-types/src/constants.ts(1 hunks)packages/environment-types/src/types.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- agent/architecture/README.md
- packages/environment-types/src/constants.ts
🧰 Additional context used
🧬 Code graph analysis (2)
apps/web/next.config.js (1)
apps/docs/next.config.js (1)
nextConfig(2-2)
packages/environment-types/src/types.ts (1)
packages/environment-types/src/index.ts (10)
CloudProvider(9-9)EnvironmentStatus(10-10)BaseImage(11-11)HardwareConfig(12-12)Environment(13-13)Template(14-14)ResourceUsage(15-15)CreateEnvironmentRequest(16-16)UpdateEnvironmentRequest(17-17)EnvironmentActionResponse(18-18)
🪛 markdownlint-cli2 (0.18.1)
agent/AGENT.md
86-86: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
agent/README.md
7-7: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
agent/roadmaps/MVP_ROADMAP.md
43-43: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
411-411: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
434-434: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
495-495: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
536-536: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
612-612: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
652-652: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
675-675: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
697-697: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
717-717: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1447-1447: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
1455-1455: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
1513-1513: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
⏰ 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: typescript
| * Hardware preset configurations | ||
| */ | ||
| export const HARDWARE_PRESETS: Record<'small' | 'medium' | 'large', HardwareConfig> = { | ||
| small: { |
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.
update hardware preset according to github codespace
you can go beyond that what azure aci permits
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.
also add a another parameter similar to available to all kind of you neam is better as per code
| * Note: Update these with your actual registry URL | ||
| */ | ||
| export const BASE_IMAGES = { | ||
| node: 'dev8mvpregistry.azurecr.io/vscode-node:latest', |
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.
this is static images create a issue regarding creation of images and upload
VAIBHAVSING
left a comment
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.
over all LGTM
please address this comment
- Change CloudProvider type to uppercase (AZURE/AWS/GCP) to match Prisma enum - Fix Dockerfile ENV command to properly set default password - Align TypeScript types with Prisma schema for consistency
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
agent/roadmaps/MVP_ROADMAP.md(1 hunks)packages/environment-types/src/types.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/environment-types/src/types.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
agent/roadmaps/MVP_ROADMAP.md
43-43: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
411-411: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
434-434: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
495-495: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
536-536: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
612-612: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
652-652: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
675-675: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
697-697: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
717-717: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
1447-1447: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
1455-1455: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
1513-1513: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
⏰ 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: typescript
| export type EnvironmentStatus = | ||
| | 'creating' | ||
| | 'starting' | ||
| | 'running' | ||
| | 'stopping' | ||
| | 'stopped' | ||
| | 'error' | ||
| | 'deleting'; | ||
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.
Align environment status casing across layers.
The roadmap defines the TypeScript EnvironmentStatus union and UI logic with lowercase strings, but both the Prisma schema and the API example persist/return uppercase enum values (CREATING, STARTING, …). Following this plan would either break type safety (TS won’t accept 'CREATING') or force the frontend to handle unexpected values (statusColor['CREATING'] is undefined, so badges/buttons never render as intended). Please pick one casing convention and update all snippets accordingly—either switch the TypeScript/Zod examples to uppercase to match Prisma, or document a normalization step (e.g., lowercasing the Prisma enum output) before sharing data with the UI.
Also applies to: 825-838, 899-938
🤖 Prompt for AI Agents
In agent/roadmaps/MVP_ROADMAP.md around lines 262-270 (and also apply the same
change at 825-838 and 899-938), the EnvironmentStatus casing is inconsistent
between the TypeScript/Zod/UI examples (lowercase) and the Prisma/API examples
(UPPERCASE); pick one convention and make all examples consistent. Fix by either
(A) converting the TypeScript union, Zod schemas, and UI/statusColor keys to
UPPERCASE to match the Prisma enum and update all API examples to return
UPPERCASE strings, or (B) convert the Prisma/API examples in the doc to
lowercase and add a short note showing how to normalize Prisma output to
lowercase before sending to the UI; ensure every snippet (type, schema, API
response, and UI mapping) uses the same casing so types and badge rendering
align.
📋 Overview
This PR implements the foundational components from Week 1 (Days 3-4) of the MVP roadmap:
🎯 What's Included
1. Database Schema Extension (Day 3)
Environmentmodel with full cloud configurationEnvironmentStatusenum (creating/starting/running/stopping/stopped/error/deleting)Templatemodel for base images (Node.js, Python, Go)ResourceUsagemodel for future monitoringUsermodel with environments relation2. Environment Types Package (Day 4)
@repo/environment-typesshared package3. Documentation
📊 Changes Summary
Key Files:
apps/web/prisma/schema.prisma- Database schema with Environment modelsapps/web/prisma/seed.ts- Template seed datapackages/environment-types/- New shared types packageagent/roadmaps/MVP_ROADMAP.md- Detailed 4-week implementation plan🏗️ Architecture
Database Schema
Types Package Structure
🧪 Testing
To test the schema changes:
To use the types package:
📝 Roadmap Progress
🔗 Related Issues
Implements:
📖 Documentation
All new features are fully documented:
🎉 Next Steps
After this PR is merged:
Implements: Week 1 Foundation from MVP Roadmap
Roadmap Location:
agent/roadmaps/MVP_ROADMAP.mdSummary by CodeRabbit
No direct user-facing behavior changes in this release.