@docupace/pipeline 1.0.86 → 1.0.88
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/designs/convert-to-canny.md +20 -0
- package/package.json +10 -4
- package/src/auth0/configure.js +1 -3
- package/src/changeset/canny.js +119 -0
- package/src/changeset/changelog-module.cjs +37 -0
- package/src/changeset/changelog.js +210 -0
- package/src/changeset/cli.js +27 -42
- package/src/changeset/config.js +20 -0
- package/src/changeset/convert.js +461 -0
- package/src/changeset/create-canny.js +86 -0
- package/src/changeset/create-simple.js +131 -0
- package/src/changeset/create.js +41 -123
- package/src/changeset/openai.js +570 -0
- package/src/changeset/validate.js +1 -12
- package/src/changeset/version.js +25 -3
- package/src/index.mjs +2 -0
- package/src/lib/merge-driver.js +1 -5
- package/src/merge/cli-merge-all.js +1 -2
- package/src/merge/cli-merge.js +4 -4
- package/src/merge/merge-changelog.js +1 -1
- package/src/merge/pr.js +3 -3
- package/src/next/connect.js +0 -9
- package/src/next/deploy.js +2 -2
- package/src/next/jira.js +51 -0
- package/src/next/util.js +1 -1
- package/testCanny.sh +4 -0
package/src/merge/cli-merge.js
CHANGED
|
@@ -2,7 +2,7 @@ import { execSync } from 'child_process';
|
|
|
2
2
|
import { createBitbucketPR } from './pr.js';
|
|
3
3
|
import { autoResolveConflicts } from './cli-resolve.js';
|
|
4
4
|
import { getPackageNames } from '../changeset/package-util.js';
|
|
5
|
-
import { writeChangesetFile } from '../changeset/create.js';
|
|
5
|
+
import { writeChangesetFile } from '../changeset/create-simple.js';
|
|
6
6
|
import { BuildResults } from './common.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -83,7 +83,7 @@ function attemptMerge(sourceBranch, targetBranch, verbose = false) {
|
|
|
83
83
|
if (verbose) console.log('✅ Merge completed with changes, no conflicts');
|
|
84
84
|
return { hasConflicts: false, hasChanges: true };
|
|
85
85
|
}
|
|
86
|
-
} catch
|
|
86
|
+
} catch {
|
|
87
87
|
if (verbose) console.log('⚠️ Merge conflicts detected');
|
|
88
88
|
return { hasConflicts: true, hasChanges: true };
|
|
89
89
|
}
|
|
@@ -141,7 +141,7 @@ function runBuild(buildScript, verbose = false) {
|
|
|
141
141
|
});
|
|
142
142
|
if (verbose) console.log('✅ Build passed');
|
|
143
143
|
return true;
|
|
144
|
-
} catch
|
|
144
|
+
} catch {
|
|
145
145
|
if (verbose) console.log('❌ Build failed');
|
|
146
146
|
return false;
|
|
147
147
|
}
|
|
@@ -283,7 +283,7 @@ function cleanupFailedMerge(verbose = false) {
|
|
|
283
283
|
try {
|
|
284
284
|
execSync('git merge --abort', { stdio: 'pipe' });
|
|
285
285
|
if (verbose) console.log('🧹 Cleaned up failed merge');
|
|
286
|
-
} catch
|
|
286
|
+
} catch {
|
|
287
287
|
// Ignore cleanup errors
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -72,7 +72,7 @@ export function mergeChangelogFile(filePath) {
|
|
|
72
72
|
try {
|
|
73
73
|
execSync(`git add ${filePath}`);
|
|
74
74
|
console.log('📝 File added to git staging area');
|
|
75
|
-
} catch
|
|
75
|
+
} catch {
|
|
76
76
|
console.log(
|
|
77
77
|
'⚠️ Could not add file to git (may not be in a git repository)',
|
|
78
78
|
);
|
package/src/merge/pr.js
CHANGED
|
@@ -40,7 +40,7 @@ export async function getExistingPRsWithDescription(
|
|
|
40
40
|
// Check each repository for matching PRs
|
|
41
41
|
for (const repo of repositories) {
|
|
42
42
|
try {
|
|
43
|
-
const match = repo.url.match(/bitbucket\.org[
|
|
43
|
+
const match = repo.url.match(/bitbucket\.org[/:]([^/]+)\/([^/.]+)/);
|
|
44
44
|
|
|
45
45
|
if (!match) {
|
|
46
46
|
console.warn(`Could not parse repository URL: ${repo.url}`);
|
|
@@ -104,7 +104,7 @@ export async function getExistingPRsFromCurrentRepo(descriptionPattern) {
|
|
|
104
104
|
const remoteUrl = execSync('git config --get remote.origin.url', {
|
|
105
105
|
encoding: 'utf-8',
|
|
106
106
|
}).trim();
|
|
107
|
-
const match = remoteUrl.match(/bitbucket\.org[
|
|
107
|
+
const match = remoteUrl.match(/bitbucket\.org[/:]([^/]+)\/([^/.]+)/);
|
|
108
108
|
|
|
109
109
|
if (!match) {
|
|
110
110
|
throw new Error(
|
|
@@ -165,7 +165,7 @@ export async function createBitbucketPR(
|
|
|
165
165
|
const remoteUrl = execSync('git config --get remote.origin.url', {
|
|
166
166
|
encoding: 'utf-8',
|
|
167
167
|
}).trim();
|
|
168
|
-
const match = remoteUrl.match(/bitbucket\.org[
|
|
168
|
+
const match = remoteUrl.match(/bitbucket\.org[/:]([^/]+)\/([^/.]+)/);
|
|
169
169
|
|
|
170
170
|
if (!match) {
|
|
171
171
|
throw new Error(
|
package/src/next/connect.js
CHANGED
|
@@ -2,7 +2,6 @@ import 'zx/globals'; // npm i zx
|
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { $ } from 'zx';
|
|
5
|
-
import { getAuth0Metadata } from '../auth0/metadata.js';
|
|
6
5
|
import { getVaultSecrets } from '../auth0/vault.js';
|
|
7
6
|
|
|
8
7
|
process.env.COMMON_VAULT_PATH =
|
|
@@ -12,14 +11,6 @@ process.env.CONNECT_DIR = process.env.CONNECT_DIR || 'connect';
|
|
|
12
11
|
const vaultToken = process.env.VAULT_TOKEN;
|
|
13
12
|
const vaultAddr = process.env.VAULT_ADDR;
|
|
14
13
|
|
|
15
|
-
const connectUIEnvMap = {
|
|
16
|
-
dev: 'dev',
|
|
17
|
-
qa: 'preprod',
|
|
18
|
-
stage: 'stg',
|
|
19
|
-
uat: 'uat',
|
|
20
|
-
prod: 'prod-www3',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
14
|
const siteSettingsEnvMap = {
|
|
24
15
|
dev: 'dev',
|
|
25
16
|
preprod: 'preprod',
|
package/src/next/deploy.js
CHANGED
|
@@ -306,14 +306,14 @@ export async function getDeployTag(prefix = 'v') {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
function getDeploymentTargets(tag, config) {
|
|
309
|
-
const semverRegex = /^v?(\d+)\.(\d+)\.(\d+)(?:-([\w
|
|
309
|
+
const semverRegex = /^v?(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?$/;
|
|
310
310
|
const match = tag.match(semverRegex);
|
|
311
311
|
|
|
312
312
|
if (!match) {
|
|
313
313
|
throw new Error(`Invalid tag format: ${tag}`);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
const [
|
|
316
|
+
const [major, minor, preRelease] = match;
|
|
317
317
|
const isAlpha = preRelease && preRelease.toLowerCase().includes('alpha');
|
|
318
318
|
|
|
319
319
|
return config
|
package/src/next/jira.js
CHANGED
|
@@ -12,6 +12,57 @@ const jiraClient = axios.create({
|
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
+
export async function getJiraReleaseNotes(issueKey) {
|
|
16
|
+
try {
|
|
17
|
+
const response = await jiraClient.get(
|
|
18
|
+
`/rest/api/2/issue/${issueKey}?fields=customfield_10108,customfield_11625`,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const releaseNotesField = response.data.fields.customfield_10108;
|
|
22
|
+
const url = response.data.fields.customfield_11625;
|
|
23
|
+
|
|
24
|
+
// Extract text from the document structure
|
|
25
|
+
|
|
26
|
+
return { summary: releaseNotesField, url };
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(
|
|
29
|
+
`Error getting Jira release notes for ${issueKey}: ${error.message}`,
|
|
30
|
+
);
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Updates the release notes in the Jira issue's custom field
|
|
37
|
+
* @param {string} issueKey - The Jira issue key
|
|
38
|
+
* @param {string} text - The release notes text to set
|
|
39
|
+
*/
|
|
40
|
+
export async function updateJiraReleaseNotes(
|
|
41
|
+
issueKey,
|
|
42
|
+
text,
|
|
43
|
+
url,
|
|
44
|
+
jiraVersions,
|
|
45
|
+
) {
|
|
46
|
+
try {
|
|
47
|
+
const payload = {
|
|
48
|
+
fields: {
|
|
49
|
+
customfield_10108: text,
|
|
50
|
+
customfield_11625: url,
|
|
51
|
+
fixVersions: jiraVersions.map((version) => ({ name: version })),
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
await jiraClient.put(`/rest/api/2/issue/${issueKey}`, payload);
|
|
56
|
+
|
|
57
|
+
console.log(`Updated release notes for ${issueKey}`);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(
|
|
60
|
+
`Error updating Jira release notes for ${issueKey}: ${error.message}`,
|
|
61
|
+
);
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
15
66
|
/**
|
|
16
67
|
* Updates the component version custom field in Jira
|
|
17
68
|
* @param {string} issueKey - The Jira issue key
|
package/src/next/util.js
CHANGED
|
@@ -85,7 +85,7 @@ export async function getChangedAppPackages() {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export async function setGitInfo() {
|
|
88
|
-
if (
|
|
88
|
+
if (process.env.SET_GITOPS_USER) {
|
|
89
89
|
await $`git config --global user.email "gitops@docupace.com"`;
|
|
90
90
|
await $`git config --global user.name "Gitops"`;
|
|
91
91
|
const repoUrl = `git@bitbucket.org:dp-cloud/${process.env.BITBUCKET_REPO_SLUG}.git`;
|
package/testCanny.sh
ADDED