@docupace/pipeline 1.0.115 → 1.0.117
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 +1 -1
- package/src/changeset/changelog.js +17 -10
- package/src/changeset/version.js +1 -1
- package/src/micro/ms-deploy.js +2 -2
- package/src/next/config.js +2 -1
- package/src/next/connect.js +1 -1
package/package.json
CHANGED
|
@@ -83,6 +83,9 @@ function getJiraVersions(changes) {
|
|
|
83
83
|
return versions;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
// Prevents concurrent calls for the same ticket from uploading to Canny more than once
|
|
87
|
+
const cannyUploadCache = new Map();
|
|
88
|
+
|
|
86
89
|
async function getLabelIDs(labels) {
|
|
87
90
|
let cannyConfig;
|
|
88
91
|
try {
|
|
@@ -133,17 +136,21 @@ async function fetchNewLink(oldLink, params) {
|
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
138
|
|
|
136
|
-
const uploadToCannyInternal =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
const uploadToCannyInternal = () => {
|
|
140
|
+
if (!cannyUploadCache.has(mainTicketId)) {
|
|
141
|
+
const uploadPromise = (async () => {
|
|
142
|
+
const changes = getChanges(params);
|
|
143
|
+
const jiraVersions = getJiraVersions(changes);
|
|
144
|
+
const labels = getLabels(changes);
|
|
145
|
+
const labelIDs = await getLabelIDs([...labels, ...jiraVersions]);
|
|
146
|
+
if (labelIDs.length > 0) {
|
|
147
|
+
return uploadToCanny(releaseNote, labelIDs);
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
})();
|
|
151
|
+
cannyUploadCache.set(mainTicketId, uploadPromise);
|
|
146
152
|
}
|
|
153
|
+
return cannyUploadCache.get(mainTicketId);
|
|
147
154
|
};
|
|
148
155
|
|
|
149
156
|
const uploadToJiraInternal = async (ticketId, url) => {
|
package/src/changeset/version.js
CHANGED
|
@@ -27,7 +27,7 @@ const getChangeSetPackage = (installLatest = false) => `{
|
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@changesets/cli": "
|
|
30
|
+
"@changesets/cli": "2.27.10",
|
|
31
31
|
"@docupace/pipeline": "${installLatest ? 'latest' : getPackageVersion()}"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/micro/ms-deploy.js
CHANGED
|
@@ -121,7 +121,7 @@ export async function deployMicroservice(
|
|
|
121
121
|
process.env.BITBUCKET_USERNAME &&
|
|
122
122
|
process.env.BITBUCKET_APP_PASSWORD
|
|
123
123
|
) {
|
|
124
|
-
repoUrl = `https://${process.env.BITBUCKET_USERNAME}:${process.env.BITBUCKET_APP_PASSWORD}@bitbucket.org/dp-cloud/${repoName}.git`;
|
|
124
|
+
repoUrl = `https://${encodeURIComponent(process.env.BITBUCKET_USERNAME)}:${process.env.BITBUCKET_APP_PASSWORD}@bitbucket.org/dp-cloud/${repoName}.git`;
|
|
125
125
|
} else {
|
|
126
126
|
throw new Error(
|
|
127
127
|
'No authentication credentials found for GitOps repository',
|
|
@@ -302,7 +302,7 @@ export async function microserviceBuildPushImage(repoName, options = {}) {
|
|
|
302
302
|
const imageExists = await checkLocalImage(TAG_IMAGE_NAME);
|
|
303
303
|
let SHA_IMAGE_NAME = '';
|
|
304
304
|
if (!imageExists) {
|
|
305
|
-
const repoUrl = `https://${process.env.BITBUCKET_USERNAME}:${process.env.BITBUCKET_APP_PASSWORD}@bitbucket.org/dp-cloud/${repoName}.git`;
|
|
305
|
+
const repoUrl = `https://${encodeURIComponent(process.env.BITBUCKET_USERNAME)}:${process.env.BITBUCKET_APP_PASSWORD}@bitbucket.org/dp-cloud/${repoName}.git`;
|
|
306
306
|
await $`git clone --branch ${options.tag} --depth 1 ${repoUrl} ${repoName}`;
|
|
307
307
|
|
|
308
308
|
console.log('Checking if directory exists...');
|
package/src/next/config.js
CHANGED
|
@@ -133,7 +133,8 @@ export const getBitbucketInfo = () => {
|
|
|
133
133
|
|
|
134
134
|
export const getRepUrl = (repoName) => {
|
|
135
135
|
const { username, password, workspace } = getBitbucketInfo();
|
|
136
|
-
|
|
136
|
+
const encodedUsername = encodeURIComponent(username);
|
|
137
|
+
return `https://${encodedUsername}:${password}@bitbucket.org/${workspace}/${repoName}.git`;
|
|
137
138
|
};
|
|
138
139
|
|
|
139
140
|
export const jfRegistryUrl = 'registry.paperout.com';
|
package/src/next/connect.js
CHANGED
|
@@ -63,7 +63,7 @@ async function gitCheckout(repository, destDir, branch = 'master') {
|
|
|
63
63
|
const password = process.env.BITBUCKET_APP_PASSWORD;
|
|
64
64
|
|
|
65
65
|
// Construct clone command
|
|
66
|
-
const cloneUrl = `https://${username}:${password}@bitbucket.org/dp-cloud/${repository}.git`;
|
|
66
|
+
const cloneUrl = `https://${encodeURIComponent(username)}:${password}@bitbucket.org/dp-cloud/${repository}.git`;
|
|
67
67
|
|
|
68
68
|
log(`Perform cloning`);
|
|
69
69
|
await $`git clone --branch=${branch} --depth 1 ${cloneUrl} ${destDir}`;
|