Skip to content

Commit da93158

Browse files
authored
Revert "Sync major improvements: service fixes, test coverage, and dependency updates"
1 parent f6b9b3d commit da93158

File tree

19 files changed

+2378
-7683
lines changed

19 files changed

+2378
-7683
lines changed

.devcontainer/setup.sh

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

37-
echo "✅ Setup completed successfully!"
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)"

.gitpod/automations.yaml

Lines changed: 164 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,59 @@
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+
257
postgres:
358
name: "PostgreSQL Database"
459
description: "PostgreSQL database for Gitpod Flix (Port: 5432)"
@@ -62,8 +117,6 @@ services:
62117
triggeredBy:
63118
- postDevcontainerStart
64119
- postEnvironmentStart
65-
dependsOn:
66-
- postgres
67120
commands:
68121
start: |
69122
cd /workspaces/gitpodflix-demo/backend/catalog
@@ -100,9 +153,7 @@ services:
100153
break
101154
fi
102155
if [ $i -eq 60 ]; then
103-
echo "Timeout waiting for PostgreSQL. Checking service status..."
104-
gitpod automations service status postgres || true
105-
gitpod automations service logs postgres || true
156+
echo "Timeout waiting for PostgreSQL"
106157
exit 1
107158
fi
108159
echo "Waiting for PostgreSQL... attempt $i/60"
@@ -131,8 +182,6 @@ services:
131182
triggeredBy:
132183
- postDevcontainerStart
133184
- postEnvironmentStart
134-
dependsOn:
135-
- catalog
136185
commands:
137186
start: |
138187
cd /workspaces/gitpodflix-demo/frontend
@@ -156,9 +205,7 @@ services:
156205
break
157206
fi
158207
if [ $i -eq 60 ]; then
159-
echo "Timeout waiting for backend API. Checking service status..."
160-
gitpod automations service status catalog || true
161-
gitpod automations service logs catalog || true
208+
echo "Timeout waiting for backend API"
162209
exit 1
163210
fi
164211
echo "Waiting for backend... attempt $i/60"
@@ -183,15 +230,119 @@ services:
183230
pkill -f "vite" || true
184231
185232
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"
186339
187340
seedDatabase:
188341
name: "Seed Database"
189342
description: "Seed the database with sample movies in a dramatic sequence"
190343
triggeredBy:
191344
- manual
192345
- postEnvironmentStart
193-
dependsOn:
194-
- postgres
195346
command: |
196347
cd /workspaces/gitpodflix-demo/database/main
197348
@@ -203,9 +354,7 @@ tasks:
203354
break
204355
fi
205356
if [ $i -eq 30 ]; then
206-
echo "Timeout waiting for PostgreSQL. Checking service status..."
207-
gitpod automations service status postgres || true
208-
gitpod automations service logs postgres || true
357+
echo "Timeout waiting for PostgreSQL"
209358
exit 1
210359
fi
211360
echo "Waiting for PostgreSQL... attempt $i/30"
@@ -242,97 +391,12 @@ tasks:
242391
triggeredBy:
243392
- postEnvironmentStart
244393
- manual
245-
dependsOn:
246-
- gitpod-flix
247394
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-
265395
echo "Opening demo ports..."
266396
gitpod environment port open 3000 --name "Gitpod Flix"
267397
gitpod environment port open 3001 --name "Catalog Service"
268398
echo "Demo ports opened successfully!"
269399
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-
336400
RMRF:
337401
name: "rm -rf demo"
338402
description: "⚠️ Destructive task to show the sandboxing of Gitpod environments"

0 commit comments

Comments
 (0)