Skip to content

Commit f6b9b3d

Browse files
authored
Merge pull request #78 from gitpod-SE/main
Sync major improvements: service fixes, test coverage, and dependency updates
2 parents 85a7c7b + e42b1f1 commit f6b9b3d

File tree

19 files changed

+7674
-2369
lines changed

19 files changed

+7674
-2369
lines changed

.devcontainer/setup.sh

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -34,50 +34,4 @@ echo "🔧 Available commands:"
3434
echo " ./startup.sh - Start all services"
3535
echo " ./health-check.sh - Check service health"
3636

37-
# Setup Jira MCP server
38-
echo "🚀 Setting up Jira MCP server..."
39-
40-
# Create config directory
41-
mkdir -p ~/.config/gitpod
42-
43-
# Clone and build Jira MCP if not already present
44-
if [ ! -d "/home/node/jira-mcp" ]; then
45-
echo "📦 Cloning Jira MCP repository..."
46-
cd /home/node
47-
git clone https://github.com/MankowskiNick/jira-mcp.git
48-
cd jira-mcp
49-
echo "📦 Installing dependencies..."
50-
npm install
51-
echo "🔨 Building project..."
52-
npm run build
53-
else
54-
echo "✓ Jira MCP already installed"
55-
fi
56-
57-
# Create MCP configuration file
58-
echo "⚙️ Creating MCP configuration..."
59-
cat > ~/.config/gitpod/mcp-config.json << EOF
60-
{
61-
"mcpServers": {
62-
"jira-mcp": {
63-
"command": "node",
64-
"args": ["/home/node/jira-mcp/build/index.js"],
65-
"env": {
66-
"JIRA_HOST": "${JIRA_HOST:-coakley.atlassian.net}",
67-
"JIRA_USERNAME": "${JIRA_USERNAME:-joe@gitpod.io}",
68-
"JIRA_API_TOKEN": "${JIRA_API_TOKEN:-your_api_token_here}",
69-
"JIRA_PROJECT_KEY": "${JIRA_PROJECT_KEY:-MBA}",
70-
"AUTO_CREATE_TEST_TICKETS": "true",
71-
"JIRA_ACCEPTANCE_CRITERIA_FIELD": "customfield_10429",
72-
"JIRA_STORY_POINTS_FIELD": "customfield_10040",
73-
"JIRA_EPIC_LINK_FIELD": "customfield_10014"
74-
}
75-
}
76-
}
77-
}
78-
EOF
79-
80-
echo "✅ Jira MCP server setup complete!"
81-
echo "📍 Configuration: ~/.config/gitpod/mcp-config.json"
82-
echo "📍 Server location: /home/node/jira-mcp/"
83-
echo "🎯 Project: MBA (coakley.atlassian.net)"
37+
echo "✅ Setup completed successfully!"

.gitpod/automations.yaml

Lines changed: 100 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,4 @@
11
services:
2-
jira-mcp:
3-
name: "Jira MCP Server"
4-
description: "Model Context Protocol server for Jira integration"
5-
triggeredBy:
6-
- postDevcontainerStart
7-
- postEnvironmentStart
8-
commands:
9-
start: |
10-
echo "Setting up Jira MCP server..."
11-
12-
# Clone and build Jira MCP if not already present
13-
if [ ! -d "/home/node/jira-mcp" ]; then
14-
echo "Cloning Jira MCP repository..."
15-
cd /home/node
16-
git clone https://github.com/MankowskiNick/jira-mcp.git
17-
cd jira-mcp
18-
echo "Installing dependencies..."
19-
npm install
20-
echo "Building project..."
21-
npm run build
22-
else
23-
echo "Jira MCP already installed"
24-
fi
25-
26-
# Test MCP server connection if credentials are available
27-
if [ -n "\$JIRA_API_TOKEN" ] && [ "\$JIRA_API_TOKEN" != "your_api_token_here" ]; then
28-
echo "Testing MCP server connection..."
29-
cd /home/node/jira-mcp
30-
31-
# Test server initialization
32-
if echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {"roots": {"listChanged": true}}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}}' | timeout 10 node build/index.js >/dev/null 2>&1; then
33-
echo "MCP server connection test successful"
34-
else
35-
echo "MCP server connection test failed - check credentials"
36-
fi
37-
fi
38-
39-
echo "Jira MCP server setup complete"
40-
echo "Server location: /home/node/jira-mcp/"
41-
echo "Configuration: Uses standardized MCP config files (.mcp/config.json, mcp.json, .mcp.yaml)"
42-
echo "Project: MBA (coakley.atlassian.net)"
43-
echo "Available tools: create-ticket, get-ticket, search-tickets, update-ticket, link-tickets, get-test-steps, add-test-steps"
44-
45-
ready: |
46-
if [ -f "/home/node/jira-mcp/build/index.js" ]; then
47-
echo "Jira MCP server is ready"
48-
exit 0
49-
else
50-
echo "Jira MCP server not ready"
51-
exit 1
52-
fi
53-
54-
stop: |
55-
echo "Jira MCP server stopped (no persistent process)"
56-
572
postgres:
583
name: "PostgreSQL Database"
594
description: "PostgreSQL database for Gitpod Flix (Port: 5432)"
@@ -117,6 +62,8 @@ services:
11762
triggeredBy:
11863
- postDevcontainerStart
11964
- postEnvironmentStart
65+
dependsOn:
66+
- postgres
12067
commands:
12168
start: |
12269
cd /workspaces/gitpodflix-demo/backend/catalog
@@ -153,7 +100,9 @@ services:
153100
break
154101
fi
155102
if [ $i -eq 60 ]; then
156-
echo "Timeout waiting for PostgreSQL"
103+
echo "Timeout waiting for PostgreSQL. Checking service status..."
104+
gitpod automations service status postgres || true
105+
gitpod automations service logs postgres || true
157106
exit 1
158107
fi
159108
echo "Waiting for PostgreSQL... attempt $i/60"
@@ -182,6 +131,8 @@ services:
182131
triggeredBy:
183132
- postDevcontainerStart
184133
- postEnvironmentStart
134+
dependsOn:
135+
- catalog
185136
commands:
186137
start: |
187138
cd /workspaces/gitpodflix-demo/frontend
@@ -205,7 +156,9 @@ services:
205156
break
206157
fi
207158
if [ $i -eq 60 ]; then
208-
echo "Timeout waiting for backend API"
159+
echo "Timeout waiting for backend API. Checking service status..."
160+
gitpod automations service status catalog || true
161+
gitpod automations service logs catalog || true
209162
exit 1
210163
fi
211164
echo "Waiting for backend... attempt $i/60"
@@ -230,119 +183,15 @@ services:
230183
pkill -f "vite" || true
231184
232185
tasks:
233-
setupJiraMCP:
234-
name: "Setup Jira MCP"
235-
description: "Install and configure Jira MCP server for AI integration"
236-
triggeredBy:
237-
- manual
238-
- postEnvironmentStart
239-
command: |
240-
echo "Setting up Jira MCP server..."
241-
242-
# Create config directory
243-
mkdir -p ~/.config/gitpod
244-
245-
# Clone and build Jira MCP if not already present
246-
if [ ! -d "/home/node/jira-mcp" ]; then
247-
echo "Cloning Jira MCP repository..."
248-
cd /home/node
249-
git clone https://github.com/MankowskiNick/jira-mcp.git
250-
cd jira-mcp
251-
echo "Installing dependencies..."
252-
npm install
253-
echo "Building project..."
254-
npm run build
255-
else
256-
echo "Jira MCP already installed"
257-
fi
258-
259-
# Create MCP configuration file
260-
echo "Creating MCP configuration..."
261-
cat > ~/.config/gitpod/mcp-config.json << EOF
262-
{
263-
"mcpServers": {
264-
"jira-mcp": {
265-
"command": "node",
266-
"args": ["/home/node/jira-mcp/build/index.js"],
267-
"env": {
268-
"JIRA_HOST": "\${JIRA_HOST:-coakley.atlassian.net}",
269-
"JIRA_USERNAME": "\${JIRA_USERNAME:[email protected]}",
270-
"JIRA_API_TOKEN": "\${JIRA_API_TOKEN:-your_api_token_here}",
271-
"JIRA_PROJECT_KEY": "\${JIRA_PROJECT_KEY:-MBA}",
272-
"AUTO_CREATE_TEST_TICKETS": "true",
273-
"JIRA_ACCEPTANCE_CRITERIA_FIELD": "customfield_10429",
274-
"JIRA_STORY_POINTS_FIELD": "customfield_10040",
275-
"JIRA_EPIC_LINK_FIELD": "customfield_10014"
276-
}
277-
}
278-
}
279-
}
280-
EOF
281-
282-
# Configure generic MCP client connection
283-
echo "Configuring MCP client connection..."
284-
285-
# Create generic MCP client config
286-
MCP_CLIENT_CONFIG="$HOME/.config/mcp/client-config.json"
287-
mkdir -p "$HOME/.config/mcp"
288-
cat > "$MCP_CLIENT_CONFIG" << EOF
289-
{
290-
"mcpServers": {
291-
"jira-mcp": {
292-
"command": "node",
293-
"args": ["/home/node/jira-mcp/build/index.js"],
294-
"env": {
295-
"JIRA_HOST": "\${JIRA_HOST:-coakley.atlassian.net}",
296-
"JIRA_USERNAME": "\${JIRA_USERNAME:[email protected]}",
297-
"JIRA_API_TOKEN": "\${JIRA_API_TOKEN:-your_api_token_here}",
298-
"JIRA_PROJECT_KEY": "\${JIRA_PROJECT_KEY:-MBA}",
299-
"AUTO_CREATE_TEST_TICKETS": "true",
300-
"JIRA_ACCEPTANCE_CRITERIA_FIELD": "customfield_10429",
301-
"JIRA_STORY_POINTS_FIELD": "customfield_10040",
302-
"JIRA_EPIC_LINK_FIELD": "customfield_10014"
303-
}
304-
}
305-
}
306-
}
307-
EOF
308-
309-
# Test the MCP server if credentials are available
310-
if [ -n "\$JIRA_API_TOKEN" ] && [ "\$JIRA_API_TOKEN" != "your_api_token_here" ]; then
311-
echo "Testing MCP server connection..."
312-
cd /home/node/jira-mcp
313-
314-
# Test server initialization
315-
if echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {"roots": {"listChanged": true}}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}}' | timeout 10 node build/index.js >/dev/null 2>&1; then
316-
echo "MCP server connection test successful"
317-
else
318-
echo "MCP server connection test failed - check credentials"
319-
fi
320-
fi
321-
322-
# Create a simple verification script
323-
echo '#!/bin/bash' > /tmp/verify-mcp-connection.sh
324-
echo 'echo "Verifying MCP configuration..."' >> /tmp/verify-mcp-connection.sh
325-
echo 'echo "Server config: $([ -f ~/.config/gitpod/mcp-config.json ] && echo \"Found\" || echo \"Missing\")"' >> /tmp/verify-mcp-connection.sh
326-
echo 'echo "Generic client config: $([ -f ~/.config/mcp/client-config.json ] && echo \"Found\" || echo \"Missing\")"' >> /tmp/verify-mcp-connection.sh
327-
echo 'echo "MCP server binary: $([ -f /home/node/jira-mcp/build/index.js ] && echo \"Found\" || echo \"Missing\")"' >> /tmp/verify-mcp-connection.sh
328-
chmod +x /tmp/verify-mcp-connection.sh
329-
330-
echo "Jira MCP server and client setup complete"
331-
echo "Server config: ~/.config/gitpod/mcp-config.json"
332-
echo "Generic client config: ~/.config/mcp/client-config.json"
333-
echo "Server location: /home/node/jira-mcp/"
334-
echo "Project: MBA (coakley.atlassian.net)"
335-
echo "Available tools: create-ticket, get-ticket, search-tickets, update-ticket, link-tickets, get-test-steps, add-test-steps"
336-
echo ""
337-
echo "Run '/tmp/verify-mcp-connection.sh' to verify the setup"
338-
echo "AI assistants may need to restart to pick up the new MCP configuration"
339186

340187
seedDatabase:
341188
name: "Seed Database"
342189
description: "Seed the database with sample movies in a dramatic sequence"
343190
triggeredBy:
344191
- manual
345192
- postEnvironmentStart
193+
dependsOn:
194+
- postgres
346195
command: |
347196
cd /workspaces/gitpodflix-demo/database/main
348197
@@ -354,7 +203,9 @@ tasks:
354203
break
355204
fi
356205
if [ $i -eq 30 ]; then
357-
echo "Timeout waiting for PostgreSQL"
206+
echo "Timeout waiting for PostgreSQL. Checking service status..."
207+
gitpod automations service status postgres || true
208+
gitpod automations service logs postgres || true
358209
exit 1
359210
fi
360211
echo "Waiting for PostgreSQL... attempt $i/30"
@@ -391,12 +242,97 @@ tasks:
391242
triggeredBy:
392243
- postEnvironmentStart
393244
- manual
245+
dependsOn:
246+
- gitpod-flix
394247
command: |
248+
# Wait for services to be ready before opening ports
249+
echo "Waiting for services to be ready before opening ports..."
250+
251+
# Wait for frontend to be ready
252+
for i in {1..30}; do
253+
if gitpod automations service status gitpod-flix | grep -q "ready"; then
254+
echo "Frontend service is ready"
255+
break
256+
fi
257+
if [ $i -eq 30 ]; then
258+
echo "Warning: Frontend service not ready, opening ports anyway"
259+
break
260+
fi
261+
echo "Waiting for frontend service... attempt $i/30"
262+
sleep 2
263+
done
264+
395265
echo "Opening demo ports..."
396266
gitpod environment port open 3000 --name "Gitpod Flix"
397267
gitpod environment port open 3001 --name "Catalog Service"
398268
echo "Demo ports opened successfully!"
399269
270+
checkSystemStatus:
271+
name: "Check System Status"
272+
description: "Check the status of all services and provide troubleshooting info"
273+
triggeredBy:
274+
- manual
275+
command: |
276+
echo "=== GitpodFlix System Status Check ==="
277+
echo ""
278+
279+
echo "1. Service Status:"
280+
echo " PostgreSQL Database:"
281+
gitpod automations service status postgres || echo " ❌ Not running"
282+
echo " Catalog Service:"
283+
gitpod automations service status catalog || echo " ❌ Not running"
284+
echo " Frontend Service:"
285+
gitpod automations service status gitpod-flix || echo " ❌ Not running"
286+
echo ""
287+
288+
echo "2. Port Status:"
289+
echo " Port 5432 (PostgreSQL):"
290+
if lsof -Pi :5432 -sTCP:LISTEN > /dev/null 2>&1; then
291+
echo " ✅ Active"
292+
else
293+
echo " ❌ Not listening"
294+
fi
295+
echo " Port 3001 (Catalog API):"
296+
if lsof -Pi :3001 -sTCP:LISTEN > /dev/null 2>&1; then
297+
echo " ✅ Active"
298+
else
299+
echo " ❌ Not listening"
300+
fi
301+
echo " Port 3000 (Frontend):"
302+
if lsof -Pi :3000 -sTCP:LISTEN > /dev/null 2>&1; then
303+
echo " ✅ Active"
304+
else
305+
echo " ❌ Not listening"
306+
fi
307+
echo ""
308+
309+
echo "3. Health Checks:"
310+
echo " Database Connection:"
311+
if PGPASSWORD=gitpod psql -h localhost -U gitpod -d gitpodflix -c "SELECT 1" > /dev/null 2>&1; then
312+
echo " ✅ Connected"
313+
else
314+
echo " ❌ Cannot connect"
315+
fi
316+
echo " Catalog API Health:"
317+
if curl -s http://localhost:3001/health > /dev/null 2>&1; then
318+
echo " ✅ Healthy"
319+
else
320+
echo " ❌ Not responding"
321+
fi
322+
echo " Frontend Health:"
323+
if curl -s http://localhost:3000 > /dev/null 2>&1; then
324+
echo " ✅ Healthy"
325+
else
326+
echo " ❌ Not responding"
327+
fi
328+
echo ""
329+
330+
echo "4. Troubleshooting Commands:"
331+
echo " Restart all services: gitpod automations service restart postgres catalog gitpod-flix"
332+
echo " View service logs: gitpod automations service logs <service-name>"
333+
echo " Seed database: gitpod automations task start seedDatabase"
334+
echo " Open ports: gitpod automations task start openDemoPorts"
335+
400336
RMRF:
401337
name: "rm -rf demo"
402338
description: "⚠️ Destructive task to show the sandboxing of Gitpod environments"

0 commit comments

Comments
 (0)