Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mojaloop/#2536): fspiop api version negotiation not handled by transfers service #487

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7cd7f29
chore: added standard-version dev dependency, and npm script for rele…
mdebarros Oct 5, 2021
33fd74e
chore: ci-cd improvements
mdebarros Oct 5, 2021
158dfd2
chore: updated dependencies
mdebarros Oct 5, 2021
89f74e3
reverted dep update for get-port as it requires ES6 features
mdebarros Oct 5, 2021
95a9c4d
chore: grouped related npm scripts
mdebarros Oct 5, 2021
2c34d75
chore: updated npm test script
mdebarros Oct 11, 2021
c047bd4
fix(mojaloop/#2536): fspiop api version negotiation not handled by tr…
mdebarros Oct 12, 2021
d6de861
Updated dependencies, fFixes for audit-resolve, Added get-port to ncu…
mdebarros Oct 12, 2021
75b0e1f
fixes for audit-resolve
mdebarros Oct 12, 2021
af5f8b8
audit-resolve fixes
mdebarros Oct 12, 2021
13d34d7
updated dependencies
mdebarros Oct 18, 2021
d5a35f8
made v1.1 the accept and content type in default.json
mdebarros Oct 18, 2021
79c9891
made v1.1 the accept and content type in default.json
mdebarros Oct 18, 2021
1e30d8e
updated integration test config
mdebarros Oct 19, 2021
488b0e4
Added DEFAULT_PROTOCOL_VERSION
mdebarros Oct 20, 2021
e51b13e
added support for setting env var MLAPI_PROTOCOL_VERSIONS__ACCEPT__VA…
mdebarros Oct 29, 2021
8e1667f
update dependencies & fixed audit-resolve issues
mdebarros Oct 29, 2021
56dac8d
minor fix for default PROTOCOL_VERSIONS config
mdebarros Oct 29, 2021
17be5b2
fixes for config
mdebarros Oct 29, 2021
83a99d0
fixes for unit test coverage
mdebarros Nov 1, 2021
9cbb93b
functionized the config logic for getProtocolVersions
mdebarros Nov 2, 2021
a296735
functionized the config logic for getProtocolVersions
mdebarros Nov 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 98 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ orbs:
deploy-kube: mojaloop/deployment@0.1.6
slack: circleci/slack@3.4.2
pr-tools: mojaloop/pr-tools@0.1.8
github-release: h-matsuo/github-release@0.1.3

##
# defaults
Expand Down Expand Up @@ -86,7 +87,7 @@ jobs:
name: Delete build dependencies
command: apk del build-dependencies
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
paths:
- node_modules

Expand All @@ -98,7 +99,7 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Install tape and tap-xunit
command: npm install tape tap-xunit
Expand Down Expand Up @@ -128,9 +129,7 @@ jobs:
name: Install AWS CLI dependencies
command: *defaults_awsCliDependencies
- restore_cache:
keys:
- dependency-cache-{{ checksum "package.json" }}
- dependency-cache-
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Execute code coverage check
command: npm -s run test:coverage-check
Expand All @@ -154,7 +153,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Create dir for test results
command: mkdir -p ./test/results
Expand All @@ -181,7 +180,7 @@ jobs:
chmod +x ~/docker-compose
mv ~/docker-compose /usr/local/bin/docker-compose
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Create dir for test results
command: mkdir -p ./test/results
Expand All @@ -202,7 +201,7 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Create dir for test results
command: mkdir -p ./audit/results
Expand All @@ -223,7 +222,7 @@ jobs:
- run:
<<: *defaults_license_scanner
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Prune non-production packages before running license-scanner
command: npm prune --production
Expand Down Expand Up @@ -354,24 +353,71 @@ jobs:
docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$CIRCLE_TAG
echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG"
docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG
- slack/status:
webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT"
success_message: '*"${CIRCLE_PROJECT_REPONAME}"* - Release \`"${CIRCLE_TAG}"\` \nhttps://github.com/mojaloop/"${CIRCLE_PROJECT_REPONAME}"/releases/tag/"${CIRCLE_TAG}"'

deploy:
executor: deploy-kube/helm-kube
release:
executor: default-docker
steps:
- run:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- deploy-kube/setup_and_run:
helm_set_values: |
--set ml-api-adapter.ml-api-adapter-service.image.repository=$DOCKER_ORG/$CIRCLE_PROJECT_REPONAME \
--set ml-api-adapter.ml-api-adapter-service.image.tag=$CIRCLE_TAG \
--set ml-api-adapter.ml-api-adapter-handler-notification.image.repository=$DOCKER_ORG/$CIRCLE_PROJECT_REPONAME \
--set ml-api-adapter.ml-api-adapter-handler-notification.image.tag=$CIRCLE_TAG
- restore_cache:
keys:
- dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Configure git
command: |
git config user.email ${GIT_CI_EMAIL}
git config user.name ${GIT_CI_USER}
git checkout ${CIRCLE_BRANCH}
- run:
name: Configure ssh
command: |
mkdir -p ~/.ssh
ssh-keyscan -p 443 ssh.github.com >> ~/.ssh/known_hosts
ssh-keyscan github.com >> ~/.ssh/known_hosts
- run:
name: Generate changelog and bump package version
command: npm run release
- run:
name: Push the release
command: git push --follow-tags origin ${CIRCLE_BRANCH}

github-release:
executor: default-machine
steps:
- run:
name: Install git
command: |
sudo apt-get update && sudo apt-get install -y git
- checkout
- run:
name: Fetch updated release branch
command: |
git config user.email ${GIT_CI_EMAIL}
git config user.name ${GIT_CI_USER}
git fetch origin
git checkout origin/${CIRCLE_BRANCH}
- run:
# Note: this is rather imperfect, but will do for now
name: Format the changelog into the github release body and get release tag
command: |
git diff --no-indent-heuristic master~1 HEAD CHANGELOG.md | sed -n '/^+[^+]/ s/^+//p' > /tmp/changes
echo 'export RELEASE_CHANGES=`cat /tmp/changes`' >> $BASH_ENV
echo 'export RELEASE_TAG=`cat package-lock.json | jq -r .version`' >> $BASH_ENV
- run:
name: check the release changes
command: |
echo "Changes are: ${RELEASE_CHANGES}"
- github-release/create:
github-token-variable: ${GITHUB_TOKEN}
tag: v${RELEASE_TAG}
title: v${RELEASE_TAG} Release
description: ${RELEASE_CHANGES}
file-path: CHANGELOG.md
- slack/status:
fail_only: true
webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT"
failure_message: 'TEST Deployment failed for: \`"${DOCKER_ORG}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}"\`'
success_message: '*"${CIRCLE_PROJECT_REPONAME}"* - Release \`"v${RELEASE_TAG}"\` \nhttps://github.com/mojaloop/"${CIRCLE_PROJECT_REPONAME}"/releases/tag/"v${RELEASE_TAG}"'

##
# Workflows
Expand Down Expand Up @@ -495,24 +541,46 @@ workflows:
branches:
ignore:
- /.*/
- publish:
# New commits to master release automatically
- release:
context: org-global
requires:
- pr-tools/pr-title-check
- test-unit
- test-coverage
- vulnerability-check
- audit-licenses
- test-integration
- license-scan
- image-scan
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot(\.[0-9]+)?)?(\-hotfix(\.[0-9]+)?)?(\-perf(\.[0-9]+)?)?/
branches:
ignore:
- /.*/
- deploy:
only:
- master
- /release\/v.*/
- github-release:
context: org-global
requires:
- publish
- release
filters:
branches:
only:
- master
- /release\/v.*/
- publish:
context: org-global
requires:
- pr-tools/pr-title-check
- test-unit
- test-coverage
- vulnerability-check
- audit-licenses
- test-integration
- license-scan
- image-scan
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot(\.[0-9]+)?)?/
only: /v[0-9]+(\.[0-9]+)*(\-snapshot(\.[0-9]+)?)?(\-hotfix(\.[0-9]+)?)?(\-perf(\.[0-9]+)?)?/
branches:
ignore:
- /.*/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jspm_packages

.npmrc

# yarn
yarn.lock

# --------------- #
# IntelliJ #
# --------------- #
Expand Down
2 changes: 1 addition & 1 deletion .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"reject": [

"get-port"
]
}
90 changes: 17 additions & 73 deletions audit-resolve.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,33 @@
{
"decisions": {
"1594|@mojaloop/central-services-health>@mojaloop/central-services-shared>axios": {
"decision": "fix",
"madeAt": 1611105975153
},
"1500|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"1002401|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1633094247366,
"expiresAt": 1633699011929
"madeAt": 1635502412563,
"expiresAt": 1638094392966
},
"1500|@mojaloop/central-services-health>@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"1002401|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1616649465968,
"expiresAt": 1619241438761
},
"1179|faucet>minimist": {
"decision": "postpone",
"madeAt": 1612532946083
},
"1640|@mojaloop/central-services-health>@mojaloop/central-services-shared>widdershins>urijs": {
"decision": "fix",
"madeAt": 1616649452109
},
"1640|@mojaloop/central-services-shared>widdershins>urijs": {
"decision": "fix",
"madeAt": 1616649452109
"madeAt": 1635502412563,
"expiresAt": 1638094392966
},
"1673|@mojaloop/central-services-shared>data-urls>whatwg-url>lodash": {
"1002401|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>npmlog>gauge>wide-align>string-width>strip-ansi>ansi-regex": {
"decision": "fix",
"madeAt": 1623061356257
"madeAt": 1635502409011
},
"1673|@mojaloop/central-services-shared>openapi-backend>lodash": {
"decision": "fix",
"madeAt": 1623061356257
},
"1673|@mojaloop/central-services-shared>openapi-backend>mock-json-schema>lodash": {
"decision": "fix",
"madeAt": 1623061356257
},
"1673|@mojaloop/central-services-shared>shins>sanitize-html>lodash": {
"decision": "fix",
"madeAt": 1623061356257
},
"1673|@mojaloop/forensic-logging-client>@mojaloop/central-services-logger>winston>async>lodash": {
"decision": "fix",
"madeAt": 1623061356257
},
"1675|@mojaloop/central-services-shared>shins>sanitize-html": {
"1002865|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1633094250792,
"expiresAt": 1633699011929
"madeAt": 1635502414290,
"expiresAt": 1638094392966
},
"1676|@mojaloop/central-services-shared>shins>sanitize-html": {
"1002866|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1633094250792,
"expiresAt": 1633699011929
"madeAt": 1635502414290,
"expiresAt": 1638094392966
},
"1693|@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
"1003019|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1623061363001,
"expiresAt": 1623666143320
},
"1751|@mojaloop/central-services-shared>shins>chokidar>glob-parent": {
"decision": "fix",
"madeAt": 1623245154119
},
"1770|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
"decision": "fix",
"madeAt": 1633094239947
},
"1771|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
"decision": "fix",
"madeAt": 1633094239947
},
"1779|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
"decision": "fix",
"madeAt": 1633094239947
},
"1780|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
"decision": "fix",
"madeAt": 1633094239947
},
"1781|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>tar": {
"decision": "fix",
"madeAt": 1633094239947
"madeAt": 1635502416375,
"expiresAt": 1638094392966
}
},
"rules": {},
Expand Down
9 changes: 9 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
"expiresIn": 180000,
"generateTimeout": 30000
},
"PROTOCOL_VERSIONS": {
"CONTENT": "1.1",
"ACCEPT": {
"VALIDATELIST": [
"1",
"1.1"
]
}
},
"ENDPOINT_SECURITY":{
"TLS": {
"rejectUnauthorized": true
Expand Down
Loading