Skip to content

Commit

Permalink
Health sensor (boostercloud#1421)
Browse files Browse the repository at this point in the history
* Health Sensor:

update pnpm-lock.yaml to force cosmos 3.17.0

Fix cosmos version in package.json

Fix health-adapter.ts

update partitionKey type

use default as environment name for testing. update doc example

fix isContainerUp

isContainerUp

refactor: remove `catalog`

rename HealtEndpoint to HealthSensor. Add readmodels to database isUp. Refactors

fix cli integration test

update pnpm-lock.yaml

rush change

fix doc

Health Sensor

* Remove partitionKeys info from Azure database
  • Loading branch information
gonzalojaubert authored Nov 9, 2023
1 parent ac0192e commit 4969203
Show file tree
Hide file tree
Showing 72 changed files with 2,509 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@boostercloud/framework-core",
"comment": "Add health sensor",
"type": "minor"
}
],
"packageName": "@boostercloud/framework-core"
}
131 changes: 70 additions & 61 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/application-tester/src/application-tester.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { GraphQLHelper } from './graphql-helper'
import { Counters, ProviderTestHelper, Queries } from './provider-test-helper'
import { TokenHelper } from './token-helper'
import { HttpHelper } from './http-helper'

export class ApplicationTester {
readonly graphql: GraphQLHelper
readonly http: HttpHelper
readonly token: TokenHelper
readonly count: Counters
readonly query: Queries
constructor(providerTestHelper: ProviderTestHelper) {
this.graphql = new GraphQLHelper(providerTestHelper)
this.http = new HttpHelper(providerTestHelper)
this.token = new TokenHelper()
this.count = providerTestHelper.counters
this.query = providerTestHelper.queries
Expand Down
8 changes: 8 additions & 0 deletions packages/application-tester/src/http-helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ProviderTestHelper } from './provider-test-helper'

export class HttpHelper {
constructor(private providerTestHelper: ProviderTestHelper) {}
public getHealthUrl(): string {
return this.providerTestHelper.outputs.healthURL
}
}
1 change: 1 addition & 0 deletions packages/application-tester/src/provider-test-helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface ApplicationOutputs {
graphqlURL: string
websocketURL: string
healthURL: string
}

export interface Counters {
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { Flags } from '@oclif/core'
import BaseCommand from '../common/base-command'
import { startProvider } from '../services/provider-service'
import { compileProjectAndLoadConfig } from '../services/config-service'
import { BoosterConfig } from '@boostercloud/framework-types'
import { BOOSTER_LOCAL_PORT, BoosterConfig } from '@boostercloud/framework-types'
import { Script } from '../common/script'
import Brand from '../common/brand'
import { logger } from '../services/logger'
import { currentEnvironment, initializeEnvironment } from '../services/environment'
import * as process from 'process'

const runTasks = async (
port: number,
Expand Down Expand Up @@ -41,6 +42,7 @@ export default class Start extends BaseCommand {
const { flags } = await this.parse(Start)

if (initializeEnvironment(logger, flags.environment)) {
process.env[BOOSTER_LOCAL_PORT] = flags.port ? flags.port.toString() : '3000'
await runTasks(flags.port, compileProjectAndLoadConfig(process.cwd()), startProvider.bind(null, flags.port))
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/templates/project/index-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export {
boosterEventDispatcher,
boosterServeGraphQL,
boosterNotifySubscribers,
boosterHealth,
boosterTriggerScheduledCommand,
boosterRocketDispatcher,
} from '@boostercloud/framework-core'
Expand Down
Loading

0 comments on commit 4969203

Please sign in to comment.