diff --git a/.github/workflows/buildTestPublishContainerDeploy.yml b/.github/workflows/buildTestPublishContainerDeploy.yml index 8013db2f4..ef6da8eed 100644 --- a/.github/workflows/buildTestPublishContainerDeploy.yml +++ b/.github/workflows/buildTestPublishContainerDeploy.yml @@ -3,7 +3,6 @@ on: push: branches: - main - - healthCheck release: types: - published diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 02ffc006f..935029967 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -146,6 +146,7 @@ export default defineUserConfig({ { text: 'Miscellaneous', children: [ + '/docs/health-check/', '/docs/benchmarks/', '/docs/bulk-import/', '/docs/developer-notes/', diff --git a/docs/docs/getting-started/what's-new.md b/docs/docs/getting-started/what's-new.md index 7a4215733..82280792d 100644 --- a/docs/docs/getting-started/what's-new.md +++ b/docs/docs/getting-started/what's-new.md @@ -7,7 +7,14 @@ next: /docs/config-overview/ _NotifyBC_ uses [semantic versioning](https://semver.org/). -## v5.0.0 +## v5 + +### v5.1.0 + +- Issue [#85](https://github.com/bcgov/NotifyBC/issues/85): added health check +- Changed package manager from yarn to npm + +### v5.0.0 See [Upgrade Guide](../upgrade/#v4-to-v5) for more information. @@ -30,13 +37,15 @@ To pave the way for future growth, switching platform becomes necessary. _NestJS ::: -## v4.1.0 +## v4 + +### v4.1.0 - Issue [#50](https://github.com/bcgov/NotifyBC/issues/50): Email message throttle - applied sms throttle to all sms messages rather than just broadcast push notification. - docs updates -## v4.0.0 +### v4.0.0 See [v3 to v4 upgrade guide](../upgrade/#v3-to-v4) for more information. @@ -45,69 +54,73 @@ See [v3 to v4 upgrade guide](../upgrade/#v3-to-v4) for more information. - Re-organized Email and SMS configs - docs updates -## v3.1.0 +## v3 + +### v3.1.0 - Issue [#45](https://github.com/bcgov/NotifyBC/issues/45): Reliability - Log skipped dispatches for broadcast push notifications - docs updates -## v3.0.0 +### v3.0.0 See [v2 to v3 upgrade guide](../upgrade/#v2-to-v3) for more information. - Reliability improvements - issues [#36](https://github.com/bcgov/NotifyBC/issues/36),[#37](https://github.com/bcgov/NotifyBC/issues/37),[#38](https://github.com/bcgov/NotifyBC/issues/38),[#39](https://github.com/bcgov/NotifyBC/issues/39),[#40](https://github.com/bcgov/NotifyBC/issues/40),[#41](https://github.com/bcgov/NotifyBC/issues/41),[#42](https://github.com/bcgov/NotifyBC/issues/42) - docs updates -## v2.9.0 +## v2 + +### v2.9.0 - Issue [#34](https://github.com/bcgov/NotifyBC/issues/34): Helm - add k8s cronJob to backup MongoDB - docs updates -## v2.8.0 +### v2.8.0 - Issue [#28](https://github.com/bcgov/NotifyBC/issues/28): Allow subscription data be used by mail merge dynamic tokens - Issue [#32](https://github.com/bcgov/NotifyBC/issues/32): Allow escape mail merge delimiter - docs updates -## v2.7.0 +### v2.7.0 - Issue [#26](https://github.com/bcgov/NotifyBC/issues/26): Allow filter specified in a notification - docs updates -## v2.6.0 +### v2.6.0 - Helm chart updates - docs updates -## v2.5.0 +### v2.5.0 - added [helm chart](https://github.com/bcgov/NotifyBC/tree/main/helm). See [OpenShift template to Helm upgrade guide](../miscellaneous/upgrade.md#openshift-template-to-helm) - docs updates -## v2.4.0 +### v2.4.0 - Issue [#16](https://github.com/bcgov/NotifyBC/issues/16): Support client certificate authentication - misc web console adjustments - docs updates -## v2.3.0 +### v2.3.0 - Issue [#15](https://github.com/bcgov/NotifyBC/issues/15): Support OIDC authentication for both admin and non-admin user - misc web console adjustments - docs updates -## v2.2.0 +### v2.2.0 - Issue [#14](https://github.com/bcgov/NotifyBC/issues/14): Support Administrator login, changing password, obtain access token in web console - misc web console adjustments - docs updates -## v2.1.0 +### v2.1.0 - Issue [#13](https://github.com/bcgov/NotifyBC/issues/13): Upgraded Vuetify from v0.16.9 to v2.4.3 - misc web console adjustments - docs updates -## v2.0.0 +### v2.0.0 See [Upgrade Guide](../upgrade/#v1-to-v2) for more information. diff --git a/docs/docs/miscellaneous/health-check.md b/docs/docs/miscellaneous/health-check.md new file mode 100644 index 000000000..9c1b40fd2 --- /dev/null +++ b/docs/docs/miscellaneous/health-check.md @@ -0,0 +1,48 @@ +--- +permalink: /docs/health-check/ +--- + +# Health Check + +Health status of _NotifyBC_ can be obtained by querying `/health` API end point. For example + +```json +$ curl -s http://localhost:3000/api/health | jq +{ + "status": "ok", + "info": { + "MongoDB": { + "status": "up" + }, + "config": { + "status": "up", + "count": 2 + }, + "redis": { + "status": "up" + } + }, + "error": {}, + "details": { + "MongoDB": { + "status": "up" + }, + "config": { + "status": "up", + "count": 2 + }, + "redis": { + "status": "up" + } + } +} +``` + +If overall health status is OK, the HTTP response code is 200, otherwise 503. +The response payload shows status of following indicators and health criteria + +1. MongoDB - MongoDB must be reachable +2. config - There must be at least 2 items in MongoDB configuration collection +3. Redis - Redis must be reachable if configured + +`/health` API end point is also reachable in _API Explorer_ of _NotifyBC_ web console. diff --git a/helm/Chart.yaml b/helm/Chart.yaml index c7125ecaa..7efd04c3f 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -22,7 +22,7 @@ version: 1.1.1 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: '5.0' +appVersion: '5.1' dependencies: - name: mongodb diff --git a/package.json b/package.json index f1cd9ec68..4c4c66005 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notify-bc", - "version": "5.0.14", + "version": "5.1.0", "dbSchemaVersion": "0.9.0", "description": "A versatile notification API server", "author": "f-w",