create-agentic-pdlc 3.1.0 → 3.1.1
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.
- package/bin/cli.js +47 -8
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -75,7 +75,11 @@ const i18n = {
|
|
|
75
75
|
update_sentinel_ask: t(" Activate? CodeRabbit applies 'architecture-violation' label when violations are detected. (Y/n): ", " Ativar? CodeRabbit aplica a label 'architecture-violation' quando detecta violações. (S/n): ", " ¿Activar? CodeRabbit aplica la etiqueta 'architecture-violation' cuando detecta violaciones. (S/n): "),
|
|
76
76
|
configuring_protection: t('[3/3] Configuring branch protection...', '[3/3] Configurando proteção de branch...', '[3/3] Configurando protección de rama...'),
|
|
77
77
|
protection_ok: t('✅ Branch protection set — required checks: PDLC Stage Gate, QA Gate.', '✅ Proteção de branch configurada — checks obrigatórios: PDLC Stage Gate, QA Gate.', '✅ Protección de rama configurada — checks requeridos: PDLC Stage Gate, QA Gate.'),
|
|
78
|
-
protection_warn: t(
|
|
78
|
+
protection_warn: t(
|
|
79
|
+
'⚠️ Branch protection requires admin access — could not be set automatically.\n\n What it does: prevents PRs from merging unless these CI checks pass:\n • "PDLC Stage Gate" — blocks merge if the linked issue lacks spec:approved\n • "QA Gate" — blocks merge if automated QA checks failed\n\n Without it: the workflow still runs, but PRs can be merged without approval.\n\n To enable: Settings → Branches → main → Required status checks\n Add: "PDLC Stage Gate" and "QA Gate"',
|
|
80
|
+
'⚠️ Proteção de branch requer acesso de admin — não pôde ser configurada automaticamente.\n\n O que faz: impede que PRs sejam mergeados sem que esses checks de CI passem:\n • "PDLC Stage Gate" — bloqueia merge se a issue não tiver spec:approved\n • "QA Gate" — bloqueia merge se os checks automáticos de QA falharem\n\n Sem ela: o workflow continua funcionando, mas PRs podem ser mergeados sem aprovação.\n\n Para ativar: Settings → Branches → main → Required status checks\n Adicionar: "PDLC Stage Gate" e "QA Gate"',
|
|
81
|
+
'⚠️ La protección de rama requiere acceso de administrador — no se pudo configurar automáticamente.\n\n Qué hace: impide que los PRs se fusionen sin que pasen estos checks de CI:\n • "PDLC Stage Gate" — bloquea el merge si la issue no tiene spec:approved\n • "QA Gate" — bloquea el merge si los checks automáticos de QA fallaron\n\n Sin ella: el flujo sigue funcionando, pero los PRs se pueden fusionar sin aprobación.\n\n Para activar: Settings → Branches → main → Required status checks\n Agregar: "PDLC Stage Gate" y "QA Gate"'
|
|
82
|
+
),
|
|
79
83
|
issue_templates_copied: t(
|
|
80
84
|
'✅ Issue templates copied to .github/ISSUE_TEMPLATE/',
|
|
81
85
|
'✅ Issue templates copiados para .github/ISSUE_TEMPLATE/',
|
|
@@ -91,6 +95,16 @@ const i18n = {
|
|
|
91
95
|
'⚠️ Não foi possível configurar vars.PROJECT_ID — o token pode não ter permissão variables:write.\n Configure manualmente: repo Settings → Secrets and variables → Variables → PROJECT_ID = ',
|
|
92
96
|
'⚠️ No se pudo configurar vars.PROJECT_ID — el token puede no tener permiso variables:write.\n Configura manualmente: repo Settings → Secrets and variables → Variables → PROJECT_ID = '
|
|
93
97
|
),
|
|
98
|
+
gh_not_installed: t(
|
|
99
|
+
'\n⚠️ GitHub CLI (gh) is not installed. Skipping label creation.',
|
|
100
|
+
'\n⚠️ GitHub CLI (gh) não está instalado. Pulando criação de labels.',
|
|
101
|
+
'\n⚠️ GitHub CLI (gh) no está instalado. Omitiendo creación de etiquetas.'
|
|
102
|
+
),
|
|
103
|
+
repo_context_missing: t(
|
|
104
|
+
'\n⚠️ Repository owner or name missing in cli-context.json. Automatic label creation will be skipped.',
|
|
105
|
+
'\n⚠️ Dono ou nome do repositório ausente em cli-context.json. Criação automática de labels será pulada.',
|
|
106
|
+
'\n⚠️ Propietario o nombre del repositorio faltante en cli-context.json. Se omitirá la creación automática de etiquetas.'
|
|
107
|
+
),
|
|
94
108
|
};
|
|
95
109
|
|
|
96
110
|
const cyan = '\x1b[36m';
|
|
@@ -100,19 +114,23 @@ const yellow = '\x1b[33m';
|
|
|
100
114
|
const red = '\x1b[31m';
|
|
101
115
|
|
|
102
116
|
const PDLC_LABELS = [
|
|
103
|
-
{ name: 'stage:exploration', color: '9b59b6', description: 'Issue is being evaluated' },
|
|
104
117
|
{ name: 'stage:brainstorming', color: 'e84393', description: 'Proposed approaches awaiting PM gate' },
|
|
105
118
|
{ name: 'stage:detailing', color: '3498db', description: 'Technical spec is being written' },
|
|
106
119
|
{ name: 'stage:development', color: 'e67e22', description: 'Agent is implementing the spec' },
|
|
107
|
-
{ name: 'stage:testing', color: '8e44ad', description: 'Agent is testing the implementation' },
|
|
108
120
|
{ name: 'spec:approved', color: '0e8a16', description: 'Spec approved — agent can implement' },
|
|
109
121
|
{ name: 'pr:in-review', color: 'e4e669', description: 'PR awaiting code review' },
|
|
110
122
|
{ name: 'pr:approved', color: '0e8a16', description: 'PR approved, ready for merge' },
|
|
111
123
|
{ name: 'architecture-violation', color: 'd93f0b', description: 'Invariant violation detected by CI' },
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
{ name: 'jules',
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
const JULES_LABELS = [
|
|
127
|
+
{ name: 'jules', color: '5319e7', description: 'Jules AI Agent' },
|
|
128
|
+
];
|
|
129
|
+
|
|
130
|
+
const QA_LABELS = [
|
|
131
|
+
{ name: 'qa:approved', color: '0e8a16', description: 'QA Agent approved the implementation' },
|
|
132
|
+
{ name: 'qa:needs-work', color: 'd93f0b', description: 'QA Agent found issues' },
|
|
133
|
+
{ name: 'infra:qa-broken',color: 'F97316', description: 'QA Agent failed to run — manual review required' },
|
|
116
134
|
];
|
|
117
135
|
|
|
118
136
|
function buildBoardUrl(repoOwner, projectNumber, isOrg) {
|
|
@@ -293,6 +311,19 @@ function scaffoldLiteTemplates(sourceDir, targetDir) {
|
|
|
293
311
|
}
|
|
294
312
|
}
|
|
295
313
|
|
|
314
|
+
function createLabelsForRepo(labels, repo) {
|
|
315
|
+
for (const label of labels) {
|
|
316
|
+
try {
|
|
317
|
+
execFileSync('gh', ['label', 'create', label.name, '--color', label.color, '--description', label.description, '--repo', repo, '--force'], { stdio: 'ignore' });
|
|
318
|
+
} catch (err) {
|
|
319
|
+
if (err.code === 'ENOENT') {
|
|
320
|
+
console.warn(i18n.gh_not_installed);
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
296
327
|
function setActionsVariable(repo, name, value, execFn = execFileSync) {
|
|
297
328
|
try {
|
|
298
329
|
execFn('gh', [
|
|
@@ -753,6 +784,10 @@ async function runUpdate() {
|
|
|
753
784
|
return;
|
|
754
785
|
}
|
|
755
786
|
|
|
787
|
+
const repo = ctx.repoOwner && ctx.repoName ? `${ctx.repoOwner}/${ctx.repoName}` : null;
|
|
788
|
+
if (!repo) {
|
|
789
|
+
console.warn(`${yellow}${i18n.repo_context_missing}${reset}`);
|
|
790
|
+
}
|
|
756
791
|
const paPath = path.join(targetDir, '.github', 'workflows', 'project-automation.yml');
|
|
757
792
|
const atPath = path.join(targetDir, '.github', 'workflows', 'agent-trigger.yml');
|
|
758
793
|
const results = [];
|
|
@@ -761,11 +796,14 @@ async function runUpdate() {
|
|
|
761
796
|
console.log(`\n${cyan}${i18n.update_jules_header}${reset}`);
|
|
762
797
|
const choice = (await askQuestion(i18n.update_jules_ask)).trim().toLowerCase();
|
|
763
798
|
if (choice === 'a' || choice === '') {
|
|
799
|
+
if (repo) createLabelsForRepo(JULES_LABELS, repo);
|
|
764
800
|
configureJules(atPath, '@google-labs-jules', 'jules');
|
|
765
801
|
results.push(t('✅ Jules configured (@google-labs-jules)', '✅ Jules configurado (@google-labs-jules)', '✅ Jules configurado (@google-labs-jules)'));
|
|
766
802
|
} else if (choice === 'b') {
|
|
767
803
|
const handle = (await askQuestion(i18n.update_jules_ask_handle)).trim();
|
|
768
|
-
|
|
804
|
+
const labelName = handle.replace('@', '').toLowerCase();
|
|
805
|
+
if (repo) createLabelsForRepo([{ name: labelName, color: '5319e7', description: `${handle} AI Agent` }], repo);
|
|
806
|
+
configureJules(atPath, handle, labelName);
|
|
769
807
|
results.push(t(`✅ Agent configured (${handle})`, `✅ Agente configurado (${handle})`, `✅ Agente configurado (${handle})`));
|
|
770
808
|
} else {
|
|
771
809
|
results.push(t('⏭ Jules — skipped', '⏭ Jules — pulado', '⏭ Jules — omitido'));
|
|
@@ -776,6 +814,7 @@ async function runUpdate() {
|
|
|
776
814
|
console.log(`\n${cyan}${i18n.update_qa_header}${reset}`);
|
|
777
815
|
const answer = (await askQuestion(i18n.update_qa_ask)).trim().toLowerCase();
|
|
778
816
|
if (!['n', 'no', 'não', 'nao'].includes(answer)) {
|
|
817
|
+
if (repo) createLabelsForRepo(QA_LABELS, repo);
|
|
779
818
|
activateQaAgent(paPath);
|
|
780
819
|
results.push(t(
|
|
781
820
|
'✅ QA Agent configured — Variant B activated (uses GITHUB_TOKEN, no extra secrets needed)',
|