Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 56 additions & 25 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ CodeUI is a comprehensive web-based AI CLI tools management application built wi
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

## Repository Status
This repository is currently upgraded to .NET 9.0 with proper Aspire 9.4 orchestration and comprehensive testing infrastructure:
- .NET 9.0 with C# 13 language support
- Aspire Hosting for distributed application orchestration
This repository is currently upgraded to .NET 9.0 with proper Aspire orchestration and comprehensive testing infrastructure:
- .NET 9.0 with C# 13 language support (latest features)
- Aspire Hosting 9.4.1 for distributed application orchestration
- Blazor Server-side web application
- Central Package Management for unified dependency management
- Modern .slnx solution format (XML-based)
- Comprehensive test coverage with unit and integration tests
- Automated CI/CD pipeline with GitHub Actions

The project provides a web application for managing AI CLI tools with features including terminal emulation, file management, git integration, and session management.

## Prerequisites and Environment Setup
**⚠️ Important: You must install .NET 9 before you start!**

- .NET 9.0 SDK is required and validated to work
- C# 13 language features supported (latest with .NET 9)
- Aspire workload for distributed application development
Expand All @@ -22,9 +26,12 @@ The project provides a web application for managing AI CLI tools with features i
## Working Effectively

### Project Structure
The solution follows a clean architecture pattern:
The solution follows a clean architecture pattern with modern .NET 9 features:
```
CodeUI/
├── CodeUI.slnx # Modern XML-based solution file (.NET 9+)
├── Directory.Packages.props # Central Package Management configuration
├── global.json # .NET 9 SDK enforcement
├── CodeUI.AppHost/ # Aspire application host for orchestration
├── CodeUI.Web/ # Blazor Server application
├── CodeUI.Core/ # Core business logic and data models
Expand All @@ -35,12 +42,24 @@ CodeUI/
```

### Building and Testing
- `dotnet restore` - Restore NuGet packages
- `dotnet build` - Build the solution. TIMING: Takes 5-10 seconds. Set timeout to 180+ seconds.
- `dotnet test` - Run all tests. TIMING: Takes 1-5 seconds for unit tests. Set timeout to 300+ seconds for integration tests.
- `dotnet restore CodeUI.slnx` - Restore NuGet packages using .slnx solution
- `dotnet build CodeUI.slnx` - Build the solution. TIMING: Takes 5-10 seconds. Set timeout to 180+ seconds.
- `dotnet test CodeUI.slnx` - Run all tests. TIMING: Takes 1-5 seconds for unit tests. Set timeout to 300+ seconds for integration tests.
- `dotnet run --project CodeUI.AppHost` - Run the Aspire orchestrated application
- `dotnet build --configuration Release` - Build release version
- `dotnet test --configuration Release --collect:"XPlat Code Coverage"` - Run tests with coverage
- `dotnet build CodeUI.slnx --configuration Release` - Build release version
- `dotnet test CodeUI.slnx --configuration Release --collect:"XPlat Code Coverage"` - Run tests with coverage

### Central Package Management
The solution uses .NET's Central Package Management feature:
- **Directory.Packages.props**: Centrally manages all NuGet package versions
- Individual project files reference packages without version attributes
- Ensures consistent package versions across all projects
- Simplifies dependency management and security updates

### Solution Format (.slnx)
- Uses modern .slnx XML-based solution format supported by .NET 9
- Simpler and more maintainable than legacy .sln format
- Better tooling support and version control friendly

### Aspire Application Development
The application uses .NET Aspire for orchestration:
Expand Down Expand Up @@ -81,30 +100,34 @@ var response = await httpClient.GetAsync("/");
- Test coverage is collected automatically and reported via Codecov

### Package Management
All packages are upgraded to .NET 9.0 compatible versions:
- `Aspire.Hosting` 9.4.0 - For application orchestration
- `Microsoft.AspNetCore.*` 8.0.11 - For web application framework
- `Microsoft.EntityFrameworkCore.*` 8.0.11 - For data access
All packages are upgraded to .NET 9.0 compatible versions with Central Package Management:
- `Aspire.Hosting` 9.4.1 - Latest Aspire for application orchestration
- `Aspire.Hosting.Testing` 9.4.1 - For Aspire integration testing
- `Microsoft.AspNetCore.*` 9.0.8 - Latest web application framework
- `Microsoft.EntityFrameworkCore.*` 9.0.8 - Latest data access framework
- `Microsoft.Orleans.*` 9.2.1 - Latest distributed state management
- Package versions centrally managed in `Directory.Packages.props`
- `Microsoft.Orleans.*` 9.2.0 - For distributed state management

## CI/CD Pipeline

### Build and Test Workflow
- Builds solution with .NET 8.0
- Builds solution with .NET 9.0 using CodeUI.slnx
- Runs unit and integration tests
- Collects test coverage with coverlet
- Creates deployable artifacts for Windows, Linux, and macOS
- Uses modern .slnx solution format throughout

### Aspire Integration Tests
- Uses proper Aspire testing framework (not dashboard)
- Tests distributed application functionality
- Tests distributed application functionality with Aspire 9.4.1
- Validates HTTP endpoints and application behavior

## Development Workflow

### Adding New Features
1. Create feature branch from main
2. Add/modify code using .NET 8.0 and C# 12 patterns
2. Add/modify code using .NET 9.0 and C# 13 patterns
3. Write corresponding unit tests in CodeUI.Tests
4. Add integration tests in CodeUI.AspireTests if needed
5. Build and test locally with full coverage
Expand All @@ -117,12 +140,13 @@ All packages are upgraded to .NET 9.0 compatible versions:
- **Coverage**: Aim for comprehensive coverage with both unit and integration tests

### Key Technologies and Packages
- **.NET 8.0 with C# 12** - Modern framework with latest language features
- **Aspire Hosting** - Distributed application orchestration
- **.NET 9.0 with C# 13** - Latest framework with newest language features
- **Aspire Hosting 9.4.1** - Latest distributed application orchestration
- **Blazor Server** - Interactive web UI with server-side rendering
- **Orleans** - Distributed session and state management
- **Entity Framework Core** - Data access and identity management
- **xUnit** - Unit and integration testing framework
- **Central Package Management** - Unified dependency management

## Timing Expectations and Timeouts

Expand All @@ -142,9 +166,9 @@ All packages are upgraded to .NET 9.0 compatible versions:
### Common Issues and Solutions

**Build Failures**:
- Ensure .NET 8.0 SDK is installed
- Run `dotnet restore --force` to refresh packages
- Check for package version conflicts
- Ensure .NET 9.0 SDK is installed
- Run `dotnet restore CodeUI.slnx --force` to refresh packages
- Check for package version conflicts in Directory.Packages.props

**Test Failures**:
- Unit tests failing: Check WebApplicationFactory configuration
Expand All @@ -159,9 +183,9 @@ All packages are upgraded to .NET 9.0 compatible versions:
### Validation Commands
```bash
# Quick validation sequence
dotnet restore
dotnet build --configuration Release
dotnet test --configuration Release --collect:"XPlat Code Coverage"
dotnet restore CodeUI.slnx
dotnet build CodeUI.slnx --configuration Release
dotnet test CodeUI.slnx --configuration Release --collect:"XPlat Code Coverage"
dotnet format --verify-no-changes

# Run specific test projects
Expand All @@ -175,6 +199,7 @@ dotnet test CodeUI.AspireTests --configuration Release
- Follow clean architecture principles
- Separate concerns between Web, Core, and Orleans projects
- Use proper dependency injection and service registration
- Leverage Central Package Management for dependency consistency

### Testing Strategy
- Write unit tests for business logic in Core project
Expand All @@ -188,4 +213,10 @@ dotnet test CodeUI.AspireTests --configuration Release
- Leverage Aspire testing framework for integration tests
- Monitor application health and performance through Aspire dashboard (development only)

This repository is production-ready with comprehensive testing, modern .NET 8.0 features, and proper distributed application orchestration using Aspire.
### Modern .NET 9 Features
- Use C# 13 language features for cleaner code
- Leverage Central Package Management for consistency
- Use .slnx solution format for better tooling support
- Take advantage of .NET 9 performance improvements

This repository is production-ready with comprehensive testing, modern .NET 9.0 features, Central Package Management, and proper distributed application orchestration using latest Aspire.
4 changes: 2 additions & 2 deletions .github/workflows/aspire-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore
run: dotnet restore CodeUI.slnx

- name: Build solution
run: dotnet build --configuration Release --no-restore
run: dotnet build CodeUI.slnx --configuration Release --no-restore

- name: Run Aspire integration tests
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore
run: dotnet restore CodeUI.slnx

- name: Build solution
run: dotnet build --configuration Release --no-restore
run: dotnet build CodeUI.slnx --configuration Release --no-restore

- name: Run tests with coverage
run: |
dotnet test --configuration Release --no-build --verbosity normal \
dotnet test CodeUI.slnx --configuration Release --no-build --verbosity normal \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage \
--logger trx \
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ DocProject/Help/html
# Click-Once directory
publish/

# Self-contained deployment outputs
**/publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
Expand Down
6 changes: 3 additions & 3 deletions CodeUI.AppHost/CodeUI.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting" Version="8.2.2" />
<PackageReference Include="Aspire.Hosting" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 10 additions & 8 deletions CodeUI.AspireTests/CodeUI.AspireTests.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />
<PackageReference Include="Aspire.Hosting.Testing" />
<PackageReference Include="coverlet.collector" />
<PackageReference Include="coverlet.msbuild" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CodeUI.AppHost\CodeUI.AppHost.csproj" />
<ProjectReference Include="..\CodeUI.Web\CodeUI.Web.csproj" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions CodeUI.AspireTests/WebApplicationTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Net;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;
// TODO: Consider migrating to Aspire.Hosting.Testing for distributed application testing
// Example: using Aspire.Hosting.Testing;

namespace CodeUI.AspireTests;

Expand Down
8 changes: 4 additions & 4 deletions CodeUI.Core/CodeUI.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
<PackageReference Include="Microsoft.EntityFrameworkCore" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions CodeUI.Orleans/CodeUI.Orleans.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" />
</ItemGroup>

</Project>
16 changes: 8 additions & 8 deletions CodeUI.Tests/CodeUI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />
<PackageReference Include="coverlet.collector" />
<PackageReference Include="coverlet.msbuild" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 13 additions & 6 deletions CodeUI.Web/CodeUI.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<!-- Self-contained deployment configuration (only for publishing) -->
<PropertyGroup Condition="'$(PublishSingleFile)' == 'true'">
<SelfContained>true</SelfContained>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<PublishTrimmed>false</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.11" />
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading