@docupace/pipeline 1.0.133 → 1.0.134
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
package/src/changeset/canny.js
CHANGED
|
@@ -11,10 +11,17 @@ const CANNY_API_KEY = process.env.CANNY_API_KEY;
|
|
|
11
11
|
*/
|
|
12
12
|
export async function uploadToCanny(releaseNote, labelIDs) {
|
|
13
13
|
if (!CANNY_API_KEY) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if (process.env.IS_DEV) {
|
|
15
|
+
console.warn('Canny API key not provided. Skipping upload (IS_DEV).');
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
throw new Error('CANNY_API_KEY is not set; cannot upload to Canny');
|
|
16
19
|
}
|
|
17
20
|
|
|
21
|
+
console.log(
|
|
22
|
+
`Canny: uploading release note '${releaseNote?.title}' (ticket ${releaseNote?.ticketId}) with ${labelIDs?.length ?? 0} label(s)`,
|
|
23
|
+
);
|
|
24
|
+
|
|
18
25
|
try {
|
|
19
26
|
const title = releaseNote.title;
|
|
20
27
|
let content = '';
|
|
@@ -111,12 +118,15 @@ export async function uploadToCanny(releaseNote, labelIDs) {
|
|
|
111
118
|
);
|
|
112
119
|
|
|
113
120
|
if (!createResponse.ok) {
|
|
114
|
-
|
|
115
|
-
|
|
121
|
+
const errorBody = await createResponse.text().catch(() => '');
|
|
122
|
+
throw new Error(
|
|
123
|
+
`Canny entries/create failed: ${createResponse.status} ${createResponse.statusText} ${errorBody}`,
|
|
124
|
+
);
|
|
116
125
|
}
|
|
117
126
|
|
|
118
127
|
const createData = await createResponse.json();
|
|
119
128
|
const entryId = createData.id;
|
|
129
|
+
console.log(`Canny: created entry ${entryId}`);
|
|
120
130
|
|
|
121
131
|
// Fetch the complete entry details using the entries/list endpoint
|
|
122
132
|
const listResponse = await fetch('https://canny.io/api/v1/entries/list', {
|
|
@@ -130,8 +140,8 @@ export async function uploadToCanny(releaseNote, labelIDs) {
|
|
|
130
140
|
});
|
|
131
141
|
|
|
132
142
|
if (!listResponse.ok) {
|
|
133
|
-
console.
|
|
134
|
-
`
|
|
143
|
+
console.warn(
|
|
144
|
+
`Canny entries/list failed: ${listResponse.status} ${listResponse.statusText}. Entry ${entryId} was created; returning partial data (url may be missing).`,
|
|
135
145
|
);
|
|
136
146
|
return createData; // Return just the create response as fallback
|
|
137
147
|
}
|
|
@@ -148,9 +158,10 @@ export async function uploadToCanny(releaseNote, labelIDs) {
|
|
|
148
158
|
return createData;
|
|
149
159
|
}
|
|
150
160
|
|
|
161
|
+
console.log(`Canny: entry ${entryId} available at ${fullEntry.url}`);
|
|
151
162
|
return fullEntry;
|
|
152
163
|
} catch (error) {
|
|
153
164
|
console.error(`Error uploading to Canny: ${error.message}`);
|
|
154
|
-
|
|
165
|
+
throw error;
|
|
155
166
|
}
|
|
156
167
|
}
|
|
@@ -4,7 +4,8 @@ async function getReleaseLine(changeset, type, changelogOpts) {
|
|
|
4
4
|
const { default: changelog } = await import('./changelog.js');
|
|
5
5
|
return await changelog.getReleaseLine(changeset, type, changelogOpts);
|
|
6
6
|
} catch (e) {
|
|
7
|
-
console.error(e);
|
|
7
|
+
console.error('❌ Changelog getReleaseLine hook failed:', e);
|
|
8
|
+
process.exitCode = 1;
|
|
8
9
|
process.exit(1);
|
|
9
10
|
}
|
|
10
11
|
// Now you can use `changelog` here
|
|
@@ -25,7 +26,8 @@ async function getDependencyReleaseLine(
|
|
|
25
26
|
changelogOpts,
|
|
26
27
|
); // Now you can use `changelog` here
|
|
27
28
|
} catch (e) {
|
|
28
|
-
console.error(e);
|
|
29
|
+
console.error('❌ Changelog getDependencyReleaseLine hook failed:', e);
|
|
30
|
+
process.exitCode = 1;
|
|
29
31
|
process.exit(1);
|
|
30
32
|
}
|
|
31
33
|
})();
|
|
@@ -144,11 +144,15 @@ async function fetchNewLink(oldLink, params) {
|
|
|
144
144
|
const labels = getLabels(changes);
|
|
145
145
|
const labelIDs = await getLabelIDs([...labels, ...jiraVersions]);
|
|
146
146
|
if (labelIDs.length > 0) {
|
|
147
|
-
return uploadToCanny(releaseNote, labelIDs);
|
|
147
|
+
return await uploadToCanny(releaseNote, labelIDs);
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
throw new Error(
|
|
150
|
+
`No Canny label IDs found for ${mainTicketId} (labels: ${[...labels, ...jiraVersions].join(', ')}); cannot upload to Canny`,
|
|
151
|
+
);
|
|
150
152
|
})();
|
|
151
153
|
cannyUploadCache.set(mainTicketId, uploadPromise);
|
|
154
|
+
// Evict failures so they are not cached; the error still propagates to callers
|
|
155
|
+
uploadPromise.catch(() => cannyUploadCache.delete(mainTicketId));
|
|
152
156
|
}
|
|
153
157
|
return cannyUploadCache.get(mainTicketId);
|
|
154
158
|
};
|
package/src/changeset/version.js
CHANGED
|
@@ -93,7 +93,8 @@ export async function versionCommand(
|
|
|
93
93
|
try {
|
|
94
94
|
originalBaseBranch = updateBaseBranch();
|
|
95
95
|
releases = await versionStatus();
|
|
96
|
-
} catch {
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.log(`No releases found from changeset status: ${error.message}`);
|
|
97
98
|
revertBaseBranch(originalBaseBranch);
|
|
98
99
|
return [];
|
|
99
100
|
}
|
|
@@ -115,7 +116,10 @@ export async function updateJiraWithVersion(releases) {
|
|
|
115
116
|
const jiraTicketId = findJiraTicketId(lastCommit);
|
|
116
117
|
|
|
117
118
|
// If we have all the necessary data, update the component version in Jira
|
|
118
|
-
if (jiraTicketId) {
|
|
119
|
+
if (!jiraTicketId) {
|
|
120
|
+
console.warn(`No Jira ticket found in last commit; skipping Jira update`);
|
|
121
|
+
} else {
|
|
122
|
+
const failures = [];
|
|
119
123
|
for (const release of releases) {
|
|
120
124
|
try {
|
|
121
125
|
await updateComponentVersion(
|
|
@@ -125,10 +129,16 @@ export async function updateJiraWithVersion(releases) {
|
|
|
125
129
|
);
|
|
126
130
|
} catch (error) {
|
|
127
131
|
console.error(
|
|
128
|
-
`Failed to update Jira component version: ${error.message}`,
|
|
132
|
+
`Failed to update Jira component version for ${release.name}: ${error.message}`,
|
|
129
133
|
);
|
|
134
|
+
failures.push(release.name);
|
|
130
135
|
}
|
|
131
136
|
}
|
|
137
|
+
if (failures.length > 0) {
|
|
138
|
+
throw new Error(
|
|
139
|
+
`Failed to update Jira ${jiraTicketId} component version for: ${failures.join(', ')}`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
console.log('✅ Changeset versioning complete.');
|
package/src/next/jira.js
CHANGED
|
@@ -14,6 +14,7 @@ const jiraClient = axios.create({
|
|
|
14
14
|
|
|
15
15
|
export async function getJiraReleaseNotes(issueKey) {
|
|
16
16
|
try {
|
|
17
|
+
console.log(`Jira: fetching release notes for ${issueKey}`);
|
|
17
18
|
const response = await jiraClient.get(
|
|
18
19
|
`/rest/api/2/issue/${issueKey}?fields=customfield_10108,customfield_11625`,
|
|
19
20
|
);
|
|
@@ -26,7 +27,7 @@ export async function getJiraReleaseNotes(issueKey) {
|
|
|
26
27
|
return { summary: releaseNotesField, url };
|
|
27
28
|
} catch (error) {
|
|
28
29
|
console.error(
|
|
29
|
-
`Error getting Jira release notes for ${issueKey}: ${error.message}`,
|
|
30
|
+
`Error getting Jira release notes for ${issueKey}: ${error.message} ${JSON.stringify(error.response?.data ?? {})}`,
|
|
30
31
|
);
|
|
31
32
|
throw error;
|
|
32
33
|
}
|
|
@@ -74,6 +75,9 @@ export async function updateJiraReleaseNotes(
|
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
try {
|
|
78
|
+
console.log(
|
|
79
|
+
`Jira: updating release notes for ${issueKey} (url: ${url}, fixVersions: ${jiraVersions.join(', ')})`,
|
|
80
|
+
);
|
|
77
81
|
await doUpdate();
|
|
78
82
|
console.log(`Updated release notes for ${issueKey}`);
|
|
79
83
|
} catch (error) {
|
|
@@ -88,7 +92,7 @@ export async function updateJiraReleaseNotes(
|
|
|
88
92
|
console.log(`Updated release notes for ${issueKey}`);
|
|
89
93
|
} else {
|
|
90
94
|
console.error(
|
|
91
|
-
`Error updating Jira release notes for ${issueKey}: ${error.message}`,
|
|
95
|
+
`Error updating Jira release notes for ${issueKey}: ${error.message} ${JSON.stringify(error.response?.data ?? {})}`,
|
|
92
96
|
);
|
|
93
97
|
throw error;
|
|
94
98
|
}
|
|
@@ -146,7 +150,10 @@ export async function updateComponentVersion(issueKey, packageName, version) {
|
|
|
146
150
|
|
|
147
151
|
console.log(`Updated component versions for ${issueKey}: ${newValue}`);
|
|
148
152
|
} catch (error) {
|
|
149
|
-
console.error(
|
|
153
|
+
console.error(
|
|
154
|
+
`Error updating Jira component version for ${issueKey}: ${error.message} ${JSON.stringify(error.response?.data ?? {})}`,
|
|
155
|
+
);
|
|
156
|
+
throw error;
|
|
150
157
|
}
|
|
151
158
|
}
|
|
152
159
|
|