diff --git a/.github/sdk-update-issue-template.md b/.github/sdk-update-issue-template.md new file mode 100644 index 0000000..e9a353c --- /dev/null +++ b/.github/sdk-update-issue-template.md @@ -0,0 +1,10 @@ +--- +title: fix code after sdk-js upgrade +labels: bug +--- + +_Note: This issue was **automatically created** because the CI pipeline broke after an update in the SDK on {{ date | date('YYYY-MM-D')}}._ + +Please **fix the code inside this repository** for which the CI broke after pushing [{{ env.SHA }}]({{ env.URL }}) on the develop branch of the SDK. +**You do not have to fix something in the SDK!** +This issue just displays a breaking change was made to the SDK. \ No newline at end of file diff --git a/.github/workflows/kube-dev.yml b/.github/workflows/kube-dev.yml index 1f6571c..93d9b56 100644 --- a/.github/workflows/kube-dev.yml +++ b/.github/workflows/kube-dev.yml @@ -31,11 +31,6 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - - name: set sdk dependency to 'latest' & set up .npmrc to connect to github packages - run: | - echo $(jq '.dependencies."@kiltprotocol/sdk-js"="latest"' package.json) > package.json - mv -f .npmrc.github .npmrc - - name: Build, tag, and push image to Amazon ECR id: build-image env: @@ -47,7 +42,6 @@ jobs: docker build \ -t $ECR_REGISTRY/$ECR_REPOSITORY:$ECR_IMAGE_TAG \ -t $ECR_REGISTRY/$ECR_REPOSITORY:$SHA_IMAGE_TAG \ - --build-arg NODE_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }} \ . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$ECR_IMAGE_TAG docker push $ECR_REGISTRY/$ECR_REPOSITORY:$SHA_IMAGE_TAG diff --git a/.github/workflows/test-sdk-update.yml b/.github/workflows/test-sdk-update.yml new file mode 100644 index 0000000..00f220d --- /dev/null +++ b/.github/workflows/test-sdk-update.yml @@ -0,0 +1,51 @@ +name: Test SDK Update + +on: + repository_dispatch: + types: [sdk-update] + +jobs: + integration_test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Use Node.js 10 + uses: actions/setup-node@v1 + with: + node-version: 10 + + - name: Upgrade sdk to latest dev version + run: yarn upgrade @kiltprotocol/sdk-js@dev + + - name: Test demo-client + run: | + yarn lint + yarn build + yarn test + yarn test:e2e --forceExit + + - name: Create issue on failure + if: ${{ failure() }} + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + title: fix code after sdk-js upgrade + labels: bug + assignees: ${{ github.event.client_payload.github.sender.login }} + SHA: ${{ github.event.client_payload.github.sha }} + URL: https://github.com/KILTprotocol/sdk-js/commit/${{ github.event.client_payload.github.sha }} + with: + filename: .github/sdk-update-issue-template.md diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 891acbc..17ab56a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,17 +28,12 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - registry-url: https://npm.pkg.github.com - scope: '@kiltprotocol' - name: yarn install, lint, test and build run: | - yarn upgrade --scope @kiltprotocol --latest + yarn install yarn lint yarn test yarn build - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} integration-tests: @@ -50,12 +45,7 @@ jobs: uses: actions/setup-node@v1 with: node-version: 10 - registry-url: https://npm.pkg.github.com - scope: '@kiltprotocol' - name: yarn install, lint, test and build run: | - yarn upgrade --scope @kiltprotocol --latest + yarn install yarn test:e2e --forceExit - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmrc b/.npmrc deleted file mode 100644 index b421f53..0000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -tag-version-prefix="" - diff --git a/.npmrc.github b/.npmrc.github deleted file mode 100644 index 4f5fecb..0000000 --- a/.npmrc.github +++ /dev/null @@ -1,3 +0,0 @@ -//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} -@kiltprotocol:registry=https://npm.pkg.github.com -always-auth=true \ No newline at end of file diff --git a/package.json b/package.json index fded947..27bce1d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@godaddy/terminus": "^4.1.0", - "@kiltprotocol/sdk-js": "^0.19.1-affad9d.0", + "@kiltprotocol/sdk-js": "^0.19.1-8", "@nestjs/common": "^5.4.0", "@nestjs/core": "^5.4.0", "@nestjs/mongoose": "^5.2.2", @@ -41,8 +41,8 @@ "@types/mongoose": "^5.3.1", "@types/node": "^10.7.1", "@types/supertest": "^2.0.5", - "mongodb-memory-server": "^6.6.3", "jest": "26.4.2", + "mongodb-memory-server": "^6.6.3", "nodemon": "^1.18.3", "prettier": "^1.14.2", "supertest": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index e880bd0..33c3588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -509,7 +509,7 @@ "@kiltprotocol/portablegabi@^0.4.0": version "0.4.0" - resolved "https://npm.pkg.github.com/download/@kiltprotocol/portablegabi/0.4.0/c21e5a1a3706c483b98524cc0020643b6196ce75d28365d66df4e49f3a6eac4d#b6a337834c1d832c24443bb29bc9df09f72bb5f7" + resolved "https://registry.yarnpkg.com/@kiltprotocol/portablegabi/-/portablegabi-0.4.0.tgz#b6a337834c1d832c24443bb29bc9df09f72bb5f7" integrity sha512-fyxBnLrPpyCGmfBBlzKjhT/X9IQjpmoCmMOQmk/DnUlWa8Areo2SiGhCP1G/DPxUK6fsZOlPk2X6xrtR1FJ6ow== dependencies: "@polkadot/api" "^2.0.1" @@ -519,10 +519,10 @@ "@polkadot/util" "^3.5.1" "@polkadot/util-crypto" "^3.5.1" -"@kiltprotocol/sdk-js@^0.19.1-affad9d.0": - version "0.19.1-affad9d.0" - resolved "https://npm.pkg.github.com/download/@kiltprotocol/sdk-js/0.19.1-affad9d.0/200b384ed5e5bb5d35e21b3da717463e4aa5f9ca5753bb228c1f761dc41e4fab#8d3cfcfedca9f41fd1ff9080cfed29d79af1d2a1" - integrity sha512-iyY3g1FRNSIleQPLtP9COo/6meu150Z0wTWNMVTFVi9TFRg54V3Tx+/8rc7FI0Qyd0/uAjX8uEBUZ87SDDCIfQ== +"@kiltprotocol/sdk-js@^0.19.1-8": + version "0.19.1-8" + resolved "https://registry.yarnpkg.com/@kiltprotocol/sdk-js/-/sdk-js-0.19.1-8.tgz#7842283d79e587f3d9d48558093c796c83eabb97" + integrity sha512-EL8pWG3dgZByedxwPnEGnE//ENw7xaiJasq2x3Qust5qz59PBGUMvUnt4UPa8tBSJ/UTFG9BLXu2twtHoagFzQ== dependencies: "@kiltprotocol/portablegabi" "^0.4.0" "@polkadot/api" "^2.0.1" @@ -533,6 +533,7 @@ "@polkadot/util-crypto" "^3.5.1" ajv "^6.12.5" bn.js "^5.1.3" + tweetnacl "^1.0.3" typescript-logging "^0.6.4" uuid "^8.1.0"