@mojaloop/central-services-shared 18.1.0 → 18.1.2-snapshot.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/.circleci/config.yml +4 -4
- package/.versionrc +15 -0
- package/CHANGELOG.md +7 -0
- package/README.md +8 -8
- package/package.json +3 -3
- package/src/util/kafka/index.js +10 -9
package/.circleci/config.yml
CHANGED
|
@@ -48,7 +48,7 @@ defaults_npm_publish_release: &defaults_npm_publish_release
|
|
|
48
48
|
defaults_export_version_from_package: &defaults_export_version_from_package
|
|
49
49
|
name: Format the changelog into the github release body and get release tag
|
|
50
50
|
command: |
|
|
51
|
-
git diff --no-indent-heuristic
|
|
51
|
+
git diff --no-indent-heuristic main~1 HEAD CHANGELOG.md | sed -n '/^+[^+]/ s/^+//p' > /tmp/changes
|
|
52
52
|
echo 'export RELEASE_CHANGES=`cat /tmp/changes`' >> $BASH_ENV
|
|
53
53
|
echo 'export RELEASE_TAG=`cat package-lock.json | jq -r .version`' >> $BASH_ENV
|
|
54
54
|
|
|
@@ -512,7 +512,7 @@ workflows:
|
|
|
512
512
|
ignore:
|
|
513
513
|
- /feature*/
|
|
514
514
|
- /bugfix*/
|
|
515
|
-
# New commits to
|
|
515
|
+
# New commits to main release automatically
|
|
516
516
|
- release:
|
|
517
517
|
context: org-global
|
|
518
518
|
requires:
|
|
@@ -526,7 +526,7 @@ workflows:
|
|
|
526
526
|
filters:
|
|
527
527
|
branches:
|
|
528
528
|
only:
|
|
529
|
-
-
|
|
529
|
+
- main
|
|
530
530
|
- /release\/v.*/
|
|
531
531
|
- github-release:
|
|
532
532
|
context: org-global
|
|
@@ -535,7 +535,7 @@ workflows:
|
|
|
535
535
|
filters:
|
|
536
536
|
branches:
|
|
537
537
|
only:
|
|
538
|
-
-
|
|
538
|
+
- main
|
|
539
539
|
- /release\/v.*/
|
|
540
540
|
- publish:
|
|
541
541
|
context: org-global
|
package/.versionrc
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"types": [
|
|
3
|
+
{"type": "feat", "section": "Features"},
|
|
4
|
+
{"type": "fix", "section": "Bug Fixes"},
|
|
5
|
+
{"type": "docs", "section": "Documentation"},
|
|
6
|
+
{"type": "style", "section": "Styling"},
|
|
7
|
+
{"type": "refactor", "section": "Refactors"},
|
|
8
|
+
{"type": "perf", "section": "Performance"},
|
|
9
|
+
{"type": "test", "section": "Tests"},
|
|
10
|
+
{"type": "build", "section": "Build System"},
|
|
11
|
+
{"type": "ci", "section": "CI"},
|
|
12
|
+
{"type": "chore", "section": "Chore"},
|
|
13
|
+
{"type": "revert", "section": "Reverts"}
|
|
14
|
+
]
|
|
15
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [18.1.1](https://github.com/mojaloop/central-services-shared/compare/v18.1.0...v18.1.1) (2023-09-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Chore
|
|
9
|
+
|
|
10
|
+
* migrate master to main ([#352](https://github.com/mojaloop/central-services-shared/issues/352)) ([80aeece](https://github.com/mojaloop/central-services-shared/commit/80aeecee5657ddb2243b18536d1045efb044bb17))
|
|
11
|
+
|
|
5
12
|
## [18.1.0](https://github.com/mojaloop/central-services-shared/compare/v18.0.0...v18.1.0) (2023-09-06)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# central-services-shared
|
|
2
|
-
[](https://github.com/mojaloop/central-services-shared/commits/
|
|
2
|
+
[](https://github.com/mojaloop/central-services-shared/commits/main)
|
|
3
3
|
[](https://github.com/mojaloop/central-services-shared/releases)
|
|
4
4
|
[](https://www.npmjs.com/package/@mojaloop/central-services-shared)
|
|
5
5
|
[](https://www.npmjs.com/package/@mojaloop/central-services-shared)
|
|
@@ -31,26 +31,26 @@ As part of our CI/CD process, we use a combination of CircleCI, standard-version
|
|
|
31
31
|
npm package and github-release CircleCI orb to automatically trigger our releases
|
|
32
32
|
and image builds. This process essentially mimics a manual tag and release.
|
|
33
33
|
|
|
34
|
-
On a merge to
|
|
34
|
+
On a merge to main, CircleCI is configured to use the mojaloopci github account
|
|
35
35
|
to push the latest generated CHANGELOG and package version number.
|
|
36
36
|
|
|
37
|
-
Once those changes are pushed, CircleCI will pull the updated
|
|
37
|
+
Once those changes are pushed, CircleCI will pull the updated main, tag and
|
|
38
38
|
push a release triggering another subsequent build that also publishes a docker image.
|
|
39
39
|
|
|
40
40
|
### Potential problems
|
|
41
41
|
|
|
42
|
-
* There is a case where the merge to
|
|
42
|
+
* There is a case where the merge to main workflow will resolve successfully, triggering
|
|
43
43
|
a release. Then that tagged release workflow subsequently failing due to the image scan,
|
|
44
44
|
audit check, vulnerability check or other "live" checks.
|
|
45
45
|
|
|
46
|
-
This will leave
|
|
46
|
+
This will leave main without an associated published build. Fixes that require
|
|
47
47
|
a new merge will essentially cause a skip in version number or require a clean up
|
|
48
|
-
of the
|
|
48
|
+
of the main branch to the commit before the CHANGELOG and bump.
|
|
49
49
|
|
|
50
50
|
This may be resolved by relying solely on the previous checks of the
|
|
51
|
-
merge to
|
|
51
|
+
merge to main workflow to assume that our tagged release is of sound quality.
|
|
52
52
|
We are still mulling over this solution since catching bugs/vulnerabilities/etc earlier
|
|
53
53
|
is a boon.
|
|
54
54
|
|
|
55
|
-
* It is unknown if a race condition might occur with multiple merges with
|
|
55
|
+
* It is unknown if a race condition might occur with multiple merges with main in
|
|
56
56
|
quick succession, but this is a suspected edge case.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/central-services-shared",
|
|
3
|
-
"version": "18.1.0",
|
|
3
|
+
"version": "18.1.2-snapshot.0",
|
|
4
4
|
"description": "Shared code for mojaloop central services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "ModusBox",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"audit-ci": "^6.6.1",
|
|
77
77
|
"base64url": "3.0.1",
|
|
78
78
|
"chance": "1.1.11",
|
|
79
|
-
"npm-check-updates": "16.
|
|
79
|
+
"npm-check-updates": "16.14.2",
|
|
80
80
|
"nyc": "15.1.0",
|
|
81
81
|
"pre-commit": "1.2.2",
|
|
82
82
|
"proxyquire": "2.1.3",
|
|
83
83
|
"replace": "^1.2.2",
|
|
84
84
|
"rewire": "7.0.0",
|
|
85
|
-
"sinon": "
|
|
85
|
+
"sinon": "16.0.0",
|
|
86
86
|
"standard": "17.1.0",
|
|
87
87
|
"standard-version": "9.5.0",
|
|
88
88
|
"tap-spec": "^5.0.0",
|
package/src/util/kafka/index.js
CHANGED
|
@@ -159,8 +159,9 @@ const getKafkaConfig = (kafkaConfig, flow, functionality, action) => {
|
|
|
159
159
|
* @param {string} participantName - The participant name
|
|
160
160
|
* @param {string} functionality - the functionality flow. Example: 'transfer' ie: note the case of text
|
|
161
161
|
* @param {string} action - the action that applies to the flow. Example: 'prepare' ie: note the case of text
|
|
162
|
-
* @param {
|
|
163
|
-
* @param {
|
|
162
|
+
* @param {string} [key] - optional key that allows partitioning it occur
|
|
163
|
+
* @param {number} [partition] - optional partition to produce to
|
|
164
|
+
* @param {*} [opaqueKey] - optional opaque token, which gets passed along to your delivery reports
|
|
164
165
|
*
|
|
165
166
|
* @returns {object} - Returns newly created participant topicConfig
|
|
166
167
|
*/
|
|
@@ -179,10 +180,10 @@ const createParticipantTopicConf = (template, participantName, functionality, ac
|
|
|
179
180
|
* @param {string} template - The template for that needs to be populated
|
|
180
181
|
* @param {string} functionality - the functionality flow. Example: 'transfer' ie: note the case of text
|
|
181
182
|
* @param {string} action - the action that applies to the flow. Example: 'prepare' ie: note the case of text
|
|
182
|
-
* @param {string} key - optional key that allows partitioning it occur
|
|
183
|
-
* @param {number} partition - optional partition to produce to
|
|
184
|
-
* @param {*} opaqueKey - optional opaque token, which gets passed along to your delivery reports
|
|
185
|
-
* @param {string} topicNameOverride - optional topic name override that skips topic name rendering
|
|
183
|
+
* @param {string} [key] - optional key that allows partitioning it occur
|
|
184
|
+
* @param {number} [partition] - optional partition to produce to
|
|
185
|
+
* @param {*} [opaqueKey] - optional opaque token, which gets passed along to your delivery reports
|
|
186
|
+
* @param {string} [topicNameOverride] - optional topic name override that skips topic name rendering
|
|
186
187
|
*
|
|
187
188
|
* @returns {object} - Returns newly created general topicConfig
|
|
188
189
|
*/
|
|
@@ -222,9 +223,9 @@ const getFunctionalityAction = (functionality, action) => {
|
|
|
222
223
|
* @param {string} action - the action that applies to the flow. Example: 'prepare' ie: note the case of text
|
|
223
224
|
* @param {object} message - a list of messages to consume for the relevant topic
|
|
224
225
|
* @param {object} state - state of the message being produced
|
|
225
|
-
* @param {string} key - optional key that allows partitioning it occur
|
|
226
|
-
* @param {object} span - the span for event logging
|
|
227
|
-
* @param {string} topicNameOverride - optional topic name override that skips topic name rendering
|
|
226
|
+
* @param {string} [key] - optional key that allows partitioning it occur
|
|
227
|
+
* @param {object} [span] - the span for event logging
|
|
228
|
+
* @param {string} [topicNameOverride] - optional topic name override that skips topic name rendering
|
|
228
229
|
*
|
|
229
230
|
* @returns {object} - Returns a boolean: true if successful, or throws and error if failed
|
|
230
231
|
*/
|