mlgym-deploy 3.3.2 → 3.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +15 -7
  2. package/package.json +1 -4
package/index.js CHANGED
@@ -18,7 +18,7 @@ import crypto from 'crypto';
18
18
  const execAsync = promisify(exec);
19
19
 
20
20
  // Current version of this MCP server - INCREMENT FOR WORKFLOW FIXES
21
- const CURRENT_VERSION = '3.3.2'; // Fixed fs.existsSync bug by importing fsSync for synchronous file operations
21
+ const CURRENT_VERSION = '3.3.5'; // Fixed mlgym_deploy_logs project lookup (data.projects data) by importing fsSync for synchronous file operations
22
22
  const PACKAGE_NAME = 'mlgym-deploy';
23
23
 
24
24
  // Debug logging configuration - ENABLED BY DEFAULT
@@ -1364,6 +1364,10 @@ async function initProject(args) {
1364
1364
  console.error('⚠️ Warning: Failed to add administrator as member:', memberErr.message);
1365
1365
  }
1366
1366
 
1367
+ // Wait for GitLab project to be fully created and accessible
1368
+ console.error('Waiting for GitLab project creation to complete (20 seconds)...');
1369
+ await new Promise(resolve => setTimeout(resolve, 20000));
1370
+
1367
1371
  // Initialize local git repository if needed
1368
1372
  const absolutePath = path.resolve(local_path);
1369
1373
  try {
@@ -1402,9 +1406,9 @@ async function initProject(args) {
1402
1406
  console.error('Note: ssh-agent not available, relying on SSH config');
1403
1407
  }
1404
1408
 
1405
- // Wait for GitLab SSH key propagation (10 seconds)
1406
- console.error('Waiting for GitLab SSH key propagation (10 seconds)...');
1407
- await new Promise(resolve => setTimeout(resolve, 10000));
1409
+ // Wait for GitLab SSH key propagation (20 seconds)
1410
+ console.error('Waiting for GitLab SSH key propagation (30 seconds)...');
1411
+ await new Promise(resolve => setTimeout(resolve, 30000));
1408
1412
 
1409
1413
  // Test SSH connectivity
1410
1414
  console.error('Testing SSH connection to GitLab...');
@@ -1473,7 +1477,11 @@ async function initProject(args) {
1473
1477
  log.debug('MCP >>> [initProject] Git remote URL:', gitUrl);
1474
1478
  gitSteps.push('Pushing to GitLab to trigger deployment');
1475
1479
  console.error('Executing: git push -u mlgym main');
1476
- await execAsync('git push -u mlgym main', { cwd: absolutePath });
1480
+ const authInfo = await loadAuth();
1481
+ const sanitizedEmail = authInfo.email.replace('@', '_at_').replace(/[^a-zA-Z0-9_-]/g, '_');
1482
+ const sshKeyPath = path.join(os.homedir(), '.ssh', `mlgym_${sanitizedEmail}`);
1483
+ const gitSshCmd = `ssh -i "${sshKeyPath}"`;
1484
+ await execAsync('git push -u mlgym main', { cwd: absolutePath, env: { ...process.env, GIT_SSH_COMMAND: gitSshCmd } });
1477
1485
  gitSteps.push('✅ Successfully pushed to GitLab');
1478
1486
  pushSucceeded = true;
1479
1487
  log.success('MCP >>> [initProject] ✅ Git push completed successfully!');
@@ -1497,7 +1505,7 @@ async function initProject(args) {
1497
1505
  for (let i = 0; i < 12; i++) {
1498
1506
  await new Promise(resolve => setTimeout(resolve, 5000)); // Wait 5 seconds
1499
1507
 
1500
- const statusResult = await apiRequest('GET', `/api/v1/projects/${project.id}/deployment`, null, true);
1508
+ const statusResult = await apiRequest('GET', `/api/v1/projects/${project.id}/deployments`, null, true);
1501
1509
  if (statusResult.success && statusResult.data) {
1502
1510
  const status = statusResult.data.status;
1503
1511
  console.error(`Deployment status: ${status}`);
@@ -2231,7 +2239,7 @@ async function getDeploymentLogs(args) {
2231
2239
  throw new Error(`Failed to get projects: ${projectsResult.error}`);
2232
2240
  }
2233
2241
 
2234
- const project = projectsResult.data.projects?.find(p => p.name === projectName);
2242
+ const project = projectsResult.data?.find(p => p.name === projectName);
2235
2243
  if (!project) {
2236
2244
  throw new Error(`Project "${projectName}" not found in your account`);
2237
2245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mlgym-deploy",
3
- "version": "3.3.2",
3
+ "version": "3.3.5",
4
4
  "description": "MCP server for MLGym - Complete deployment management: deploy, configure, monitor, and rollback applications",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -83,6 +83,3 @@
83
83
  ]
84
84
  }
85
85
  }
86
-
87
-
88
-