@eui/tools 4.15.11 → 4.16.0
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/.version.properties +1 -1
- package/CHANGELOG.md +45 -0
- package/bin/eui-scripts.js +6 -6
- package/bin/scripts/build-package-sub.js +20 -0
- package/bin/scripts/version.js +12 -0
- package/global.test.js +2 -5
- package/package.json +16 -20
- package/sandbox.js +10 -2
- package/scripts/csdr/cli/app.js +30 -3
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/shared/shared.module.ts +15 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
- package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/index.html +22 -0
- package/scripts/csdr/config/angular.js +213 -3
- package/scripts/csdr/config/global.js +16 -0
- package/scripts/csdr/config/packages.js +28 -0
- package/scripts/csdr/init/init-utils.js +37 -0
- package/scripts/csdr/init/init.js +6 -0
- package/scripts/csdr/init/resources/13.x/resolutions.json +15 -0
- package/scripts/csdr/install/build-package.js +0 -84
- package/scripts/csdr/install/common.js +10 -8
- package/scripts/csdr/jira/jira-utils.js +168 -168
- package/scripts/csdr/jira/update.js +150 -150
- package/scripts/csdr/metadata/app-envs.js +34 -33
- package/scripts/csdr/metadata/app-history.js +62 -61
- package/scripts/csdr/metadata/app.js +3 -3
- package/scripts/csdr/metadata/common.js +2 -2
- package/scripts/csdr/metadata/package-history.js +0 -1
- package/scripts/csdr/release/app/release-app.js +3 -0
- package/scripts/csdr/release/package/backend.js +26 -0
- package/scripts/csdr/release/package/common.js +1 -1
- package/scripts/csdr/release/package/release-package.js +8 -0
- package/scripts/csdr/release/package/ui.js +83 -1
- package/scripts/csdr/sync/sync-utils.js +13 -6
- package/scripts/csdr/version/package.js +2 -1
- package/scripts/utils/build/app/build-app-utils.js +2 -2
- package/scripts/utils/build/package/angular.js +4 -4
- package/scripts/utils/build/package/build-package-utils.js +50 -1
- package/scripts/utils/build/package/element.js +5 -16
- package/scripts/utils/build/package/styles.js +100 -7
- package/scripts/utils/confluence-utils.js +126 -126
- package/scripts/utils/index.js +2 -2
- package/scripts/utils/notification/common.js +5 -0
- package/scripts/utils/notification/mail-utils.js +3 -0
- package/scripts/utils/notification/mailstack.js +3 -5
- package/scripts/utils/notification/package.js +0 -2
- package/scripts/utils/notification/slack-utils.js +6 -7
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
- package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
- package/scripts/utils/pre-build/injection/config.js +29 -30
- package/scripts/utils/pre-build/injection/externals.js +6 -0
- package/scripts/utils/pre-build/injection/skeletons.js +6 -2
- package/scripts/utils/pre-build/projects.js +5 -1
- package/scripts/utils/serve/app.js +6 -3
- package/scripts/utils/tools.js +370 -283
- package/bin/scripts/csdr-jira-update.js +0 -12
- package/bin/scripts/csdr-migrate-package.js +0 -17
- package/bin/scripts/e2e-app.js +0 -62
- package/scripts/migration/eui8-migration.js +0 -94
- package/scripts/migration/migrate-utils.js +0 -191
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// GLOBAL
|
|
4
|
-
const execa = require('execa');
|
|
5
|
-
const moment = require('moment');
|
|
6
|
-
const axios = require('axios');
|
|
7
|
-
|
|
8
|
-
// LOCAL
|
|
9
|
-
const tools = require('../../utils/tools');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const getProject = (projectKey) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const getIssue = (issueKey) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const updateIssueVersion = (issueKey, version) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const createVersion = (projectKey = 'MWP', version = 'PI9.IT1') => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const doCall = (options) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
module.exports = {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
1
|
+
// 'use strict';
|
|
2
|
+
|
|
3
|
+
// // GLOBAL
|
|
4
|
+
// const execa = require('execa');
|
|
5
|
+
// const moment = require('moment');
|
|
6
|
+
// const axios = require('axios');
|
|
7
|
+
|
|
8
|
+
// // LOCAL
|
|
9
|
+
// const tools = require('../../utils/tools');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// const getProject = (projectKey) => {
|
|
13
|
+
// return Promise.resolve()
|
|
14
|
+
// .then(() => {
|
|
15
|
+
// return doCall({ method: 'GET', url: `/project/${projectKey}` });
|
|
16
|
+
// })
|
|
17
|
+
// .then((response) => {
|
|
18
|
+
// tools.logSuccess(`OK ${response.status}`);
|
|
19
|
+
// return response.data;
|
|
20
|
+
// })
|
|
21
|
+
// .catch((e) => {
|
|
22
|
+
// tools.logError(`ERROR ${e.response.status}`);
|
|
23
|
+
// throw e;
|
|
24
|
+
// })
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
// const getIssue = (issueKey) => {
|
|
28
|
+
// return Promise.resolve()
|
|
29
|
+
// .then(() => {
|
|
30
|
+
// return doCall({ method: 'GET', url: `/issue/${issueKey}` });
|
|
31
|
+
// })
|
|
32
|
+
// .then((response) => {
|
|
33
|
+
// tools.logSuccess(`OK ${response.status}`);
|
|
34
|
+
// return response.data;
|
|
35
|
+
// })
|
|
36
|
+
// .catch((e) => {
|
|
37
|
+
// tools.logError(`ERROR ${e.response.status}`);
|
|
38
|
+
// throw e;
|
|
39
|
+
// })
|
|
40
|
+
// }
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// const updateIssueVersion = (issueKey, version) => {
|
|
44
|
+
// tools.logInfo(`Updating issue: ${issueKey} with version: ${version}`);
|
|
45
|
+
|
|
46
|
+
// return Promise.resolve()
|
|
47
|
+
// .then(() => {
|
|
48
|
+
|
|
49
|
+
// const postData = JSON.stringify({
|
|
50
|
+
// "update": {
|
|
51
|
+
// "fixVersions": [
|
|
52
|
+
// {
|
|
53
|
+
// "add": {
|
|
54
|
+
// "name": version
|
|
55
|
+
// }
|
|
56
|
+
// }
|
|
57
|
+
// ]
|
|
58
|
+
// }
|
|
59
|
+
// });
|
|
60
|
+
|
|
61
|
+
// return doCall({ method: 'PUT', url: `/issue/${issueKey}`, data: postData });
|
|
62
|
+
// })
|
|
63
|
+
// .then((response) => {
|
|
64
|
+
// tools.logSuccess(`OK ${response.status}`);
|
|
65
|
+
// return response.data;
|
|
66
|
+
// })
|
|
67
|
+
// .catch((e) => {
|
|
68
|
+
// tools.logError(`ERROR ${e.response.status}`);
|
|
69
|
+
// throw e;
|
|
70
|
+
// })
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// const createVersion = (projectKey = 'MWP', version = 'PI9.IT1') => {
|
|
77
|
+
// return Promise.resolve()
|
|
78
|
+
|
|
79
|
+
// // get project from key
|
|
80
|
+
// .then(() => {
|
|
81
|
+
// return getProject(projectKey);
|
|
82
|
+
// })
|
|
83
|
+
|
|
84
|
+
// // check if version exists in the fetch project versions, if not create it
|
|
85
|
+
// .then((project) => {
|
|
86
|
+
// const versionFound = project.versions.filter((v) => {
|
|
87
|
+
// return v.name === version;
|
|
88
|
+
// })[0];
|
|
89
|
+
|
|
90
|
+
// if (versionFound) {
|
|
91
|
+
// // output the version found if exists
|
|
92
|
+
// tools.logInfo(`Version ${version} exist ==> id: ${versionFound.id}`);
|
|
93
|
+
// return versionFound;
|
|
94
|
+
|
|
95
|
+
// } else {
|
|
96
|
+
|
|
97
|
+
// // creating the version if not
|
|
98
|
+
// return Promise.resolve()
|
|
99
|
+
// .then(() => {
|
|
100
|
+
// tools.logInfo(`Version does not exist...creating`);
|
|
101
|
+
|
|
102
|
+
// const postData = JSON.stringify({
|
|
103
|
+
// project: projectKey,
|
|
104
|
+
// name: version,
|
|
105
|
+
// released: false,
|
|
106
|
+
// archived: false,
|
|
107
|
+
// description: 'Version created from CSDR',
|
|
108
|
+
// releaseDate: moment().format('YYYY-MM-DD')
|
|
109
|
+
// });
|
|
110
|
+
|
|
111
|
+
// return doCall({ method: 'POST', url: `version`, data: postData });
|
|
112
|
+
// })
|
|
113
|
+
// .then((response) => {
|
|
114
|
+
// tools.logSuccess(`OK ${response.status}`);
|
|
115
|
+
// return response;
|
|
116
|
+
// })
|
|
117
|
+
// .catch((e) => {
|
|
118
|
+
// tools.logError(`ERROR ${e.response.status}`);
|
|
119
|
+
// throw e;
|
|
120
|
+
// })
|
|
121
|
+
// }
|
|
122
|
+
// })
|
|
123
|
+
|
|
124
|
+
// .catch((e) => {
|
|
125
|
+
// throw e;
|
|
126
|
+
// });
|
|
127
|
+
// }
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
// const doCall = (options) => {
|
|
135
|
+
// const JIRA_BASE_URL = 'https://webgate.ec.europa.eu/CITnet/jira/rest/api/2/';
|
|
136
|
+
// const { jiraUser, jiraPassword } = tools.getArgs();
|
|
137
|
+
|
|
138
|
+
// axios.defaults.headers.post['Content-Type'] = 'application/json';
|
|
139
|
+
// axios.defaults.headers.put['Content-Type'] = 'application/json';
|
|
140
|
+
|
|
141
|
+
// return Promise.resolve()
|
|
142
|
+
// .then(() => {
|
|
143
|
+
// return axios({
|
|
144
|
+
// baseURL: JIRA_BASE_URL,
|
|
145
|
+
// url: options.url,
|
|
146
|
+
// method: options.method,
|
|
147
|
+
// data: options.data || {},
|
|
148
|
+
// auth: {
|
|
149
|
+
// username: jiraUser,
|
|
150
|
+
// password: jiraPassword
|
|
151
|
+
// }
|
|
152
|
+
// })
|
|
153
|
+
// .then((response) => {
|
|
154
|
+
// return response;
|
|
155
|
+
// })
|
|
156
|
+
// .catch((e) => {
|
|
157
|
+
// throw e;
|
|
158
|
+
// });
|
|
159
|
+
// })
|
|
160
|
+
// }
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
// module.exports = {
|
|
164
|
+
// getProject,
|
|
165
|
+
// getIssue,
|
|
166
|
+
// updateIssueVersion,
|
|
167
|
+
// createVersion,
|
|
168
|
+
// }
|
|
169
169
|
|
|
@@ -1,153 +1,153 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const jiraUtils = require('./jira-utils');
|
|
4
|
-
const metadataUtils = require('../metadata/metadata-utils');
|
|
5
|
-
|
|
6
|
-
const tools = require('../../utils/tools');
|
|
7
|
-
const configUtils = require('../config/config-utils');
|
|
8
|
-
|
|
9
|
-
const { project, appVersion } = tools.getArgs();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
module.exports.update = () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
3
|
+
// const jiraUtils = require('./jira-utils');
|
|
4
|
+
// const metadataUtils = require('../metadata/metadata-utils');
|
|
5
|
+
|
|
6
|
+
// const tools = require('../../utils/tools');
|
|
7
|
+
// const configUtils = require('../config/config-utils');
|
|
8
|
+
|
|
9
|
+
// const { project, appVersion } = tools.getArgs();
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// module.exports.update = () => {
|
|
13
|
+
|
|
14
|
+
// tools.logTitle('Starting jira update');
|
|
15
|
+
|
|
16
|
+
// if (!appVersion || !project) {
|
|
17
|
+
// throw new Error('project and appVersion arguments expected');
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
// var validIssues;
|
|
21
|
+
|
|
22
|
+
// return Promise.resolve()
|
|
23
|
+
// // cloning metadata repository
|
|
24
|
+
// .then(() => {
|
|
25
|
+
// return metadataUtils.common.cloneMetadataRepo();
|
|
26
|
+
// })
|
|
27
|
+
|
|
28
|
+
// // retrieving build history for version
|
|
29
|
+
// .then(() => {
|
|
30
|
+
// tools.logInfo(`Retrieving project infos for ${project}`);
|
|
31
|
+
|
|
32
|
+
// const prj = configUtils.projects.getCsdrProject(project);
|
|
33
|
+
// console.log(prj);
|
|
34
|
+
// return metadataUtils.appHistory.getMetadata(prj);
|
|
35
|
+
// })
|
|
36
|
+
|
|
37
|
+
// // getting specific version metadata history
|
|
38
|
+
// .then((metadata) => {
|
|
39
|
+
// if (!metadata) {
|
|
40
|
+
// tools.logInfo('No metadata found for project... skipping');
|
|
41
|
+
// process.exit(0);
|
|
42
|
+
// }
|
|
43
|
+
|
|
44
|
+
// tools.logInfo(`Fetching metadata history for version : ${appVersion}`);
|
|
45
|
+
|
|
46
|
+
// // getting the version history for the appVersion provided
|
|
47
|
+
// const versionHistory = metadata.versions.filter((v) => {
|
|
48
|
+
// return v.name === appVersion
|
|
49
|
+
// })[0];
|
|
50
|
+
|
|
51
|
+
// // checking if it contains diffs metadata
|
|
52
|
+
// if (!versionHistory || versionHistory.diffs.length === 0) {
|
|
53
|
+
// tools.logInfo('No history detected for this version ... skipping');
|
|
54
|
+
// process.exit(0);
|
|
55
|
+
|
|
56
|
+
// // proceed to extraction
|
|
57
|
+
// } else {
|
|
58
|
+
// var jiraIssues = [];
|
|
59
|
+
|
|
60
|
+
// versionHistory.diffs.forEach((diffSet) => {
|
|
61
|
+
// diffSet.gitMetadata.forEach((commits) => {
|
|
62
|
+
// commits.forEach((commit) => {
|
|
63
|
+
// if (commit.issue !== '') {
|
|
64
|
+
// jiraIssues.push(commit.issue);
|
|
65
|
+
// }
|
|
66
|
+
// })
|
|
67
|
+
// })
|
|
68
|
+
// })
|
|
69
|
+
|
|
70
|
+
// // remove duplicates
|
|
71
|
+
// jiraIssues = jiraIssues.filter((elem, pos, arr) => {
|
|
72
|
+
// return arr.indexOf(elem) == pos;
|
|
73
|
+
// });
|
|
74
|
+
|
|
75
|
+
// return jiraIssues
|
|
76
|
+
// }
|
|
77
|
+
// })
|
|
78
|
+
|
|
79
|
+
// .then((issues) => {
|
|
80
|
+
// tools.logSuccess('Issues found : ');
|
|
81
|
+
// console.log(issues);
|
|
82
|
+
|
|
83
|
+
// var checkedIssues = [];
|
|
84
|
+
|
|
85
|
+
// return Promise.resolve()
|
|
86
|
+
// .then(() => {
|
|
87
|
+
// return issues.reduce((promise, issue) => {
|
|
88
|
+
// return promise
|
|
89
|
+
// .then(() => jiraUtils.getIssue(issue))
|
|
90
|
+
// .then((response) => {
|
|
91
|
+
// checkedIssues.push({ key: issue, status: 'OK' });
|
|
92
|
+
// tools.logSuccess(`Issue: ${issue} / status OK`);
|
|
93
|
+
// })
|
|
94
|
+
// .catch((e) => {
|
|
95
|
+
// checkedIssues.push({ key: issue, status: e.response.status === 404 ? 'NOT_FOUND' : e.response.status.toString() });
|
|
96
|
+
// tools.logWarning(`Issue: ${issue} / status ${e.response.status}`);
|
|
97
|
+
// console.log(e.response);
|
|
98
|
+
// });
|
|
99
|
+
// }, Promise.resolve());
|
|
100
|
+
// })
|
|
101
|
+
|
|
102
|
+
// // filter existing issues only
|
|
103
|
+
// .then(() => {
|
|
104
|
+
// return checkedIssues.filter((i) => {
|
|
105
|
+
// return i.status === 'OK';
|
|
106
|
+
// });
|
|
107
|
+
// })
|
|
108
|
+
|
|
109
|
+
// .catch((e) => {
|
|
110
|
+
// throw e;
|
|
111
|
+
// })
|
|
112
|
+
// })
|
|
113
|
+
|
|
114
|
+
// // storing for later use
|
|
115
|
+
// .then((issues) => {
|
|
116
|
+
// tools.logInfo('Valid issues found : ');
|
|
117
|
+
|
|
118
|
+
// if (issues.length > 0) {
|
|
119
|
+
// validIssues = issues
|
|
120
|
+
// console.log(validIssues);
|
|
121
|
+
|
|
122
|
+
// } else {
|
|
123
|
+
// console.log('NO valid issues found...skipping');
|
|
124
|
+
// process.exit(0);
|
|
125
|
+
// }
|
|
126
|
+
// })
|
|
127
|
+
|
|
128
|
+
// // create / fetch version
|
|
129
|
+
// // .then(() => {
|
|
130
|
+
// // return jiraUtils.createVersion('MWP', appVersion);
|
|
131
|
+
// // })
|
|
132
|
+
|
|
133
|
+
// // // update issues version
|
|
134
|
+
// // .then(() => {
|
|
135
|
+
// // return validIssues.reduce((promise, issue) => {
|
|
136
|
+
// // return promise
|
|
137
|
+
// // .then(() => jiraUtils.updateIssueVersion(issue.key, appVersion))
|
|
138
|
+
// // .then((response) => {
|
|
139
|
+
// // tools.logSuccess(`${issue} updated with version ${appVersion} => ${response.status}`);
|
|
140
|
+
// // })
|
|
141
|
+
// // .catch((e) => {
|
|
142
|
+
// // tools.logError(`Error updating issue ${issue.key} => ${e.response.status}`);
|
|
143
|
+
// // console.log(e);
|
|
144
|
+
// // });
|
|
145
|
+
// // }, Promise.resolve());
|
|
146
|
+
// // })
|
|
147
|
+
|
|
148
|
+
// .catch((e) => {
|
|
149
|
+
// console.log(e);
|
|
150
|
+
// process.exit(1);
|
|
151
|
+
// })
|
|
152
|
+
// }
|
|
153
153
|
|