From f780a1da79583eae7533f74be08be5c7ce8dead4 Mon Sep 17 00:00:00 2001 From: Imod7 Date: Mon, 14 Oct 2024 11:59:31 +0200 Subject: [PATCH 1/2] fix: filtering in assets endpoint & update guides --- RELEASE.md | 4 ++++ guides/MAINTENANCE.md | 3 +++ src/App.ts | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/RELEASE.md b/RELEASE.md index be224fee5..93c09ef06 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -6,6 +6,10 @@ 1. Make sure to be in the `master` branch, and `git pull origin master`. +1. Ensure that all CI/CD jobs from the last merged commit are passing. You can verify this by checking the [commits](https://github.com/paritytech/substrate-api-sidecar/commits/master/) on the master branch, where a green check (✅) should be present. If you see a red cross (❌) then you can click on it and do the following checks: + - If the failed job is related to benchmarks, e.g. `continuous-integration/gitlab-bench-polkadot` or `continuous-integration/gitlab-push-benchmark`, it is not critical, and you can proceed with the next steps of the release. + - If the failed job is related to staging deployment, e.g. `continuous-integration/gitlab-deploy-staging`, this is critical. In this case, you should check with the CI/CD team to get the relevant logs and fix the issue before continuing with the release. + 1. Make sure that you've run `yarn` in this folder, and run `cargo install wasm-pack` so that that binary is available on your `$PATH`. 1. Checkout a branch with the format `name-v5-0-1` (with `name` being the name of the person doing the release, e.g. `tarik-v5-0-1`). When deciding what version will be released it is important to look over 1) PRs since the last release and 2) release notes for any updated polkadot-js dependencies as they may affect type definitions. diff --git a/guides/MAINTENANCE.md b/guides/MAINTENANCE.md index cd768cbbb..ab0193a65 100644 --- a/guides/MAINTENANCE.md +++ b/guides/MAINTENANCE.md @@ -52,6 +52,9 @@ Review the security alerts raised by Dependabot [here](https://github.com/parity - Check if there is a new major version of [Express](https://github.com/expressjs/express). - Update the version by running the command `yarn add express@^X.X.X`, e.g. `yarn add express@^5.0.0`. - After upgrading, we can do the usual sanity checks (e.g. `yarn`, `yarn dedupe`, `yarn build`, `yarn lint --fix`). +- Changes made due to the upgrade from Express v4 to v5, which should be double checked in next major Express release: + - Using `this.app.set('query parser', 'extended')` in `App.ts` to allow `[]` in query params. + - Direct access of private members like `_router` is not recommended/allowed in v5 (PR [#1510](https://github.com/paritytech/substrate-api-sidecar/pull/1510)). **Frequency**: Yearly or longer. diff --git a/src/App.ts b/src/App.ts index 8b528acb5..2e4d673e7 100644 --- a/src/App.ts +++ b/src/App.ts @@ -41,6 +41,10 @@ export default class App { */ constructor({ controllers, preMiddleware, postMiddleware, host, port }: IAppConfiguration) { this.app = express(); + // Change needed because of upgrading Express v4 to v5 + // Set query parser to 'extended' to correctly handle [] in query params + // Ref: https://github.com/expressjs/express/issues/5060 + this.app.set('query parser', 'extended') this.port = port; this.host = host; From f5fe0891f7aff85d05ada1c3da5201f5b881b8cf Mon Sep 17 00:00:00 2001 From: Imod7 Date: Mon, 14 Oct 2024 12:21:56 +0200 Subject: [PATCH 2/2] run linter --- src/App.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.ts b/src/App.ts index 2e4d673e7..32f540fd9 100644 --- a/src/App.ts +++ b/src/App.ts @@ -44,7 +44,7 @@ export default class App { // Change needed because of upgrading Express v4 to v5 // Set query parser to 'extended' to correctly handle [] in query params // Ref: https://github.com/expressjs/express/issues/5060 - this.app.set('query parser', 'extended') + this.app.set('query parser', 'extended'); this.port = port; this.host = host;