gennady 0.8.4-draft.2 → 0.8.4-draft.3
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/ai/directives/sdd-v2/root.directive.xml +36 -3
- package/ai/directives/sdd-v2/router.directive.xml +22 -1
- package/ai/kit/templates/sdd-v2/root.directive.hbs +11 -3
- package/ai/kit/templates/sdd-v2/router.directive.hbs +22 -1
- package/ai/skills/agent-inbox/SKILL.md +1 -1
- package/ai/skills/sdd/SKILL.md +5 -3
- package/ai/skills/sdd-audit/SKILL.md +5 -2
- package/ai/skills/sdd-check/SKILL.md +2 -2
- package/ai/skills/sdd-code-review/SKILL.md +4 -1
- package/ai/skills/sdd-critic/SKILL.md +5 -2
- package/ai/skills/sdd-execute/SKILL.md +5 -2
- package/ai/skills/sdd-reconcile/SKILL.md +5 -2
- package/ai/skills/sdd-scaffold/SKILL.md +5 -2
- package/dist/ai/directives/sdd-v2/root.directive.xml +36 -3
- package/dist/ai/directives/sdd-v2/router.directive.xml +22 -1
- package/dist/ai/kit/templates/sdd-v2/root.directive.hbs +11 -3
- package/dist/ai/kit/templates/sdd-v2/router.directive.hbs +22 -1
- package/dist/ai/skills/agent-inbox/SKILL.md +1 -1
- package/dist/ai/skills/sdd/SKILL.md +5 -3
- package/dist/ai/skills/sdd-audit/SKILL.md +5 -2
- package/dist/ai/skills/sdd-check/SKILL.md +2 -2
- package/dist/ai/skills/sdd-code-review/SKILL.md +4 -1
- package/dist/ai/skills/sdd-critic/SKILL.md +5 -2
- package/dist/ai/skills/sdd-execute/SKILL.md +5 -2
- package/dist/ai/skills/sdd-reconcile/SKILL.md +5 -2
- package/dist/ai/skills/sdd-scaffold/SKILL.md +5 -2
- package/dist/chunks/{classify-mr-stage.logic-BiCHTmPp.js → classify-mr-stage.logic-CazmQDwZ.js} +2 -2
- package/dist/chunks/{config-index-9VHWSDQD.js → config-index-DU8-FEjq.js} +1 -1
- package/dist/chunks/{devtools-b0DwO1x_.js → devtools-1JmXJjUG.js} +1 -1
- package/dist/chunks/{eval.cmd-CwNPaNJd.js → eval.cmd-CBANnOFG.js} +1 -1
- package/dist/chunks/{help-D5cXtdMI.js → help-DVloaFF5.js} +1 -1
- package/dist/chunks/{index-BVnJEutp.js → index-2xhpqJtd.js} +2 -2
- package/dist/chunks/{index-RR5OUxje.js → index-AxsLBUAx.js} +14 -14
- package/dist/chunks/{index-CUkeTGqM.js → index-B7sydB0W.js} +2 -2
- package/dist/chunks/{index-CMCn9ErF.js → index-BKxk4zOz.js} +2 -2
- package/dist/chunks/{index-Db13NlHh.js → index-BNMmX_Mv.js} +21 -21
- package/dist/chunks/{index-CmQO-RmM.js → index-BPzldG3a.js} +2 -2
- package/dist/chunks/{index-BOQl7F_Z.js → index-BQlFDvKW.js} +2 -2
- package/dist/chunks/{index-RzkvIfJQ.js → index-Baq7RL1L.js} +3 -3
- package/dist/chunks/index-BbPiwvY9.js +2 -0
- package/dist/chunks/{index-ClJLPEUB.js → index-BreGNLJ_.js} +1 -1
- package/dist/chunks/{index-DjSafAkN.js → index-BslPwGtM.js} +2 -2
- package/dist/chunks/{index-DiMFxS0z.js → index-BtCUN2fZ.js} +16 -16
- package/dist/chunks/{index-CS0VbiLD.js → index-C10-EOdB.js} +1 -1
- package/dist/chunks/{index-2BOEcJIa.js → index-C4JmZLaj.js} +2 -2
- package/dist/chunks/index-CA-JKLr4.js +2 -0
- package/dist/chunks/{index-43GiH--T.js → index-CG_jJZVu.js} +2 -2
- package/dist/chunks/{index-BdkFKsMm.js → index-CGyP2uDE.js} +3 -3
- package/dist/chunks/{index-BOKv0b01.js → index-CPl1s9XJ.js} +2 -2
- package/dist/chunks/{index-DIPrBH-4.js → index-CSxE4cEm.js} +9 -9
- package/dist/chunks/{index-Cm7U1-fU.js → index-CWR5EzXx.js} +2 -2
- package/dist/chunks/{index-BwN5llCR.js → index-Camql5kL.js} +2 -2
- package/dist/chunks/{index-Drh-J9O7.js → index-CdUiTipO.js} +7 -7
- package/dist/chunks/{index-Cn029KTN.js → index-Crg61pK5.js} +2 -2
- package/dist/chunks/{index-Dja2O-hV.js → index-Cv9ZYXso.js} +1 -1
- package/dist/chunks/{index-Ck8v_Gv7.js → index-D7ADMlG3.js} +1 -1
- package/dist/chunks/index-DNl2gC8l.js +158 -0
- package/dist/chunks/{index-BYIzl-Ut.js → index-DVJA0qVm.js} +36 -36
- package/dist/chunks/{index-BAEIZVx0.js → index-DcFJhkY1.js} +2 -2
- package/dist/chunks/{index-Dx5_CB2E.js → index-DdEd-L3x.js} +2 -2
- package/dist/chunks/{index-DVmqMmgb.js → index-DkGA1eW_.js} +32 -32
- package/dist/chunks/{index-3k7mPX1e.js → index-Dnwxlti3.js} +1 -1
- package/dist/chunks/{index-CrizvxOJ.js → index-DqdEJDi2.js} +2 -2
- package/dist/chunks/{index-BIPebtDl.js → index-DqiwmBt4.js} +1 -1
- package/dist/chunks/{index-DS4MhAw-.js → index-PfuqBWjY.js} +2 -2
- package/dist/chunks/{index-BmFT1Kx2.js → index-SVP6RfVl.js} +2 -2
- package/dist/chunks/{index-CDxV4b81.js → index-Y8wu48Q0.js} +1 -1
- package/dist/chunks/index-_ewSKppm.js +2 -0
- package/dist/chunks/{index-Ctcr_Qeu.js → index-aBVtCLIJ.js} +2 -2
- package/dist/chunks/index-dNdz9j6d.js +2 -0
- package/dist/chunks/{index-BFUkVkSo.js → index-gskOpu3H.js} +16 -16
- package/dist/chunks/{index-CXpkT25O.js → index-pBSLMn5Q.js} +3 -3
- package/dist/chunks/index-sqPhX5Io.js +2 -0
- package/dist/chunks/{index-BzmR4Es2.js → index-vfrjhUD1.js} +39 -39
- package/dist/chunks/{index-J2NvjjDV.js → index-xGF5XC_i.js} +2 -2
- package/dist/chunks/{run-review-command.logic-CA2Rjymb.js → run-review-command.logic-B9GoCxh-.js} +24 -24
- package/dist/chunks/{serve.cmd-RxYS6WoN.js → serve.cmd-UXkaeaPI.js} +2 -2
- package/dist/chunks/{services-Csd556Tv.js → services-BYCeGBlO.js} +4 -4
- package/dist/chunks/{shared-B5CTGvpG.js → shared-B3cXL2Np.js} +1178 -1117
- package/dist/chunks/{stats-index-BLztvK69.js → stats-index-AIAnnp9S.js} +2 -2
- package/dist/gennady.js +46 -46
- package/dist/index.js +4 -4
- package/dist/shared/sdd/ladder.d.ts +42 -0
- package/dist/shared/sdd/module-specs.d.ts +7 -0
- package/dist/shared/sdd/tracker.d.ts +9 -0
- package/package.json +1 -1
- package/dist/chunks/classify-mr-stage.logic-ClmhzQPQ.js +0 -53
- package/dist/chunks/config-index-RFeqlDWs.js +0 -104
- package/dist/chunks/devtools-p8tmPuLn.js +0 -79
- package/dist/chunks/eval.cmd-ewU5lcUY.js +0 -34
- package/dist/chunks/help-DzGnMNi2.js +0 -7
- package/dist/chunks/index--AXFi0ty.js +0 -89
- package/dist/chunks/index-64TSesTc.js +0 -186
- package/dist/chunks/index-9Gv5trS_.js +0 -125
- package/dist/chunks/index-B1DQIryA.js +0 -2
- package/dist/chunks/index-B1PiBeQ3.js +0 -2
- package/dist/chunks/index-B4rzuhkt.js +0 -183
- package/dist/chunks/index-B97HJjkg.js +0 -159
- package/dist/chunks/index-BF6qypm0.js +0 -131
- package/dist/chunks/index-BK84ZQsh.js +0 -128
- package/dist/chunks/index-BRVIirjj.js +0 -141
- package/dist/chunks/index-BXnryCGW.js +0 -96
- package/dist/chunks/index-BaZm7Otb.js +0 -2
- package/dist/chunks/index-Bhk746A2.js +0 -129
- package/dist/chunks/index-Bi-eY_dY.js +0 -164
- package/dist/chunks/index-BjumU69g.js +0 -2
- package/dist/chunks/index-BkWXcpXU.js +0 -16979
- package/dist/chunks/index-BlY4jQIA.js +0 -168
- package/dist/chunks/index-C0iy7GxD.js +0 -140
- package/dist/chunks/index-CCBTXczb.js +0 -56
- package/dist/chunks/index-CDAfkSrr.js +0 -2
- package/dist/chunks/index-CDHymWzC.js +0 -102
- package/dist/chunks/index-CNfXJAao.js +0 -2
- package/dist/chunks/index-CQsae1nq.js +0 -207
- package/dist/chunks/index-CVmd0prf.js +0 -2
- package/dist/chunks/index-CZuTNeNm.js +0 -2
- package/dist/chunks/index-CasNhhrL.js +0 -96
- package/dist/chunks/index-Ce7GWENF.js +0 -377
- package/dist/chunks/index-Cf-02TAg.js +0 -265
- package/dist/chunks/index-CfjQWSrh.js +0 -52
- package/dist/chunks/index-Chr7gBBz.js +0 -443
- package/dist/chunks/index-Ci875Zlg.js +0 -346
- package/dist/chunks/index-CwA6RzIB.js +0 -3793
- package/dist/chunks/index-D1dI63ej.js +0 -46
- package/dist/chunks/index-DCS32A2i.js +0 -663
- package/dist/chunks/index-DOFoNxvb.js +0 -131
- package/dist/chunks/index-DVkCEuws.js +0 -136
- package/dist/chunks/index-DkadaaXq.js +0 -658
- package/dist/chunks/index-Dn11CLtk.js +0 -7
- package/dist/chunks/index-Do3spFJT.js +0 -340
- package/dist/chunks/index-DrFRZ0Yg.js +0 -2
- package/dist/chunks/index-DvEQhXi2.js +0 -1054
- package/dist/chunks/index-GiS0x6jg.js +0 -90
- package/dist/chunks/index-NacvqeQ5.js +0 -69
- package/dist/chunks/index-RNJhFzdr.js +0 -227
- package/dist/chunks/index-R_vUB6CL.js +0 -2
- package/dist/chunks/index-TQft1s5H.js +0 -20
- package/dist/chunks/index-ZmQRP38W.js +0 -26969
- package/dist/chunks/index-jdOZ4AkD.js +0 -143
- package/dist/chunks/index-kNa21kUI.js +0 -279
- package/dist/chunks/index-v4AV9kAc.js +0 -108
- package/dist/chunks/run-review-command.logic-CU1Slmc_.js +0 -331
- package/dist/chunks/serve.cmd-dWu_k_G_.js +0 -162
- package/dist/chunks/services-CwvXl2MB.js +0 -46832
- package/dist/chunks/shared-DSZTUx5b.js +0 -4509
- package/dist/chunks/stats-index-H6ALcjxy.js +0 -66
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { p as g, V as $, c as h, r as y } from "./shared-DSZTUx5b.js";
|
|
2
|
-
import { l as n, V as w, a as C } from "./services-CwvXl2MB.js";
|
|
3
|
-
function v() {
|
|
4
|
-
return {
|
|
5
|
-
resolveVcsContext: y,
|
|
6
|
-
stdout: process.stdout,
|
|
7
|
-
stderr: process.stderr,
|
|
8
|
-
exit: (r) => process.exit(r)
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function m(r) {
|
|
12
|
-
const e = r.additions ?? 0, t = r.deletions ?? 0;
|
|
13
|
-
return `${r.path} (${r.status}) +${e}/-${t}`;
|
|
14
|
-
}
|
|
15
|
-
async function x(r, e) {
|
|
16
|
-
try {
|
|
17
|
-
n.debug("[resolveContextOrFail] [idle → resolving]");
|
|
18
|
-
const t = await e.resolveVcsContext(r);
|
|
19
|
-
return n.info(
|
|
20
|
-
`[resolveContextOrFail] [resolving → resolved] ${t.host}/${t.project}${t.iid ? `!${t.iid}` : ""}`
|
|
21
|
-
), t;
|
|
22
|
-
} catch (t) {
|
|
23
|
-
t instanceof $ && (n.error(
|
|
24
|
-
`[resolveContextOrFail] [resolving → failed] ${t.message}`,
|
|
25
|
-
{ cause: t }
|
|
26
|
-
), e.stderr.write(`✖ Ошибка: ${t.message}
|
|
27
|
-
`), e.exit(1));
|
|
28
|
-
const s = new Error("[resolveContextOrFail] VCS context resolution failed", { cause: t });
|
|
29
|
-
n.error("[resolveContextOrFail] [resolving → failed]", { error: s }), e.stderr.write(`✖ Ошибка: ${t.message ?? "неизвестная ошибка"}
|
|
30
|
-
`), e.exit(1);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async function b(r, e, t, s, c) {
|
|
34
|
-
const u = c === "github" ? new w({ baseUrl: "https://api.github.com", token: t }) : new C({ baseUrl: `https://${s}/api/v4`, token: t }), i = {
|
|
35
|
-
project: r,
|
|
36
|
-
sourceBranch: e,
|
|
37
|
-
state: "opened"
|
|
38
|
-
};
|
|
39
|
-
n.debug(`[locateMrByBranch] [idle → querying] ${r} branch=${e}`);
|
|
40
|
-
const l = await u.MergeRequests.getOne(i);
|
|
41
|
-
if (!l)
|
|
42
|
-
return n.info(`[locateMrByBranch] [querying → not-found] ${r} branch=${e}`), null;
|
|
43
|
-
const a = l.iid;
|
|
44
|
-
return n.info(`[locateMrByBranch] [querying → found] iid=${a}`), { iid: a };
|
|
45
|
-
}
|
|
46
|
-
async function p(r, e) {
|
|
47
|
-
const t = h(r);
|
|
48
|
-
n.info(`[fetchChanges] [idle → fetching] ${r.project}!${e}`);
|
|
49
|
-
const s = await t.MergeRequests.getChanges({
|
|
50
|
-
repository: r.project,
|
|
51
|
-
iid: e
|
|
52
|
-
});
|
|
53
|
-
return n.info(`[fetchChanges] [fetching → fetched] ${s.length} files`), s;
|
|
54
|
-
}
|
|
55
|
-
async function F(r, e, t) {
|
|
56
|
-
const s = h(r);
|
|
57
|
-
n.debug(`[fetchFileContent] [idle → fetching] ${r.project} path=${e} ref=${t}`);
|
|
58
|
-
const c = await s.RepositoryFiles.getFileContent({
|
|
59
|
-
repository: r.project,
|
|
60
|
-
path: e,
|
|
61
|
-
ref: t
|
|
62
|
-
});
|
|
63
|
-
return c ? (n.info(`[fetchFileContent] [fetching → fetched] ${e} (${c.content.length} bytes)`), c.content) : (n.info(`[fetchFileContent] [fetching → not-found] ${e}`), null);
|
|
64
|
-
}
|
|
65
|
-
async function R(r, e = v()) {
|
|
66
|
-
n.debug("[run] [idle → parsing]");
|
|
67
|
-
const t = g(r, {
|
|
68
|
-
ref: { aliases: ["ref"], takesValue: !0 },
|
|
69
|
-
path: { aliases: ["path"], takesValue: !0 },
|
|
70
|
-
host: { aliases: ["host", "vcs-host"], takesValue: !0 },
|
|
71
|
-
url: { aliases: ["url"], takesValue: !0 },
|
|
72
|
-
"dry-run": ["dry-run", "dry"]
|
|
73
|
-
}), s = {
|
|
74
|
-
ref: t.ref,
|
|
75
|
-
host: t.host,
|
|
76
|
-
url: t.url
|
|
77
|
-
}, c = t.path, u = !!t["dry-run"];
|
|
78
|
-
n.debug(
|
|
79
|
-
`[run] [parsing → parsed] dryRun=${u} ref=${s.ref ?? ""} path=${c ?? ""} host=${s.host ?? ""}`
|
|
80
|
-
);
|
|
81
|
-
const i = await x(s, e);
|
|
82
|
-
let l;
|
|
83
|
-
if (i.iid !== void 0)
|
|
84
|
-
l = i.iid, n.debug(`[run] [determining-iid → explicit] iid=${l}`);
|
|
85
|
-
else
|
|
86
|
-
try {
|
|
87
|
-
const o = await b(
|
|
88
|
-
i.project,
|
|
89
|
-
i.branch,
|
|
90
|
-
i.token,
|
|
91
|
-
i.host,
|
|
92
|
-
i.provider
|
|
93
|
-
);
|
|
94
|
-
o || (e.stdout.write(
|
|
95
|
-
`ℹ Merge Request не найден для ветки: ${i.branch ?? "(не определена)"}
|
|
96
|
-
`
|
|
97
|
-
), e.exit(0)), l = o.iid;
|
|
98
|
-
} catch (o) {
|
|
99
|
-
const a = new Error("[run] MR lookup failed", { cause: o });
|
|
100
|
-
n.error("[run] [determining-iid → failed]", { error: a }), e.stderr.write(
|
|
101
|
-
`✖ GitLab API error: ${o.message ?? "неизвестная ошибка"}
|
|
102
|
-
`
|
|
103
|
-
), e.exit(1);
|
|
104
|
-
}
|
|
105
|
-
u && (e.stdout.write(`Would fetch diff for: ${i.project}!${l}
|
|
106
|
-
`), e.stdout.write(`[DRY-RUN] no request sent
|
|
107
|
-
`), n.info(`[run] [ready → dry-run-complete] ${i.project}!${l}`), e.exit(0));
|
|
108
|
-
try {
|
|
109
|
-
const o = await p(i, l);
|
|
110
|
-
if (c) {
|
|
111
|
-
const a = o.find((d) => d.path === c);
|
|
112
|
-
a || (e.stdout.write(`ℹ Файл "${c}" не найден в изменениях MR !${l}
|
|
113
|
-
`), e.exit(0));
|
|
114
|
-
const f = await F(i, a.path, a.ref);
|
|
115
|
-
f === null && (e.stdout.write(`ℹ Файл "${c}" не содержит контента
|
|
116
|
-
`), e.exit(0)), e.stdout.write(f), e.stdout.write(`
|
|
117
|
-
`), e.exit(0);
|
|
118
|
-
}
|
|
119
|
-
for (const a of o)
|
|
120
|
-
e.stdout.write(m(a)), e.stdout.write(`
|
|
121
|
-
`);
|
|
122
|
-
n.info(`[run] [output → complete] ${o.length} files`), e.exit(0);
|
|
123
|
-
} catch (o) {
|
|
124
|
-
const a = new Error(`[run] Fetch failed for ${i.project}!${l}`, { cause: o });
|
|
125
|
-
n.error("[run] [fetching → failed]", { error: a }), e.stderr.write(`✖ GitLab API error: ${o.message ?? "неизвестная ошибка"}
|
|
126
|
-
`), e.exit(1);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
await R(process.argv);
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { p, c as b, d as x, V as v, r as j } from "./shared-B5CTGvpG.js";
|
|
2
|
-
import { l as i, V as C, a as M } from "./services-Csd556Tv.js";
|
|
3
|
-
function V() {
|
|
4
|
-
return {
|
|
5
|
-
resolveVcsContext: j,
|
|
6
|
-
stdout: process.stdout,
|
|
7
|
-
stderr: process.stderr,
|
|
8
|
-
exit: (r) => process.exit(r)
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
async function R(r, t) {
|
|
12
|
-
try {
|
|
13
|
-
i.debug("[resolveContextOrFail] [idle → resolving]");
|
|
14
|
-
const e = await t.resolveVcsContext(r);
|
|
15
|
-
return i.info(
|
|
16
|
-
`[resolveContextOrFail] [resolving → resolved] ${e.host}/${e.project}${e.iid ? `!${e.iid}` : ""}`
|
|
17
|
-
), e;
|
|
18
|
-
} catch (e) {
|
|
19
|
-
e instanceof v && (i.error(
|
|
20
|
-
`[resolveContextOrFail] [resolving → failed] ${e.message}`,
|
|
21
|
-
{ cause: e }
|
|
22
|
-
), t.stderr.write(`✖ Ошибка: ${e.message}
|
|
23
|
-
`), t.exit(1));
|
|
24
|
-
const s = new Error("[resolveContextOrFail] VCS context resolution failed", { cause: e });
|
|
25
|
-
i.error("[resolveContextOrFail] [resolving → failed]", { error: s }), t.stderr.write(`✖ Ошибка: ${e.message ?? "неизвестная ошибка"}
|
|
26
|
-
`), t.exit(1);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async function B(r, t, e, s, c) {
|
|
30
|
-
const f = c === "github" ? new C({ baseUrl: "https://api.github.com", token: e }) : new M({ baseUrl: `https://${s}/api/v4`, token: e }), d = {
|
|
31
|
-
project: r,
|
|
32
|
-
sourceBranch: t,
|
|
33
|
-
state: "opened"
|
|
34
|
-
};
|
|
35
|
-
i.debug(`[locateMrByBranch] [idle → querying] ${r} branch=${t}`);
|
|
36
|
-
const g = await f.MergeRequests.getOne(d);
|
|
37
|
-
if (!g)
|
|
38
|
-
return i.info(`[locateMrByBranch] [querying → not-found] ${r} branch=${t}`), null;
|
|
39
|
-
const o = g.iid;
|
|
40
|
-
return i.info(`[locateMrByBranch] [querying → found] iid=${o}`), { iid: o };
|
|
41
|
-
}
|
|
42
|
-
async function P(r, t) {
|
|
43
|
-
const e = b(r);
|
|
44
|
-
i.info(`[fetchPipeline] [idle → fetching] ${r.project}!${t}`);
|
|
45
|
-
const s = await e.MergeRequests.getPipeline({
|
|
46
|
-
project: r.project,
|
|
47
|
-
iid: t
|
|
48
|
-
});
|
|
49
|
-
return i.info(
|
|
50
|
-
`[fetchPipeline] [fetching → fetched] status=${s.status || "none"} jobs=${s.jobs.length}`
|
|
51
|
-
), s;
|
|
52
|
-
}
|
|
53
|
-
function q(r, t) {
|
|
54
|
-
return t === "all" ? r.jobs : t === "failed" ? r.jobs.filter((e) => e.status.toLowerCase() !== "success") : r.jobs.filter((e) => e.status.toLowerCase() === t.toLowerCase());
|
|
55
|
-
}
|
|
56
|
-
function m(r) {
|
|
57
|
-
const t = r.match(/(\d+)$/);
|
|
58
|
-
return t ? t[1] : r;
|
|
59
|
-
}
|
|
60
|
-
function L(r, t, e) {
|
|
61
|
-
e.stdout.write(
|
|
62
|
-
JSON.stringify(
|
|
63
|
-
{
|
|
64
|
-
status: r.status,
|
|
65
|
-
jobs: t.map((s) => ({ name: s.name, status: s.status, id: m(s.id) }))
|
|
66
|
-
},
|
|
67
|
-
null,
|
|
68
|
-
2
|
|
69
|
-
)
|
|
70
|
-
), e.stdout.write(`
|
|
71
|
-
`);
|
|
72
|
-
}
|
|
73
|
-
function O(r, t, e) {
|
|
74
|
-
if (e.stdout.write(`Pipeline status: ${r.status || "none"}
|
|
75
|
-
`), t.length === 0)
|
|
76
|
-
e.stdout.write(`No matching jobs.
|
|
77
|
-
`);
|
|
78
|
-
else
|
|
79
|
-
for (const s of t)
|
|
80
|
-
e.stdout.write(` ${s.status === "success" ? "✓" : "✖"} ${s.name} (${s.status})
|
|
81
|
-
`);
|
|
82
|
-
}
|
|
83
|
-
async function F(r, t = V()) {
|
|
84
|
-
i.debug("[run] [idle → parsing]");
|
|
85
|
-
const e = p(r, {
|
|
86
|
-
ref: { aliases: ["ref"], takesValue: !0 },
|
|
87
|
-
host: { aliases: ["host", "vcs-host"], takesValue: !0 },
|
|
88
|
-
url: { aliases: ["url"], takesValue: !0 },
|
|
89
|
-
status: { aliases: ["status"], takesValue: !0 },
|
|
90
|
-
"dry-run": ["dry-run", "dry"],
|
|
91
|
-
json: ["json"],
|
|
92
|
-
logs: ["logs"],
|
|
93
|
-
all: ["all"]
|
|
94
|
-
}), s = {
|
|
95
|
-
ref: e.ref,
|
|
96
|
-
host: e.host,
|
|
97
|
-
url: e.url
|
|
98
|
-
}, c = !!e["dry-run"], f = !!e.json, d = !!e.logs, h = !!e.all ? "all" : e.status || "failed";
|
|
99
|
-
i.debug(
|
|
100
|
-
`[run] [parsing → parsed] dryRun=${c} ref=${s.ref ?? ""} host=${s.host ?? ""}`
|
|
101
|
-
);
|
|
102
|
-
const o = await R(s, t);
|
|
103
|
-
let a;
|
|
104
|
-
if (o.iid !== void 0)
|
|
105
|
-
a = o.iid, i.debug(`[run] [determining-iid → explicit] iid=${a}`);
|
|
106
|
-
else
|
|
107
|
-
try {
|
|
108
|
-
const n = await B(
|
|
109
|
-
o.project,
|
|
110
|
-
o.branch,
|
|
111
|
-
o.token,
|
|
112
|
-
o.host,
|
|
113
|
-
o.provider
|
|
114
|
-
);
|
|
115
|
-
n || (t.stdout.write(
|
|
116
|
-
`ℹ Merge Request не найден для ветки: ${o.branch ?? "(не определена)"}
|
|
117
|
-
`
|
|
118
|
-
), t.exit(0)), a = n.iid;
|
|
119
|
-
} catch (n) {
|
|
120
|
-
const u = new Error("[run] MR lookup failed", { cause: n });
|
|
121
|
-
i.error("[run] [determining-iid → failed]", { error: u }), t.stderr.write(
|
|
122
|
-
`✖ GitLab API error: ${n.message ?? "неизвестная ошибка"}
|
|
123
|
-
`
|
|
124
|
-
), t.exit(1);
|
|
125
|
-
}
|
|
126
|
-
c && (t.stdout.write(`Would fetch pipeline for: ${o.project}!${a}
|
|
127
|
-
`), t.stdout.write(`[DRY-RUN] no request sent
|
|
128
|
-
`), i.info(`[run] [ready → dry-run-complete] ${o.project}!${a}`), t.exit(0));
|
|
129
|
-
try {
|
|
130
|
-
const n = await P(o, a);
|
|
131
|
-
n.status || (t.stdout.write(`No pipeline found for this MR
|
|
132
|
-
`), i.info(`[run] [output → no-pipeline] ${o.project}!${a}`), t.exit(0));
|
|
133
|
-
const u = q(n, h);
|
|
134
|
-
if (d && u.length > 0) {
|
|
135
|
-
t.stdout.write(`Pipeline status: ${n.status}
|
|
136
|
-
|
|
137
|
-
`);
|
|
138
|
-
const y = b(o);
|
|
139
|
-
for (const l of u) {
|
|
140
|
-
const w = l.status.toLowerCase() !== "success";
|
|
141
|
-
if (t.stdout.write(`${w ? "✖" : "✓"} ${l.name} (${l.status})
|
|
142
|
-
`), w)
|
|
143
|
-
try {
|
|
144
|
-
const $ = await y.Pipeline.getJobLog({
|
|
145
|
-
project: o.project,
|
|
146
|
-
jobId: m(l.id)
|
|
147
|
-
});
|
|
148
|
-
t.stdout.write(`${x($)}
|
|
149
|
-
`);
|
|
150
|
-
} catch ($) {
|
|
151
|
-
t.stdout.write(` [log unavailable: ${$.message}]
|
|
152
|
-
`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
t.exit(0);
|
|
156
|
-
}
|
|
157
|
-
f ? L(n, u, t) : O(n, u, t), i.info(`[run] [output → complete] status=${n.status}`), t.exit(0);
|
|
158
|
-
} catch (n) {
|
|
159
|
-
const u = new Error(`[run] Fetch failed for ${o.project}!${a}`, { cause: n });
|
|
160
|
-
i.error("[run] [fetching → failed]", { error: u }), t.stderr.write(`✖ GitLab API error: ${n.message ?? "неизвестная ошибка"}
|
|
161
|
-
`), t.exit(1);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
await F(process.argv);
|