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/#2538): fspiop api version negotiation not handled #67

145 changes: 126 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ version: 2.1
# Orbs used in this pipeline
###
orbs:
anchore: anchore/[email protected].0
anchore: anchore/[email protected].6
deploy-kube: mojaloop/[email protected]
slack: circleci/[email protected]
pr-tools: mojaloop/[email protected]

github-release: h-matsuo/[email protected]

##
# defaults
Expand Down Expand Up @@ -84,7 +84,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 @@ -96,7 +96,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 @@ -127,7 +127,7 @@ jobs:
command: *defaults_awsCliDependencies
- restore_cache:
keys:
- dependency-cache-{{ checksum "package.json" }}
- dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- dependency-cache-
- run:
name: Execute code coverage check
Expand Down Expand Up @@ -156,7 +156,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 @@ -177,7 +177,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 @@ -308,9 +308,9 @@ 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}"'
# - 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
Expand All @@ -327,6 +327,72 @@ jobs:
webhook: "$SLACK_WEBHOOK_ANNOUNCMENT_CI_CD"
failure_message: 'Deployment failed for: \`"${DOCKER_ORG}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}"\`'

release:
executor: default-docker
steps:
- run:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- 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:
webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT"
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 @@ -425,24 +491,65 @@ workflows:
branches:
ignore:
- /.*/
- publish:
# - publish:
# context: org-global
# requires:
# - license-scan
# - image-scan
# filters:
# tags:
# only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?/
# branches:
# ignore:
# - /.*/
# - deploy:
# context: org-global
# requires:
# - publish
# filters:
# tags:
# only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?/
# branches:
# ignore:
# - /.*/
# New commits to master release automatically
- release:
context: org-global
requires:
- pr-tools/pr-title-check
- test-unit
- test-coverage
- vulnerability-check
- audit-licenses
- license-scan
- image-scan
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?/
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
- license-scan
- image-scan
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?/
only: /v[0-9]+(\.[0-9]+)*(\-snapshot(\.[0-9]+)?)?(\-hotfix(\.[0-9]+)?)?(\-perf(\.[0-9]+)?)?/
branches:
ignore:
- /.*/
- /.*/
115 changes: 85 additions & 30 deletions audit-resolve.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,104 @@
{
"decisions": {
"1670|hapi-swagger>handlebars": {
"1002401|@mojaloop/event-sdk>@grpc/proto-loader>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1622650067303,
"expiresAt": 1623254853409
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1673|@mojaloop/central-services-shared>data-urls>whatwg-url>lodash": {
"decision": "fix",
"madeAt": 1622650207655
"1002401|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1673|@mojaloop/central-services-shared>openapi-backend>lodash": {
"decision": "fix",
"madeAt": 1622650207655
"1002401|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1673|@mojaloop/central-services-shared>openapi-backend>mock-json-schema>lodash": {
"decision": "fix",
"madeAt": 1622650207655
"1002401|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1673|@mojaloop/central-services-shared>shins>sanitize-html>lodash": {
"decision": "fix",
"madeAt": 1622650207655
"1002401|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1500|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"1002401|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>wrap-ansi>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1623313309752,
"expiresAt": 1623918091973
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1675|@mojaloop/central-services-shared>shins>sanitize-html": {
"1002401|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1623313315733,
"expiresAt": 1623918091973
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1676|@mojaloop/central-services-shared>shins>sanitize-html": {
"1002401|@mojaloop/central-services-shared>widdershins>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1623313315733,
"expiresAt": 1623918091973
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1693|@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
"1002401|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1623313317616,
"expiresAt": 1623918091973
"madeAt": 1637146427270,
"expiresAt": 1639738417576
},
"1751|@mojaloop/central-services-shared>shins>chokidar>glob-parent": {
"decision": "fix",
"madeAt": 1623313305724
"1002401|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>oas-resolver>yargs>cliui>wrap-ansi>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637146427271,
"expiresAt": 1639738417576
},
"1002401|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637146427271,
"expiresAt": 1639738417576
},
"1002401|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637145800269,
"expiresAt": 1639737725241
},
"1002401|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637145800269,
"expiresAt": 1639737725241
},
"1002865|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1637145802898,
"expiresAt": 1639737725241
},
"1002866|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1637145802898,
"expiresAt": 1639737725241
},
"1003019|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1637145805660,
"expiresAt": 1639737725241
},
"1004784|hapi-swagger>swagger-parser>z-schema>validator": {
"decision": "ignore",
"madeAt": 1637145808277,
"expiresAt": 1639737725241
},
"1004809|@mojaloop/central-services-shared>widdershins>openapi-sampler>json-pointer": {
"decision": "ignore",
"madeAt": 1637145811157,
"expiresAt": 1639737725241
},
"1004812|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1637145814138,
"expiresAt": 1639737725241
},
"1004812|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1637145814139,
"expiresAt": 1639737725241
}
},
"rules": {},
Expand Down
10 changes: 10 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"PORT": 3003,
"HOSTNAME": "http://bulk-api-adapter",
"PROTOCOL_VERSIONS": {
"CONTENT": "1.1",
"ACCEPT": {
"DEFAULT": "1",
"VALIDATELIST": [
"1",
"1.1"
]
}
},
"ENDPOINT_SOURCE_URL": "http://localhost:3001/participants/{{fsp}}/endpoints",
"ENDPOINT_HEALTH_URL": "http://localhost:3001/health",
"ENDPOINT_CACHE_CONFIG": {
Expand Down
Loading