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/#2811): sdk-scheme-adapter sending incorrect transferState on a PUT transfers Callback #331

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f2ece2e
fix(mojaloop/#2811): sdk-scheme-adapter sending incorrect transferSta…
mdebarros Jul 7, 2022
809598a
chore: fixed audit-resolve issues
mdebarros Jul 7, 2022
9a7b0d8
chore: aligned ci config to standards
mdebarros Jul 7, 2022
0487acc
chore: aligned ci config to standards
mdebarros Jul 7, 2022
4e8cf35
chore: test unit test fixes
mdebarros Jul 7, 2022
76376b5
chore: test unit test fixes
mdebarros Jul 7, 2022
4389489
chore(snapshot): 17.0.2-snapshot.0
mdebarros Jul 7, 2022
acae6fa
chore: updated npm-audit-resolve to latest version
mdebarros Jul 7, 2022
8472e19
chore: fixes for ci config
mdebarros Jul 7, 2022
9fe2aa0
chore(snapshot): 17.0.2-snapshot.1
mdebarros Jul 7, 2022
7db3bf0
chore(snapshot): 17.0.2-snapshot.2
mdebarros Jul 7, 2022
cb91333
chore: fixes for ci config
mdebarros Jul 7, 2022
cc7d2bd
chore(snapshot): 17.0.2-snapshot.3
mdebarros Jul 7, 2022
ca892fc
chore: fixes for ci config
mdebarros Jul 7, 2022
1351ba2
chore(snapshot): 17.0.2-snapshot.4
mdebarros Jul 7, 2022
4dfb027
chore: updat Dockerfile to add the ml-user
mdebarros Jul 7, 2022
855d3fe
chore(snapshot): 17.0.2-snapshot.5
mdebarros Jul 7, 2022
e270a2a
chore: update depenendencies
mdebarros Jul 7, 2022
35cdf94
chore(snapshot): 17.0.2-snapshot.6
mdebarros Jul 7, 2022
b50fd46
chore: updated dockerfile to use /opt/app folder to align to ml stand…
mdebarros Jul 7, 2022
d006c79
chore(snapshot): 17.0.2-snapshot.7
mdebarros Jul 7, 2022
b2da0fa
chore: fixes for docker-compose and integration.env
mdebarros Jul 7, 2022
45ada92
chore(snapshot): 17.0.2-snapshot.8
mdebarros Jul 7, 2022
d982ee3
chore: minor integration.env cleanup
mdebarros Jul 7, 2022
6ecdca4
chore(snapshot): 17.0.2-snapshot.9
mdebarros Jul 7, 2022
5e9f160
chore: fixed audits
mdebarros Jul 7, 2022
889d693
chore(snapshot): 17.0.2-snapshot.10
mdebarros Jul 7, 2022
a4a35da
removed commented out command from docker-compose
mdebarros Jul 7, 2022
155f4a3
chore(snapshot): 17.0.2-snapshot.11
mdebarros Jul 7, 2022
8efe1ed
fix(mojaloop/#2816): SDK-Scheme-Adapter is missing bulkTransferState …
mdebarros Jul 8, 2022
5764d23
chore(snapshot): 17.0.2-snapshot.12
mdebarros Jul 8, 2022
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
Prev Previous commit
Next Next commit
chore: aligned ci config to standards
  • Loading branch information
mdebarros committed Jul 7, 2022
commit 0487acc42780dbc6e512e14a8e9da005c1912cc8
119 changes: 52 additions & 67 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@ version: 2.1
###
orbs:
anchore: anchore/[email protected]
## Remove
# slack: circleci/[email protected]
slack: circleci/[email protected] # Ref: https://github.com/mojaloop/ci-config/tree/master/slack-templates
pr-tools: mojaloop/[email protected]
## remove
github-release: h-matsuo/[email protected]
pr-tools: mojaloop/[email protected] # Ref: https://github.com/mojaloop/ci-config/
gh: circleci/[email protected]


##
# defaults
#
Expand Down Expand Up @@ -173,21 +168,8 @@ jobs:
- checkout
- run:
<<: *defaults_configure_nvm
# - run:
# name: Install Docker Compose
# command: |
# curl -L https://github.com/docker/compose/releases/download/1.28.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
# chmod +x ~/docker-compose
# sudo mv ~/docker-compose /usr/local/bin/docker-compose
- restore_cache:
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
# - run:
# name: Set up NVM
# command: |
# echo ${NVM_DIR}
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# nvm install v16.15
# nvm alias default v16.15
- run:
name: Start docker-compose
command: |
Expand Down Expand Up @@ -231,24 +213,6 @@ jobs:
name: Execute unit tests
command: npm run build:openapi && npm run validate:api

# lint:
# executor: default-docker
# steps:
# - run:
# name: Install general dependencies
# command: *defaults_Dependencies
# - checkout
# - restore_cache:
# key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
# - run:
# name: Create dir for lint results
# command: mkdir -p /lintresults
# - run:
# name: Execute linting
# command: (npm run lint > /lintresults/results.txt)
# - store_artifacts:
# path: /lintresults

vulnerability-check:
executor: default-docker
steps:
Expand Down Expand Up @@ -312,6 +276,29 @@ jobs:
steps:
- setup_remote_docker
- checkout
- run:
name: Setup Slack config
command: |
echo "export SLACK_PROJECT_NAME=${CIRCLE_PROJECT_REPONAME}" >> $BASH_ENV
echo "export SLACK_RELEASE_TYPE='GitHub Release'" >> $BASH_ENV
echo "export SLACK_RELEASE_TAG='${RELEASE_TAG} on ${CIRCLE_BRANCH} branch'" >> $BASH_ENV
echo "export SLACK_BUILD_ID=${CIRCLE_BUILD_NUM}" >> $BASH_ENV
echo "export SLACK_CI_URL=${CIRCLE_BUILD_URL}" >> $BASH_ENV
echo "export SLACK_CUSTOM_MSG='Anchore Image Scan failed for: \`${DOCKER_ORG}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}\`'" >> $BASH_ENV
- run:
name: Install docker dependencies for anchore
command: |
apk add --update py-pip docker python3-dev libffi-dev openssl-dev gcc libc-dev make jq npm
- run:
name: Install general dependencies
command: |
apk --no-cache add git
apk --no-cache add ca-certificates
apk --no-cache add curl
apk --no-cache add openssh-client
apk add --no-cache -t build-dependencies make gcc g++ python3 libtool autoconf automake
npm config set unsafe-perm true
npm install -g node-gyp
- run:
name: Install AWS CLI dependencies
command: *defaults_awsCliDependencies
Expand All @@ -320,42 +307,40 @@ jobs:
- run:
name: Load the pre-built docker image from workspace
command: docker load -i /tmp/docker-image.tar
- run:
name: Download the mojaloop/ci-config repo
command: |
git clone https://github.com/mojaloop/ci-config /tmp/ci-config
# Generate the mojaloop anchore-policy
cd /tmp/ci-config/container-scanning && ./mojaloop-policy-generator.js /tmp/mojaloop-policy.json
- run:
name: Pull base image locally
command: |
docker pull node:16.15.0-alpine
# Analyze the base and derived image
# Note: It seems images are scanned in parallel, so preloading the base image result doesn't give us any real performance gain
- anchore/analyze_local_image:
dockerfile_path: ./Dockerfile
image_name: mojaloop/${CIRCLE_PROJECT_REPONAME}:local
# Anchore bug: if policy_failure is `true`, reports don't get written - we manually check for failures below
# Force the older version, version 0.7.0 was just published, and is broken
anchore_version: v0.6.1
image_name: "docker.io/node:16.15.0-alpine $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$CIRCLE_TAG"
policy_failure: false
timeout: '500'
# Note: if the generated policy is invalid, this will fallback to the default policy, which we don't want!
policy_bundle_file_path: /tmp/mojaloop-policy.json
- run:
name: Upload Anchore reports to s3
command: |
aws s3 cp anchore-reports ${AWS_S3_DIR_ANCHORE_REPORTS}/${CIRCLE_PROJECT_REPONAME}/ --recursive
aws s3 rm ${AWS_S3_DIR_ANCHORE_REPORTS}/latest/ --recursive --exclude "*" --include "${CIRCLE_PROJECT_REPONAME}*"
aws s3 cp anchore-reports ${AWS_S3_DIR_ANCHORE_REPORTS}/latest/ --recursive
- run:
name: Evaluate Failures.
command: |
if [[ ! $(which jq) ]]; then
(set +o pipefail; apk add jq || apt-get install -y jq || yum install -y jq)
fi
if [[ $(ls anchore-reports/*content-os*.json 2> /dev/null) ]]; then
printf "\n%s\n" "The following OS packages are installed:"
jq '[.content | sort_by(.package) | .[] | {package: .package, version: .version}]' anchore-reports/*content-os*.json
fi
if [[ $(ls anchore-reports/*vuln*.json 2> /dev/null) ]]; then
printf "\n%s\n" "The following vulnerabilities were found:"
jq '[.vulnerabilities | group_by(.package) | .[] | {package: .[0].package, vuln: [.[].vuln]}]' anchore-reports/*vuln*.json
fi
# - run:
# name: Upload Anchore reports to s3
# command: |
# aws s3 cp anchore-reports ${AWS_S3_DIR_ANCHORE_REPORTS}/${CIRCLE_PROJECT_REPONAME}/ --recursive
# aws s3 rm ${AWS_S3_DIR_ANCHORE_REPORTS}/latest/ --recursive --exclude "*" --include "${CIRCLE_PROJECT_REPONAME}*"
# aws s3 cp anchore-reports ${AWS_S3_DIR_ANCHORE_REPORTS}/latest/ --recursive

# TODO: Enable this when we want to increase the strictness of our security policies
# failCount=$(cat anchore-reports/*policy*.json | grep 'fail' | wc -l)
# echo "FailCount is: ${failCount}"
# if [ $failCount -gt 0 ]; then
# printf "Failed with a policy failure count of: ${failCount}"
# exit 1
# fi
name: Evaluate failures
command: /tmp/ci-config/container-scanning/anchore-result-diff.js anchore-reports/node_16.15.0-alpine-policy.json anchore-reports/${CIRCLE_PROJECT_REPONAME}*-policy.json
- store_artifacts:
path: anchore-reports
- slack/notify:
event: fail
template: SLACK_TEMP_RELEASE_FAILURE

build-local:
executor: default-machine
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"~": "src"
},
"scripts": {
"audit:resolve": "resolve-audit --production",
"audit:check": "check-audit --production",
"audit:resolve": "npx resolve-audit --production",
"audit:check": "npx check-audit --production",
"build": "npm run build:openapi; npm run build:dto:outbound",
"build:openapi": "npm run build:openapi:inbound && npm run build:openapi:outbound",
"build:openapi:inbound": "openapi bundle --output ./src/InboundServer/api.yaml --ext yaml ./src/InboundServer/api_template.yaml",
Expand Down