@eui/tools 5.1.4 → 5.1.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.
@@ -1 +1 @@
1
- 5.1.4
1
+ 5.1.7
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 5.1.7 (2022-04-28)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * wrong call to app.getCurrentVersion - broken generateDiffReport for master remote release - EUI-5632 [EUI-5632](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5632) ([1a6d6328](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/1a6d63285136f0aa8ade7e526a5bc90562c76af3))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.1.6 (2022-04-28)
11
+
12
+ ##### Bug Fixes
13
+
14
+ * **other:**
15
+ * wrong call to app.getCurrentVersion - broken generateDiffReport for master remote release - EUI-5632 [EUI-5632](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5632) ([4ef345fe](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/4ef345feb678b416924f87593d9ce860b38aff15))
16
+
17
+ * * *
18
+ * * *
19
+ ## 5.1.5 (2022-04-28)
20
+
21
+ ##### Bug Fixes
22
+
23
+ * **other:**
24
+ * old remote delivery issues on version upgrade - adapted metadata version for app delivery - EUI-5632 [EUI-5632](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5632) ([0499f9f0](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/0499f9f0ba9b4df56c39773922a3f721476e9a82))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 5.1.4 (2022-04-28)
2
29
 
3
30
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.1.4",
3
+ "version": "5.1.7",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -54,7 +54,7 @@ module.exports.storeMetadata = (project, newVersion, envTarget) => {
54
54
  }
55
55
 
56
56
  versions.push({
57
- name: newVersion,
57
+ version: newVersion,
58
58
  releaseDate: appReleaseDate,
59
59
  envTarget: envTarget
60
60
  });
@@ -270,21 +270,6 @@ module.exports.storeMetadata = (
270
270
  }
271
271
  })
272
272
 
273
- .then(() => {
274
- if (isMaster && pkg.remote) {
275
- return innerCommon.generateDiffReport(pkg, pkgVersion);
276
- }
277
- })
278
-
279
- .then(() => {
280
- tools.logTitle('Commiting metadata info');
281
- return gitUtils.commitAndPush(
282
- 'master',
283
- `chore: update metadata for ${pkg.name}-${pkgVersion}`,
284
- configOptions.DEVOPS_METADATA_PATH
285
- );
286
- })
287
-
288
273
  .then(() => {
289
274
  tools.logSuccess();
290
275
  })
@@ -9,6 +9,7 @@ const utils = require('../../../utils');
9
9
  // CSDR RELATED
10
10
  const metadataUtils = require('../../metadata/metadata-utils');
11
11
  const versionUtils = require('../../version/version-utils');
12
+ const configUtils = require('../../config/config-utils');
12
13
 
13
14
  // GLOBAL ARGS
14
15
  const { dryRun } = utils.tools.getArgs();
@@ -460,6 +461,63 @@ module.exports.storeMetadata = (pkg, version, pkgMetadata, pkgCompositeDeps, dur
460
461
  }
461
462
 
462
463
 
464
+ module.exports.generateDiffReport = (pkg, newVersion) => {
465
+ utils.tools.logBanner('GENERATE DIFF REPORT');
466
+
467
+ const branches = this.getBranches();
468
+
469
+ return Promise.resolve()
470
+ .then(() => {
471
+ return metadataUtils.packageHistory.generateDiffReport(pkg);
472
+ })
473
+
474
+ .then((diffMetadata) => {
475
+ if (diffMetadata) {
476
+ return Promise.resolve()
477
+ .then(() => {
478
+ return metadataUtils.packageHistory.flattenDiffMetadata(diffMetadata);
479
+ })
480
+
481
+ .then((flatDiffMetadata) => {
482
+ return utils.notification.package.sendPackageDiffReportMessage(
483
+ pkg,
484
+ flatDiffMetadata
485
+ );
486
+ })
487
+
488
+ .then(() => {
489
+ return metadataUtils.packageHistory.storeMetadata(pkg, diffMetadata, newVersion);
490
+ })
491
+ }
492
+ })
493
+
494
+ .catch((e) => {
495
+ throw e;
496
+ })
497
+ }
498
+
499
+ module.exports.commitMetadata = (pkg, version) => {
500
+
501
+ const configOptions = configUtils.global.getConfigOptions();
502
+
503
+ return Promise.resolve()
504
+ .then(() => {
505
+ utils.tools.logTitle('Commiting metadata info');
506
+
507
+ return gitUtils.commitAndPush(
508
+ 'master',
509
+ `chore: update metadata for ${pkg.name}-${version}`,
510
+ configOptions.DEVOPS_METADATA_PATH
511
+ );
512
+ })
513
+
514
+ .catch((e) => {
515
+ throw e;
516
+ })
517
+ }
518
+
519
+
520
+
463
521
  module.exports.exportPipelineVariables = (pkg, compositeType) => {
464
522
  utils.tools.logBanner('EXPORT PIPELINE VARIABLES');
465
523
 
@@ -504,43 +562,6 @@ module.exports.exportPipelineVariables = (pkg, compositeType) => {
504
562
 
505
563
 
506
564
 
507
- module.exports.generateDiffReport = (pkg, newVersion) => {
508
- utils.tools.logBanner('GENERATE DIFF REPORT');
509
-
510
- const branches = this.getBranches();
511
-
512
- return Promise.resolve()
513
- .then(() => {
514
- return metadataUtils.packageHistory.generateDiffReport(pkg);
515
- })
516
-
517
- .then((diffMetadata) => {
518
- if (diffMetadata) {
519
- return Promise.resolve()
520
- .then(() => {
521
- return metadataUtils.packageHistory.flattenDiffMetadata(diffMetadata);
522
- })
523
-
524
- .then((flatDiffMetadata) => {
525
- return utils.notification.package.sendPackageDiffReportMessage(
526
- pkg,
527
- flatDiffMetadata
528
- );
529
- })
530
-
531
- .then(() => {
532
- return metadataUtils.packageHistory.storeMetadata(pkg, diffMetadata, newVersion);
533
- })
534
- }
535
- })
536
-
537
- .catch((e) => {
538
- throw e;
539
- })
540
- }
541
-
542
-
543
-
544
565
  module.exports.sendSuccessNotification = (pkg, version, pkgMetadata) => {
545
566
  utils.tools.logBanner('SEND SUCCESS NOTIFICATION');
546
567
 
@@ -167,13 +167,24 @@ module.exports.run = () => {
167
167
  return innerCommon.storeMetadata(pkg, newVersion, pkgMetadata, pkgCompositeDeps, duration, envTarget);
168
168
  })
169
169
 
170
+ // STORING PACKAGE HISTORY
171
+ .then(() => {
172
+ if (branches.isMaster && pkg.remote) {
173
+ return innerCommon.generateDiffReport(pkg, pkgVersion);
174
+ }
175
+ })
176
+
177
+ // COMMITING METADATA
178
+ .then(() => {
179
+ return innerCommon.commitMetadata(pkg, pkgVersion);
180
+ })
181
+
170
182
 
171
183
  // EXPORT ADDITIONAL PIPELINE VARIABLES
172
184
  .then(() => {
173
185
  return innerCommon.exportPipelineVariables(pkg, compositeType);
174
186
  })
175
187
 
176
-
177
188
  // SEND SUCCESS NOTIFICATION
178
189
  .then(() => {
179
190
  return innerCommon.sendSuccessNotification(pkg, newVersion, pkgMetadata)
@@ -11,6 +11,23 @@ const tools = require('../../utils/tools');
11
11
  const { dryRun } = tools.getArgs();
12
12
 
13
13
 
14
+ module.exports.getCurrentVersion = (project) => {
15
+ return Promise.resolve()
16
+ .then(() => {
17
+ let version;
18
+ const pathPkgJson = path.resolve(process.cwd(), project.folder, 'package.json');
19
+ const pkgJson = require(pathPkgJson);
20
+ version = pkgJson.version;
21
+
22
+ return version;
23
+ })
24
+
25
+ .catch((e) => {
26
+ throw e;
27
+ })
28
+ }
29
+
30
+
14
31
  module.exports.updatePackageVersion = (project, newVersion) => {
15
32
  return Promise.resolve()
16
33
  .then(() => {
@@ -15,23 +15,6 @@ const tools = require('../../utils/tools');
15
15
  const { dryRun } = tools.getArgs();
16
16
 
17
17
 
18
- module.exports.getCurrentVersion = (project) => {
19
- return Promise.resolve()
20
- .then(() => {
21
- let version;
22
- const pathPkgJson = path.resolve(process.cwd(), project.folder, 'package.json');
23
- const pkgJson = require(pathPkgJson);
24
- version = pkgJson.version;
25
-
26
- return version;
27
- })
28
-
29
- .catch((e) => {
30
- throw e;
31
- })
32
- }
33
-
34
-
35
18
  // for process v1 build, version is updated in the project package.json
36
19
  // new version is derived from there
37
20
 
@@ -22,4 +22,4 @@ module.exports.getNewVersion = (project, isSnapshot, isSupportBranch, envTarget)
22
22
 
23
23
  module.exports.updatePackageVersion = appCommon.updatePackageVersion;
24
24
 
25
- module.exports.getCurrentVersion = appCommon.getCurrentVersion;
25
+ module.exports.getCurrentVersion = appCommon.getCurrentVersion;
@@ -98,36 +98,47 @@ module.exports.getNewVersion = (
98
98
 
99
99
  tools.logInfo(`Current version found : ${currentVersion}`);
100
100
 
101
- const release = getReleaseType(commits);
102
- tools.logInfo('release info found : ' + JSON.stringify(release));
103
-
104
101
  let newVersion = '1.0.0';
105
102
 
106
- if (isNextBranch) {
107
- newVersion = semver.inc(currentVersion, 'prerelease');
108
- } else {
109
- newVersion = semver.valid(release.releaseType) || semver.inc(currentVersion, release.releaseType)
110
- }
103
+ if (commits) {
104
+ const release = getReleaseType(commits);
105
+ tools.logInfo('release info found : ' + JSON.stringify(release));
106
+
107
+ if (isNextBranch) {
108
+ newVersion = semver.inc(currentVersion, 'prerelease');
109
+ } else {
110
+ newVersion = semver.valid(release.releaseType) || semver.inc(currentVersion, release.releaseType)
111
+ }
111
112
 
112
- tools.logInfo('probable new version : ' + newVersion);
113
+ tools.logInfo('probable new version : ' + newVersion);
113
114
 
114
- if (isSnapshot) {
115
- if (pkg.backend) {
116
- if (pkg.build && pkg.build.nodejs) {
117
- newVersion += '-snapshot-' + Date.now();
115
+ if (isSnapshot) {
116
+ if (pkg.backend) {
117
+ if (pkg.build && pkg.build.nodejs) {
118
+ newVersion += '-snapshot-' + Date.now();
119
+ } else {
120
+ newVersion += '-SNAPSHOT';
121
+ }
118
122
  } else {
119
- newVersion += '-SNAPSHOT';
123
+ newVersion += '-snapshot-' + Date.now();
120
124
  }
121
- } else {
122
- newVersion += '-snapshot-' + Date.now();
125
+
126
+ } else if (isSupportBranch) {
127
+ if (pkg.backend) {
128
+ newVersion = semver.inc(currentVersion, 'prerelease');
129
+ }
130
+ } else if (isHotfixBranch) {
131
+ newVersion = semver.inc(currentVersion, 'prerelease');
123
132
  }
124
133
 
125
- } else if (isSupportBranch) {
126
- if (pkg.backend) {
134
+ } else {
135
+ tools.logInfo('No commits found for version processing...applying minor version upgrade');
136
+
137
+ if (isNextBranch) {
127
138
  newVersion = semver.inc(currentVersion, 'prerelease');
139
+ } else {
140
+ newVersion = semver.inc(currentVersion, 'minor');
128
141
  }
129
- } else if (isHotfixBranch) {
130
- newVersion = semver.inc(currentVersion, 'prerelease');
131
142
  }
132
143
 
133
144
  tools.logSuccess('new version generated : ' + newVersion);