ticketlens 0.38.5 → 0.38.7
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/package.json
CHANGED
|
@@ -107,14 +107,16 @@ export async function runComplianceCheck({
|
|
|
107
107
|
const missing = analysis.results
|
|
108
108
|
.filter(r => r.status === 'NOT_FOUND')
|
|
109
109
|
.map(r => r.requirement);
|
|
110
|
+
const noCriteria = requirements.length === 0;
|
|
110
111
|
|
|
111
112
|
if (isPro) {
|
|
112
113
|
const gitEmail = execFn('git', ['config', 'user.email'], { encoding: 'utf8' }).stdout?.trim() ?? 'unknown';
|
|
114
|
+
const commitSha = execFn('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).stdout?.trim() ?? 'unknown';
|
|
113
115
|
appendLedgerFn(
|
|
114
|
-
{ ticketKey, commitSha: '
|
|
116
|
+
{ ticketKey, commitSha: commitSha || 'unknown', author: gitEmail || 'unknown', coverage: coveragePercent, missing, noCriteria },
|
|
115
117
|
{ configDir, isPro }
|
|
116
118
|
);
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
return { report, results: analysis.results, coveragePercent, noCriteria
|
|
121
|
+
return { report, results: analysis.results, coveragePercent, noCriteria };
|
|
120
122
|
}
|
|
@@ -458,7 +458,7 @@ export async function postComment(ticketKey, body, opts = {}) {
|
|
|
458
458
|
throw err;
|
|
459
459
|
}
|
|
460
460
|
const raw = await response.json();
|
|
461
|
-
return { id: raw.id, url: raw.
|
|
461
|
+
return { id: raw.id, url: `${baseUrl}/browse/${ticketKey}?focusedCommentId=${raw.id}` };
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
/**
|
|
@@ -728,7 +728,7 @@ export async function createIssue({ project, type, summary, description } = {},
|
|
|
728
728
|
throw err;
|
|
729
729
|
}
|
|
730
730
|
const raw = await response.json();
|
|
731
|
-
return { key: raw.key, id: raw.id, url: raw.
|
|
731
|
+
return { key: raw.key, id: raw.id, url: `${baseUrl}/browse/${raw.key}` };
|
|
732
732
|
}
|
|
733
733
|
|
|
734
734
|
export async function fetchTicket(ticketKey, opts = {}) {
|
|
@@ -65,10 +65,10 @@ export function exportLedger(format, { configDir = DEFAULT_CONFIG_DIR, fsModule
|
|
|
65
65
|
const records = readLedger({ configDir, fsModule });
|
|
66
66
|
|
|
67
67
|
if (format === 'csv') {
|
|
68
|
-
const header = 'ts,ticketKey,commitSha,author,coverage,missing';
|
|
68
|
+
const header = 'ts,ticketKey,commitSha,author,coverage,missing,noCriteria';
|
|
69
69
|
const rows = records.map(r => {
|
|
70
70
|
const missing = Array.isArray(r.missing) ? r.missing.join('|') : (r.missing ?? '');
|
|
71
|
-
return [r.ts, r.ticketKey, r.commitSha, r.author, r.coverage, missing]
|
|
71
|
+
return [r.ts, r.ticketKey, r.commitSha, r.author, r.coverage, missing, r.noCriteria]
|
|
72
72
|
.map(v => `"${String(v ?? '').replace(/"/g, '""')}"`)
|
|
73
73
|
.join(',');
|
|
74
74
|
});
|
|
@@ -55,7 +55,7 @@ export async function runCollisions(args = [], opts = {}) {
|
|
|
55
55
|
const { collisions = [], message } = await res.json();
|
|
56
56
|
|
|
57
57
|
if (message && collisions.length === 0) {
|
|
58
|
-
print(message + '\n');
|
|
58
|
+
print(jsonFlag ? formatCollisions([], { json: true }) : message + '\n');
|
|
59
59
|
return { ok: true };
|
|
60
60
|
}
|
|
61
61
|
|