Skip to content

Commit 976e742

Browse files
committed
Initial commit
0 parents  commit 976e742

187 files changed

Lines changed: 23006 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/devcontainers/dotnet:9.0
2+
3+
# Install additional tools
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends \
6+
git \
7+
curl \
8+
wget \
9+
unzip \
10+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
11+
12+
# Install PowerShell
13+
RUN wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb \
14+
&& dpkg -i packages-microsoft-prod.deb \
15+
&& apt-get update \
16+
&& apt-get install -y powershell \
17+
&& rm packages-microsoft-prod.deb
18+
19+
# Install global .NET tools
20+
RUN dotnet tool install -g dotnet-reportgenerator-globaltool \
21+
&& dotnet tool install -g dotnet-outdated-tool
22+
23+
# Add tools to PATH
24+
ENV PATH="$PATH:/home/vscode/.dotnet/tools"
25+
26+
USER vscode

.devcontainer/README.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Development Container
2+
3+
This directory contains development container configurations for a consistent development experience.
4+
5+
## Quick Start
6+
7+
### Option 1: VS Code Dev Containers (Recommended)
8+
1. Install [VS Code](https://code.visualstudio.com/) and the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
9+
2. Clone this repository
10+
3. Open in VS Code
11+
4. Click "Reopen in Container" when prompted (or use Command Palette: "Dev Containers: Reopen in Container")
12+
13+
### Option 2: GitHub Codespaces
14+
1. Go to the repository on GitHub
15+
2. Click the green "Code" button
16+
3. Select "Codespaces" tab
17+
4. Click "Create codespace on main"
18+
19+
## Configuration Files
20+
21+
### `devcontainer.json` (Default)
22+
- **Use Case**: Standard development with full tooling
23+
- **Features**:
24+
- .NET 9 SDK
25+
- Docker-in-Docker support
26+
- GitHub CLI
27+
- PowerShell
28+
- Pre-configured VS Code extensions
29+
- Development tools (ReportGenerator, dotnet-outdated)
30+
31+
### `devcontainer-simple.json` (Alternative)
32+
- **Use Case**: Multi-container setup with Redis
33+
- **Features**:
34+
- Application container with .NET 9
35+
- Redis container for caching tests
36+
- Docker Compose orchestration
37+
- Minimal VS Code configuration
38+
39+
## What's Included
40+
41+
### Pre-installed Tools
42+
- ✅ .NET 9 SDK
43+
- ✅ Docker CLI
44+
- ✅ GitHub CLI
45+
46+
### VS Code Extensions
47+
- ✅ C# Dev Kit
48+
- ✅ EditorConfig support
49+
- ✅ Docker extension
50+
- ✅ GitHub Actions extension
51+
- ✅ Spell checker
52+
53+
### Port Forwarding
54+
- **8080**: MCP Server (main application)
55+
- **5000**: HTTP development server
56+
- **5001**: HTTPS development server
57+
- **6379**: Redis (when using docker-compose setup)
58+
59+
## Environment Variables
60+
61+
The container sets these environment variables:
62+
- `DOTNET_CLI_TELEMETRY_OPTOUT=1` - Disable .NET telemetry
63+
- `DOTNET_NOLOGO=1` - Hide .NET startup messages
64+
- `ASPNETCORE_ENVIRONMENT=Development` - Set development mode
65+
66+
## Volume Mounts
67+
68+
- **NuGet Cache**: Persistent volume for faster package restoration
69+
- **Source Code**: Workspace mounted for live editing
70+
71+
## Usage
72+
73+
### Running the Application
74+
```bash
75+
# Build and run
76+
dotnet run --project src/AzureDevOps.MCP
77+
78+
# Run with specific configuration
79+
dotnet run --project src/AzureDevOps.MCP --configuration Debug
80+
```
81+
82+
### Running Tests
83+
```bash
84+
# Run all tests
85+
dotnet test
86+
87+
# Run with detailed output
88+
dotnet test --verbosity normal
89+
90+
# Run specific test categories
91+
dotnet test --filter Category=Unit
92+
dotnet test --filter Category=Integration
93+
94+
# Test coverage is handled by CI/CD
95+
```
96+
97+
### Docker Commands
98+
```bash
99+
# Build Docker image
100+
docker build -t azuredevops-mcp .
101+
102+
# Run with docker-compose
103+
docker-compose -f docker-compose.dev.yml up
104+
```
105+
106+
## Configuration
107+
108+
### Azure DevOps Setup
109+
1. Copy `.env.example` to `.env.development`
110+
2. Update with your Azure DevOps details:
111+
```bash
112+
AZDO_ORGANIZATIONURL=https://dev.azure.com/your-organization
113+
AZDO_PERSONALACCESSTOKEN=your-pat-token
114+
```
115+
116+
### Using with GitHub Codespaces
117+
The configuration is optimized for GitHub Codespaces with:
118+
- Automatic port forwarding
119+
- Pre-built development environment
120+
- Integrated GitHub CLI for repository operations
121+
122+
## Troubleshooting
123+
124+
### Container Won't Start
125+
1. **Ensure Docker is running**
126+
- Windows: Check Docker Desktop is running
127+
- macOS: Check Docker Desktop is running
128+
- Linux: Check `docker` service is active
129+
130+
2. **Check Docker resources**
131+
- Allocate at least 4GB RAM to Docker
132+
- Ensure sufficient disk space (2GB+ free)
133+
134+
3. **Try alternative configurations**
135+
- Use `devcontainer-minimal.json` for basic setup
136+
- Use `devcontainer-simple.json` for docker-compose setup
137+
138+
4. **Rebuild container**
139+
- Command Palette: "Dev Containers: Rebuild Container"
140+
- Or: "Dev Containers: Rebuild and Reopen in Container"
141+
142+
### Common Issues
143+
144+
**Error: "Command failed"**
145+
- Try the minimal configuration first
146+
- Check Docker Desktop is not updating
147+
- Restart Docker Desktop and VS Code
148+
149+
**Permission Issues**
150+
- Ensure your user has Docker permissions
151+
- On Linux: Add user to `docker` group
152+
153+
**Slow Performance**
154+
- Increase Docker Desktop memory (8GB+ recommended)
155+
- Close other Docker containers
156+
- Use SSD storage for Docker
157+
158+
**Extension Issues**
159+
- Start with minimal extensions first
160+
- Install additional extensions after container starts
161+
- Some extensions require container restart
162+
163+
### Build Issues Resolved
164+
165+
The previous build issues with package version conflicts have been resolved:
166+
- ✅ Fixed Microsoft.CodeAnalysis package version conflicts
167+
- ✅ Corrected Sentry performance service implementation
168+
- ✅ Updated cache statistics method calls
169+
- ✅ Simplified devcontainer setup process
170+
171+
### Getting Help
172+
If devcontainers don't work for you:
173+
- Manual setup: `dotnet restore && dotnet build && dotnet test`
174+
- Create an issue with your Docker/VS Code versions
175+
- All known dependency conflicts have been resolved
176+
177+
## Customization
178+
179+
### Adding Extensions
180+
Edit `.devcontainer/devcontainer.json`:
181+
```json
182+
"extensions": [
183+
"ms-dotnettools.csharp",
184+
"your-extension-id"
185+
]
186+
```
187+
188+
### Adding Tools
189+
Edit `.devcontainer/Dockerfile` or `onCreateCommand` in `devcontainer.json`
190+
191+
### Environment Variables
192+
Add to `remoteEnv` in `devcontainer.json`:
193+
```json
194+
"remoteEnv": {
195+
"YOUR_VARIABLE": "value"
196+
}
197+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Azure DevOps MCP (Minimal)",
3+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0",
4+
5+
"customizations": {
6+
"vscode": {
7+
"extensions": [
8+
"ms-dotnettools.csharp"
9+
]
10+
}
11+
},
12+
13+
"postCreateCommand": "dotnet restore",
14+
"forwardPorts": [8080],
15+
"remoteUser": "vscode"
16+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Azure DevOps MCP (Simple)",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspaces/AzureDevOps.Mcp",
6+
7+
"customizations": {
8+
"vscode": {
9+
"settings": {
10+
"dotnet.defaultSolution": "AzureDevOps.MCP.slnx"
11+
},
12+
"extensions": [
13+
"ms-dotnettools.csharp",
14+
"ms-dotnettools.csdevkit",
15+
"editorconfig.editorconfig"
16+
]
17+
}
18+
},
19+
20+
"postCreateCommand": "dotnet restore && dotnet build",
21+
"remoteUser": "vscode"
22+
}

.devcontainer/devcontainer.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "Azure DevOps MCP",
3+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0",
4+
5+
"features": {
6+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
7+
"ghcr.io/devcontainers/features/github-cli:1": {}
8+
},
9+
10+
"customizations": {
11+
"vscode": {
12+
"settings": {
13+
"dotnet.defaultSolution": "AzureDevOps.MCP.slnx",
14+
"editor.formatOnSave": true,
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll": "explicit"
17+
}
18+
},
19+
"extensions": [
20+
"ms-dotnettools.csharp",
21+
"ms-dotnettools.csdevkit",
22+
"editorconfig.editorconfig",
23+
"ms-azuretools.vscode-docker",
24+
"github.vscode-github-actions"
25+
]
26+
}
27+
},
28+
29+
"postCreateCommand": "dotnet restore && dotnet build",
30+
31+
"forwardPorts": [8080, 5000, 5001],
32+
"portsAttributes": {
33+
"8080": {
34+
"label": "MCP Server",
35+
"onAutoForward": "notify"
36+
}
37+
},
38+
39+
"remoteEnv": {
40+
"DOTNET_CLI_TELEMETRY_OPTOUT": "1",
41+
"DOTNET_NOLOGO": "1",
42+
"ASPNETCORE_ENVIRONMENT": "Development"
43+
},
44+
45+
"remoteUser": "vscode"
46+
}

.devcontainer/docker-compose.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
volumes:
9+
- ../..:/workspaces:cached
10+
- nuget-cache:/home/vscode/.nuget:cached
11+
command: sleep infinity
12+
environment:
13+
- DOTNET_CLI_TELEMETRY_OPTOUT=1
14+
- DOTNET_NOLOGO=1
15+
- ASPNETCORE_ENVIRONMENT=Development
16+
ports:
17+
- "8080:8080"
18+
- "5000:5000"
19+
- "5001:5001"
20+
networks:
21+
- dev-network
22+
23+
redis:
24+
image: redis:7-alpine
25+
ports:
26+
- "6379:6379"
27+
command: redis-server --requirepass devpassword123!
28+
networks:
29+
- dev-network
30+
31+
volumes:
32+
nuget-cache:
33+
34+
networks:
35+
dev-network:
36+
driver: bridge

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/bin
15+
**/charts
16+
**/docker-compose*
17+
**/compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/.git
23+
**/.github
24+
LICENSE
25+
README.md

0 commit comments

Comments
 (0)