siesa-agents 2.1.72-qa.21 → 2.1.72-qa.23

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.
@@ -29,8 +29,8 @@ output_folder: "{project-root}/_bmad-output"
29
29
  # ============================================================
30
30
  agiletest:
31
31
  jira_base_url: "https://siesa-team.atlassian.net"
32
- jira_project_key: "CON"
33
- jira_user_email: "jmreinam@siesa.com"
32
+ jira_project_key: "" # tu project key (ej: CON, COM, MAN) — o pásalo con --project-key
33
+ jira_user_email: "" # tu correo de Jira — configúralo aquí, en config.secrets.yaml o env var JIRA_EMAIL
34
34
  agiletest_base_url: "https://jira.agiletest.app"
35
35
  agiletest_project_id: "10016" # ID del proyecto en AgileTest (específico de instancia)
36
36
  issue_type_task: "10013" # Tarea / Requirement
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "name": "siesa-agents",
3
- "version": "2.1.72-qa.21",
4
- "description": "Paquete para instalar y configurar agentes SIESA en tu proyecto",
5
- "main": "index.js",
6
- "bin": {
7
- "siesa-agents": "./bin/install.js"
8
- },
9
- "scripts": {
10
- "postinstall": "node ./bin/install.js",
11
- "build": "echo 'Build complete'"
12
- },
13
- "keywords": [
14
- "siesa",
15
- "bmad",
16
- "agents",
17
- "automation",
18
- "cli"
19
- ],
20
- "author": "Sistemas de Información Empresarial",
21
- "license": "MIT",
22
- "files": [
23
- "bmad/**/*",
24
- "siesa-agents/**/*",
25
- "vscode/**/*",
26
- "github/**/*",
27
- "claude/**/*",
28
- "gemini/**/*",
29
- "kiro/**/*",
30
- "bin/**/*",
31
- "resources/**/*",
32
- "README.md",
33
- "mcp.json"
34
- ],
35
- "engines": {
36
- "node": ">=14.0.0"
37
- },
38
- "dependencies": {
39
- "fs-extra": "^11.1.1",
40
- "path": "^0.12.7"
41
- }
42
- }
1
+ {
2
+ "name": "siesa-agents",
3
+ "version": "2.1.72-qa.23",
4
+ "description": "Paquete para instalar y configurar agentes SIESA en tu proyecto",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "siesa-agents": "./bin/install.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node ./bin/install.js",
11
+ "build": "echo 'Build complete'"
12
+ },
13
+ "keywords": [
14
+ "siesa",
15
+ "bmad",
16
+ "agents",
17
+ "automation",
18
+ "cli"
19
+ ],
20
+ "author": "Sistemas de Información Empresarial",
21
+ "license": "MIT",
22
+ "files": [
23
+ "bmad/**/*",
24
+ "siesa-agents/**/*",
25
+ "vscode/**/*",
26
+ "github/**/*",
27
+ "claude/**/*",
28
+ "gemini/**/*",
29
+ "kiro/**/*",
30
+ "bin/**/*",
31
+ "resources/**/*",
32
+ "README.md",
33
+ "mcp.json"
34
+ ],
35
+ "engines": {
36
+ "node": ">=14.0.0"
37
+ },
38
+ "dependencies": {
39
+ "fs-extra": "^11.1.1",
40
+ "path": "^0.12.7"
41
+ }
42
+ }
@@ -1512,17 +1512,26 @@ Parsear la respuesta y almacenar en `jira_base_url` y/o `jira_project_key` segú
1512
1512
  Antes de ejecutar el dry-run, verificar que las credenciales están disponibles.
1513
1513
  El script las busca en este orden de prioridad:
1514
1514
  1. `_siesa-agents/bmm/config.secrets.yaml` (archivo local gitignoreado — forma recomendada)
1515
- 2. Variables de entorno `JIRA_API_TOKEN`, `AGILETEST_CLIENT_ID`, `AGILETEST_CLIENT_SECRET`
1515
+ 2. Variables de entorno `JIRA_EMAIL`, `JIRA_API_TOKEN`, `AGILETEST_CLIENT_ID`, `AGILETEST_CLIENT_SECRET`
1516
1516
 
1517
- **Leer `_siesa-agents/bmm/config.secrets.yaml` y verificar que los tokens no estén vacíos:**
1517
+ > ⚠️ El correo (`jira_user_email`) ya **no** trae un valor por defecto: es obligatorio.
1518
+ > Cada usuario debe configurar el suyo en `config.secrets.yaml`, en `_bmad/bmm/config.yaml`
1519
+ > o en la env var `JIRA_EMAIL`. No reutilices el correo de otra persona.
1520
+
1521
+ **Leer `_siesa-agents/bmm/config.secrets.yaml` y verificar que los valores no estén vacíos:**
1518
1522
 
1519
1523
  ```
1520
1524
  📋 Estado de credenciales en _siesa-agents/bmm/config.secrets.yaml:
1525
+ jira_user_email: [configurado ✅ | vacío ⚠️]
1521
1526
  jira_api_token: [configurado ✅ | vacío ⚠️]
1522
1527
  agiletest_client_id: [configurado ✅ | vacío ⚠️]
1523
1528
  agiletest_client_secret: [configurado ✅ | vacío ⚠️]
1524
1529
  ```
1525
1530
 
1531
+ > Si `jira_user_email` no está en `config.secrets.yaml`, búscalo también en
1532
+ > `_bmad/bmm/config.yaml` (`agiletest.jira_user_email`) o en la env var `JIRA_EMAIL`
1533
+ > antes de marcarlo como vacío.
1534
+
1526
1535
  **Si todos están configurados:** continuar a F5.3.
1527
1536
 
1528
1537
  **Si alguno está vacío**, mostrar instrucciones y DETENER:
@@ -1533,11 +1542,13 @@ El script las busca en este orden de prioridad:
1533
1542
  Abre el archivo y completa los valores:
1534
1543
 
1535
1544
  agiletest:
1545
+ jira_user_email: "tu-correo@empresa.com"
1536
1546
  jira_api_token: "tu-token-aqui"
1537
1547
  agiletest_client_id: "tu-client-id"
1538
1548
  agiletest_client_secret: "tu-client-secret"
1539
1549
 
1540
1550
  Dónde obtenerlos:
1551
+ • jira_user_email: tu correo de la cuenta de Jira/Atlassian
1541
1552
  • jira_api_token: Jira → Profile → Security → API tokens → Create
1542
1553
  • agiletest_client_id/secret: AgileTest plugin en Jira → Settings → API Keys
1543
1554
 
@@ -1561,21 +1572,32 @@ Y continuar a F5.3.
1561
1572
 
1562
1573
  ```bash
1563
1574
  python -c "
1564
- import urllib.request, base64, json, re, sys
1565
-
1566
- secrets_path = '{project-root}/_siesa-agents/bmm/config.secrets.yaml'
1567
- with open(secrets_path, encoding='utf-8') as f:
1568
- content = f.read()
1575
+ import urllib.request, base64, json, re, sys, os
1569
1576
 
1570
1577
  def extract(key, text):
1571
1578
  m = re.search(rf'^\s+{key}:\s*[\"\'"]?(.+?)[\"\'"]?\s*$', text, re.MULTILINE)
1572
1579
  return m.group(1).strip().strip('\"').strip(\"'\") if m else ''
1573
1580
 
1574
- email = extract('jira_user_email', content)
1575
- token = extract('jira_api_token', content)
1581
+ def read(path):
1582
+ try:
1583
+ with open(path, encoding='utf-8') as f:
1584
+ return f.read()
1585
+ except FileNotFoundError:
1586
+ return ''
1587
+
1588
+ secrets = read('{project-root}/_siesa-agents/bmm/config.secrets.yaml')
1589
+ public = read('{project-root}/_bmad/bmm/config.yaml')
1590
+
1591
+ # El correo ya no tiene default: se resuelve secrets -> config.yaml -> env JIRA_EMAIL.
1592
+ email = extract('jira_user_email', secrets) or extract('jira_user_email', public) or os.environ.get('JIRA_EMAIL', '')
1593
+ token = extract('jira_api_token', secrets) or os.environ.get('JIRA_API_TOKEN', '')
1576
1594
  base = '{jira_base_url}'
1577
1595
  key = '{jira_project_key}'
1578
1596
 
1597
+ if not email or not token:
1598
+ print('ERROR: falta jira_user_email o jira_api_token. Configúralos en config.secrets.yaml, _bmad/bmm/config.yaml o las env vars JIRA_EMAIL / JIRA_API_TOKEN.', file=sys.stderr)
1599
+ sys.exit(1)
1600
+
1579
1601
  creds = base64.b64encode(f'{email}:{token}'.encode()).decode()
1580
1602
  req = urllib.request.Request(
1581
1603
  f'{base}/rest/api/3/project/{key}',
@@ -6,6 +6,8 @@
6
6
  "test": "npx playwright test",
7
7
  "test:headed": "npx playwright test --headed",
8
8
  "test:seed": "npx playwright test tests/seed-example.spec.ts --headed",
9
+ "rec:test": "set RECORD=1&& npx playwright test --headed",
10
+ "rec:test:seed": "set RECORD=1&& npx playwright test tests/seed-example.spec.ts --headed",
9
11
  "recorder": "npx playwright test tools/locator-recorder.spec.ts --headed --timeout 3600000",
10
12
  "test:proposed": "npx playwright test proposed/ --config playwright.config.ts",
11
13
  "report": "npx playwright show-report",
@@ -4,12 +4,39 @@
4
4
  */
5
5
  import { defineConfig } from '@playwright/test';
6
6
  import { config as dotenvConfig } from 'dotenv';
7
+ import { execSync } from 'child_process';
7
8
 
8
9
  dotenvConfig(); // carga .env personal del QA (gitignored); usa defaults si no existe
9
10
 
11
+ // RECORD=1 → graba video a pantalla completa en carpeta con timestamp (no sobreescribe corridas previas).
12
+ const record = process.env.RECORD === '1';
13
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
14
+
15
+ /**
16
+ * Detecta el tamano real del viewport del browser maximizado.
17
+ * Usa PowerShell para obtener el WorkingArea (pantalla - taskbar)
18
+ * y resta ~95px del chrome del browser (title bar + tabs + address bar).
19
+ * Fallback: 1366x633 (laptop estandar corporativa / runners sin display).
20
+ */
21
+ function detectVideoSize(): { width: number; height: number } {
22
+ try {
23
+ const raw = execSync(
24
+ 'powershell -command "Add-Type -AssemblyName System.Windows.Forms; $s = [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea; Write-Output ($s.Width.ToString() + \'x\' + $s.Height.ToString())"',
25
+ { encoding: 'utf-8', timeout: 5000 },
26
+ ).trim();
27
+ const [w, h] = raw.split('x').map(Number);
28
+ if (w > 0 && h > 0) {
29
+ return { width: w, height: h - 95 };
30
+ }
31
+ } catch { /* fallback */ }
32
+ return { width: 1366, height: 633 };
33
+ }
34
+
10
35
  export default defineConfig({
11
36
  globalSetup: './global-setup.ts',
12
37
  testDir: '.',
38
+ // Con RECORD, aisla cada corrida en su propia carpeta para preservar videos previos.
39
+ outputDir: record ? `./test-results/rec-${timestamp}` : './test-results',
13
40
  timeout: 120_000,
14
41
  expect: { timeout: 10_000 },
15
42
  fullyParallel: false,
@@ -43,7 +70,8 @@ export default defineConfig({
43
70
  screenshot: process.env.CI ? 'only-on-failure' : 'on',
44
71
  // En CI, trace solo en el primer reintento (archivos más pequeños que retain-on-failure).
45
72
  trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure',
46
- video: process.env.CI ? 'off' : 'on',
73
+ // RECORD=1 → video a pantalla completa (tamano detectado). Si no, comportamiento por defecto del kit.
74
+ video: record ? { mode: 'on', size: detectVideoSize() } : (process.env.CI ? 'off' : 'on'),
47
75
  },
48
76
  projects: [
49
77
  {
@@ -67,8 +67,8 @@ CONFIG = {
67
67
 
68
68
  # Jira
69
69
  'jira_base_url': 'https://siesa-team.atlassian.net',
70
- 'jira_project_key': 'CON',
71
- 'jira_user_email': 'jmreinam@siesa.com',
70
+ 'jira_project_key': '', # viene de config.yaml o --project-key (sin default)
71
+ 'jira_user_email': os.environ.get('JIRA_EMAIL', ''), # viene de config.secrets.yaml o env JIRA_EMAIL (sin default)
72
72
  'jira_api_token': os.environ.get('JIRA_API_TOKEN', ''),
73
73
 
74
74
  # Issue types en Jira (IDs de la instancia SIESA)
@@ -1427,6 +1427,7 @@ def load_bmm_config(config_path: str):
1427
1427
 
1428
1428
  # Capa 3: variables de entorno (prioridad más alta — siempre sobreescriben)
1429
1429
  for env_var, config_key in [
1430
+ ('JIRA_EMAIL', 'jira_user_email'),
1430
1431
  ('JIRA_API_TOKEN', 'jira_api_token'),
1431
1432
  ('AGILETEST_CLIENT_ID', 'agiletest_client_id'),
1432
1433
  ('AGILETEST_CLIENT_SECRET', 'agiletest_client_secret'),
@@ -1569,7 +1570,16 @@ Ejemplos:
1569
1570
  safe_print(f' Se usará la instancia por defecto: {CONFIG["jira_base_url"]} (proyecto {CONFIG["jira_project_key"]}).')
1570
1571
  safe_print(' Si NO es tu instancia, cancela y re-ejecuta con --jira-url/--project-key o --config.')
1571
1572
 
1573
+ # El project key no tiene default: sin él los issues se crearían en el proyecto equivocado.
1574
+ if not CONFIG.get('jira_project_key'):
1575
+ print('\n ERROR: Falta el project key de Jira.')
1576
+ print(' Especifícalo con --project-key (ej: CON, COM, MAN)')
1577
+ print(' o en config.yaml -> agiletest.jira_project_key')
1578
+ sys.exit(1)
1579
+
1572
1580
  missing = []
1581
+ if not CONFIG.get('jira_user_email'):
1582
+ missing.append('jira_user_email (env: JIRA_EMAIL)')
1573
1583
  if not CONFIG.get('jira_api_token'):
1574
1584
  missing.append('jira_api_token (env: JIRA_API_TOKEN)')
1575
1585
  if not CONFIG.get('agiletest_client_id'):