-
Notifications
You must be signed in to change notification settings - Fork 6
feat: DORA metrics #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9015663
feat: front-end mock
waltergalvao 39d2a94
ref: charts query -> metrics
waltergalvao eba20c4
feat: hook up web to placeholder api
waltergalvao eef1587
fix: variables
waltergalvao d00a5ca
feat: integration tests
waltergalvao d6efbff
fix: pg port
waltergalvao 8af1422
feat: improve main nav
waltergalvao 8cd9ed8
fix: use pg generate_series to fill chart missing columns
waltergalvao e0d6218
feat: dora metrics service
waltergalvao 4891edf
fix: date filter shortcut label
waltergalvao 586482a
fix: lead time calculation
waltergalvao 1118bb0
feat: extensive integration tests
waltergalvao 5694a04
fix: codeQL warnings
waltergalvao 0d45acd
fix: build
waltergalvao 9bd9f91
fix: integration tests workflow
waltergalvao 804b816
fix: review comments
waltergalvao ea60bf2
fix: more review comments
waltergalvao 1000a9f
fix: review comments
waltergalvao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Test (Integration) | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [synchronize, opened, reopened] | ||
| push: | ||
| branches: | ||
| - main | ||
| - production | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| integration-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: sweetr_test | ||
| ports: | ||
| - 5433:5432 | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 2s | ||
| --health-timeout 5s | ||
| --health-retries 10 | ||
|
|
||
| env: | ||
| DATABASE_URL: postgresql://postgres:postgres@localhost:5433/sweetr_test | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Run Integration Tests | ||
| run: npm run test:integration | ||
| working-directory: apps/api | ||
| env: | ||
| DATABASE_URL: ${{ env.DATABASE_URL }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| DATABASE_URL=postgres://postgres:postgres@localhost:5433/sweetr_test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
apps/api/src/app/metrics/resolvers/dora-metrics.schema.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| export default /* GraphQL */ ` | ||
| type Metrics { | ||
| dora: DoraMetrics! | ||
| } | ||
|
|
||
| type DoraMetrics { | ||
| leadTime(input: WorkspaceMetricInput!): LeadTimeMetric! | ||
| changeFailureRate(input: WorkspaceMetricInput!): ChangeFailureRateMetric! | ||
| deploymentFrequency( | ||
| input: WorkspaceMetricInput! | ||
| ): DeploymentFrequencyMetric! | ||
| meanTimeToRecover(input: WorkspaceMetricInput!): MeanTimeToRecoverMetric! | ||
| } | ||
|
|
||
| input WorkspaceMetricInput { | ||
| "The date range." | ||
| dateRange: DateTimeRange! | ||
|
|
||
| "The period to group by." | ||
| period: Period! | ||
|
|
||
| "The team ids to filter by." | ||
| teamIds: [SweetID!] | ||
|
|
||
| "The application ids to filter by." | ||
| applicationIds: [SweetID!] | ||
|
|
||
| "The environment ids to filter by." | ||
| environmentIds: [SweetID!] | ||
|
|
||
| "The repository ids to filter by." | ||
| repositoryIds: [SweetID!] | ||
| } | ||
|
|
||
| type LeadTimeMetric { | ||
| "The lead time for the current period" | ||
| currentAmount: Int! | ||
|
|
||
| "The lead time before the current period" | ||
| previousAmount: Int! | ||
|
|
||
| "The change in lead time" | ||
| change: Float! | ||
|
|
||
| "The columns for the chart" | ||
| columns: [DateTime!]! | ||
|
|
||
| "The amounts over time for the chart" | ||
| data: [BigInt!]! | ||
| } | ||
|
|
||
| type ChangeFailureRateMetric { | ||
| "The change failure rate for the current period" | ||
| currentAmount: Float! | ||
|
|
||
| "The change failure rate before the current period" | ||
| previousAmount: Float! | ||
|
|
||
| "The change in change failure rate" | ||
| change: Float! | ||
|
|
||
| "The columns for the chart" | ||
| columns: [DateTime!]! | ||
|
|
||
| "The amounts over time for the chart" | ||
| data: [BigInt!]! | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| type DeploymentFrequencyMetric { | ||
| "The amount of deployments for the current period" | ||
| currentAmount: Int! | ||
|
|
||
| "The average number of deployments per day" | ||
| avg: Float! | ||
|
|
||
| "The number of deployments before the current period" | ||
| previousAmount: Int! | ||
|
|
||
| "The change in the number of deployments" | ||
| change: Float! | ||
|
|
||
| "The columns for the chart" | ||
| columns: [DateTime!]! | ||
|
|
||
| "The amounts over time for the chart" | ||
| data: [BigInt!]! | ||
| } | ||
|
|
||
| type MeanTimeToRecoverMetric { | ||
| "The mean time to recover in milliseconds for the current period" | ||
| currentAmount: Int! | ||
|
|
||
| "The mean time to recover in milliseconds before the current period" | ||
| previousAmount: Int! | ||
|
|
||
| "The change in mean time to recover" | ||
| change: Float! | ||
|
|
||
| "The columns for the chart" | ||
| columns: [DateTime!]! | ||
|
|
||
| "The amounts over time for the chart" | ||
| data: [BigInt!]! | ||
| } | ||
| `; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export default /* GraphQL */ ` | ||
| extend type Workspace { | ||
| metrics: Metrics! | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
apps/api/src/app/metrics/resolvers/queries/charts.query.ts
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
apps/api/src/app/metrics/resolvers/queries/code-review-charts.query.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.