Skip to content

Commit

Permalink
Update /service-status version endpoints (#2245)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4096

Currently, the `/service-status` endpoint in the UI is getting the versions for the various services from their `/status` endpoints. As these endpoints are going to be updated to just return a static response of `{ "status": "alive" }`, this has been updated to `/health/info` which is an endpoint created for each repo a while ago to serve the repo's version.

This work is the first task in the issue: DEFRA/water-abstraction-team#67
  • Loading branch information
Jozzey committed Aug 22, 2023
1 parent b200663 commit 6369b55
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/connectors/service-version-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { URL } = require('url')
*/
const create = (endPointUrl) => async () => {
const urlParts = new URL(endPointUrl)
const url = urlJoin(urlParts.protocol, urlParts.host, 'status')
const url = urlJoin(urlParts.protocol, urlParts.host, 'health/info')
const response = await serviceRequest.get(url)
return response.version
}
Expand Down
2 changes: 1 addition & 1 deletion test/lib/connectors/crm/service-version.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ experiment('connectors/crm/service-version', () => {
test('calls the expected URL', async () => {
await serviceVersionConnector.getServiceVersion()
const [url] = serviceRequest.get.lastCall.args
expect(url).to.endWith('/status')
expect(url).to.endWith('/health/info')
})
})
})
2 changes: 1 addition & 1 deletion test/lib/connectors/idm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ experiment('connectors/idm', () => {
test('calls the expected URL', async () => {
await idmConnector.getServiceVersion()
const [url] = helpers.serviceRequest.get.lastCall.args
expect(url).to.endWith('/status')
expect(url).to.endWith('/health/info')
})
})

Expand Down
2 changes: 1 addition & 1 deletion test/lib/connectors/import/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ experiment('connectors/import', () => {
test('calls the expected URL', async () => {
await importConnector.getServiceVersion()
const [url] = serviceRequest.get.lastCall.args
expect(url).to.endWith('/status')
expect(url).to.endWith('/health/info')
})
})

Expand Down
2 changes: 1 addition & 1 deletion test/lib/connectors/permit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ experiment('connectors/permit', () => {
test('calls the expected URL', async () => {
await permit.getServiceVersion()
const [url] = serviceRequest.get.lastCall.args
expect(url).to.endWith('/status')
expect(url).to.endWith('/health/info')
})
})

Expand Down

0 comments on commit 6369b55

Please sign in to comment.