Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
fix config and enhance io-functions-commons ver
Browse files Browse the repository at this point in the history
  • Loading branch information
AleDore committed Feb 15, 2023
1 parent fa0b095 commit 93169f5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .devops/deploy-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Azure DevOps pipeline to release a new version and deploy to production.

variables:
HEALTHCHECK_PATH: '/info'
HEALTHCHECK_PATH: 'api/v1/info'

parameters:
- name: 'RELEASE_SEMVER'
Expand Down
8 changes: 4 additions & 4 deletions Info/__tests__/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HealthCheck, HealthProblem } from "@pagopa/io-functions-commons/dist/src/utils/healthcheck";
import { HealthProblem } from "@pagopa/io-functions-commons/dist/src/utils/healthcheck";
import * as TE from "fp-ts/lib/TaskEither";
import { InfoHandler } from "../handler";

Expand All @@ -8,7 +8,7 @@ afterEach(() => {

describe("InfoHandler", () => {
it("should return an internal error if the application is not healthy", async () => {
const healthCheck: HealthCheck = TE.left([
const healthCheck = TE.left([
"failure 1" as HealthProblem<"Config">,
"failure 2" as HealthProblem<"Config">
]);
Expand All @@ -20,8 +20,8 @@ describe("InfoHandler", () => {
});

it("should return a success if the application is healthy", async () => {
const healthCheck: HealthCheck = TE.of(true);
const handler = InfoHandler(_=> healthCheck);
const healthCheck = TE.of(true as const);
const handler = InfoHandler(_ => healthCheck);

const response = await handler();

Expand Down
2 changes: 1 addition & 1 deletion Info/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type InfoHandler = () => Promise<

type HealthChecker = (
config: unknown
) => healthcheck.HealthCheck<healthcheck.ProblemSource, true>;
) => healthcheck.HealthCheck<"Config" | "AzureCosmosDB" | "AzureStorage", true>;

export const InfoHandler = (
checkApplicationHealth: HealthChecker
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"dependencies": {
"@azure/cosmos": "^3.11.5",
"@pagopa/express-azure-functions": "^2.0.0",
"@pagopa/io-functions-commons": "^21",
"@pagopa/io-functions-commons": "^26.7.0",
"@pagopa/openapi-codegen-ts": "^12.1.2",
"@pagopa/ts-commons": "^10.3.0",
"azure-storage": "^2.10.3",
Expand Down
49 changes: 29 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@azure/abort-controller" "^1.0.0"
tslib "^2.2.0"

"@azure/cosmos@^3.11.5":
"@azure/cosmos@^3.11.5", "@azure/cosmos@^3.17.1":
version "3.17.2"
resolved "https://registry.yarnpkg.com/@azure/cosmos/-/cosmos-3.17.2.tgz#977eaaafeb805065581be01d00db2715f71bc0cc"
integrity sha512-hbmDJ6+NsMcVRH0/fv3NJucSkXxqloe5ePphPf0PSEVIOYlqrYk/hgVT/rNf9t6VAvMfqtR5g+Ncd+ZXVzCN+g==
Expand Down Expand Up @@ -975,13 +975,13 @@
resolved "https://registry.yarnpkg.com/@pagopa/express-azure-functions/-/express-azure-functions-2.1.1.tgz#ac6aa6d8c8d82b64e0db19ccadd2e89cc35ea725"
integrity sha512-x2kBGS6JKYqVp7PS9QiBc2AWIOPBObHwlaheJmxZJacnxmLdXHobomTzN2UJMxu55fxMd7xIxqM8VGMQxSzqiw==

"@pagopa/io-functions-commons@^21":
version "21.8.0"
resolved "https://registry.yarnpkg.com/@pagopa/io-functions-commons/-/io-functions-commons-21.8.0.tgz#d549cec2212834c1b688950e2fa0c398d13da8ab"
integrity sha512-K3j6zu/tX2GpmMT9PnoO3pLXcr8QdNiLQrYaohMJyCFiFuQs6hNFRSHKDjPgutoHKOVbal7HAJxTZvlGxgTw9w==
"@pagopa/io-functions-commons@^26.7.0":
version "26.7.0"
resolved "https://registry.yarnpkg.com/@pagopa/io-functions-commons/-/io-functions-commons-26.7.0.tgz#879be89e44dabae19e361aa72f0d3bb88c1b8aed"
integrity sha512-5CpzEbaQIgGyDj6g359jUAICiZGIg7V7uq6QbmLTvjDjVzs8dOnH7oIa3DiaWgW0OQUpaMNA2BWJ9JWmeqNBkg==
dependencies:
"@azure/cosmos" "^3.11.5"
"@pagopa/ts-commons" "^10.0.1"
"@azure/cosmos" "^3.17.1"
"@pagopa/ts-commons" "^10.13.0"
applicationinsights "^1.8.10"
azure-storage "^2.10.5"
cidr-matcher "^2.1.1"
Expand All @@ -997,7 +997,7 @@
remark-frontmatter "^2.0.0"
remark-parse "^5.0.0"
remark-rehype "^3.0.0"
request-ip "^2.1.3"
request-ip "^3.3.0"
ulid "^2.3.0"
unified "^9.2.2"
winston "^3.1.0"
Expand All @@ -1017,7 +1017,23 @@
write-yaml-file "^4.1.3"
yargs "^15.0.1"

"@pagopa/ts-commons@^10.0.1", "@pagopa/ts-commons@^10.3.0":
"@pagopa/ts-commons@^10.13.0":
version "10.14.0"
resolved "https://registry.yarnpkg.com/@pagopa/ts-commons/-/ts-commons-10.14.0.tgz#4991358014cd11e95cca4f8c728dc67d8c0d5519"
integrity sha512-mZqd7nK8QN7YfJSECGw30pwsIj2/+wo7yELY7naxhwL4Yi4UfvrSX7un1DFH1B3/3kEnEy7tFAse8Ca5Lxj3lQ==
dependencies:
abort-controller "^3.0.0"
agentkeepalive "^4.1.4"
applicationinsights "^1.8.10"
fp-ts "^2.11.0"
io-ts "^2.2.16"
jose "^4.11.2"
json-set-map "^1.1.2"
node-fetch "^2.6.0"
semver "^7.3.7"
validator "^13.7.0"

"@pagopa/ts-commons@^10.3.0":
version "10.12.0"
resolved "https://registry.yarnpkg.com/@pagopa/ts-commons/-/ts-commons-10.12.0.tgz#a26c7199f190ada603010bf945b4582e9219144e"
integrity sha512-Cruy8QfPgAyJg6o6VSosQo5OgCLEG3cSVydokzaHKduJBUVFwKYzABwmnON+k+/0uwnBGNF0GQf0NU9PpNlGrg==
Expand Down Expand Up @@ -5539,11 +5555,6 @@ is-wsl@^2.1.1:
dependencies:
is-docker "^2.0.0"

is_js@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/is_js/-/is_js-0.9.0.tgz#0ab94540502ba7afa24c856aa985561669e9c52d"
integrity sha512-8Y5EHSH+TonfUHX2g3pMJljdbGavg55q4jmHzghJCdqYDbdNROC8uw/YFQwIRCRqRJT1EY3pJefz+kglw+o7sg==

[email protected]:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
Expand Down Expand Up @@ -9041,12 +9052,10 @@ req-all@^0.1.0:
resolved "https://registry.yarnpkg.com/req-all/-/req-all-0.1.0.tgz#130051e2ace58a02eacbfc9d448577a736a9273a"
integrity sha512-ZdvPr8uXy9ujX3KujwE2P1HWkMYgogIhqeAeyb47MqWjSfyxERSm0TNbN/IapCCmWDufXab04AYrRgObaJCJ6Q==

request-ip@^2.1.3:
version "2.2.0"
resolved "https://registry.yarnpkg.com/request-ip/-/request-ip-2.2.0.tgz#8dbf53de6c5eb9a7da63a4f9f8991c1ea968a099"
integrity sha512-Hn4zUAr+XHbUs2RrfHur62t7+UhvtevqK32ordFewguEfNHUkhSdYgbG7PDGmXZEzqEXll9bei0+VMe6gkmuUQ==
dependencies:
is_js "^0.9.0"
request-ip@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/request-ip/-/request-ip-3.3.0.tgz#863451e8fec03847d44f223e30a5d63e369fa611"
integrity sha512-cA6Xh6e0fDBBBwH77SLJaJPBmD3nWVAcF9/XAcsrIHdjhFzFiB5aNQFytdjCGPezU3ROwrR11IddKAM08vohxA==

[email protected]:
version "1.1.4"
Expand Down

0 comments on commit 93169f5

Please sign in to comment.