Skip to content

Commit

Permalink
Merge branch 'main' into chore/move-domainEvent-fanout-from-app-to-bus
Browse files Browse the repository at this point in the history
# Conflicts:
#	tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Digdir.Domain.Dialogporten.Application.Unit.Tests.csproj
  • Loading branch information
MagnusSandgren committed Nov 8, 2024
2 parents 5d5f06d + bb832d8 commit ae709b9
Show file tree
Hide file tree
Showing 107 changed files with 1,548 additions and 1,426 deletions.
9 changes: 7 additions & 2 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ import { Sku as SlackNotifierSku } from '../modules/functionApp/slackNotifier.bi
param slackNotifierSku SlackNotifierSku

import { Sku as PostgresSku } from '../modules/postgreSql/create.bicep'
param postgresSku PostgresSku

param postgresConfiguration {
sku: PostgresSku
enableQueryPerformanceInsight: bool
}

import { Sku as ServiceBusSku } from '../modules/serviceBus/main.bicep'
param serviceBusSku ServiceBusSku
Expand Down Expand Up @@ -199,7 +203,8 @@ module postgresql '../modules/postgreSql/create.bicep' = {
administratorLoginPassword: contains(keyVaultSourceKeys, 'dialogportenPgAdminPassword${environment}')
? srcKeyVaultResource.getSecret('dialogportenPgAdminPassword${environment}')
: secrets.dialogportenPgAdminPassword
sku: postgresSku
sku: postgresConfiguration.sku
enableQueryPerformanceInsight: postgresConfiguration.enableQueryPerformanceInsight
subnetId: vnet.outputs.postgresqlSubnetId
vnetId: vnet.outputs.virtualNetworkId
tags: tags
Expand Down
9 changes: 6 additions & 3 deletions .azure/infrastructure/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ param slackNotifierSku = {
applicationServicePlanName: 'Y1'
applicationServicePlanTier: 'Dynamic'
}
param postgresSku = {
name: 'Standard_B1ms'
tier: 'Burstable'
param postgresConfiguration = {
sku: {
name: 'Standard_B1ms'
tier: 'Burstable'
}
enableQueryPerformanceInsight: false
}

param redisSku = {
Expand Down
9 changes: 6 additions & 3 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ param slackNotifierSku = {
applicationServicePlanName: 'Y1'
applicationServicePlanTier: 'Dynamic'
}
param postgresSku = {
name: 'Standard_B1ms'
tier: 'Burstable'
param postgresConfiguration = {
sku: {
name: 'Standard_B1ms'
tier: 'Burstable'
}
enableQueryPerformanceInsight: true
}

param redisSku = {
Expand Down
9 changes: 6 additions & 3 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ param slackNotifierSku = {
applicationServicePlanName: 'Y1'
applicationServicePlanTier: 'Dynamic'
}
param postgresSku = {
name: 'Standard_B2s'
tier: 'Burstable'
param postgresConfiguration = {
sku: {
name: 'Standard_B2s'
tier: 'Burstable'
}
enableQueryPerformanceInsight: true
}

param redisSku = {
Expand Down
9 changes: 6 additions & 3 deletions .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ param slackNotifierSku = {
applicationServicePlanName: 'Y1'
applicationServicePlanTier: 'Dynamic'
}
param postgresSku = {
name: 'Standard_B1ms'
tier: 'Burstable'
param postgresConfiguration = {
sku: {
name: 'Standard_B1ms'
tier: 'Burstable'
}
enableQueryPerformanceInsight: true
}

param redisSku = {
Expand Down
30 changes: 30 additions & 0 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ type Sku = {
@description('The SKU of the PostgreSQL server')
param sku Sku

@description('Enable query performance insight')
param enableQueryPerformanceInsight bool

@description('The Key Vault to store the PostgreSQL administrator login password')
@secure()
param srcKeyVault object
Expand Down Expand Up @@ -106,6 +109,33 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
tags: tags
}

resource track_io_timing 'Microsoft.DBforPostgreSQL/flexibleServers/configurations@2023-12-01-preview' = if (enableQueryPerformanceInsight) {
parent: postgres
name: 'track_io_timing'
properties: {
value: 'on'
source: 'user-override'
}
}

resource pg_qs_query_capture_mode 'Microsoft.DBforPostgreSQL/flexibleServers/configurations@2023-12-01-preview' = if (enableQueryPerformanceInsight) {
parent: postgres
name: 'pg_qs.query_capture_mode'
properties: {
value: 'all'
source: 'user-override'
}
}

resource pgms_wait_sampling_query_capture_mode 'Microsoft.DBforPostgreSQL/flexibleServers/configurations@2023-12-01-preview' = if (enableQueryPerformanceInsight) {
parent: postgres
name: 'pgms_wait_sampling.query_capture_mode'
properties: {
value: 'all'
source: 'user-override'
}
}

module adoConnectionString '../keyvault/upsertSecret.bicep' = {
name: 'adoConnectionString'
params: {
Expand Down
2 changes: 1 addition & 1 deletion .azure/modules/ssh-jumper/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource publicIp 'Microsoft.Network/publicIPAddresses@2023-11-01' = {
tags: tags
}

resource networkInterface 'Microsoft.Network/networkInterfaces@2023-11-01' = {
resource networkInterface 'Microsoft.Network/networkInterfaces@2024-03-01' = {
name: name
location: location
properties: {
Expand Down
10 changes: 5 additions & 5 deletions .azure/modules/vnet/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ param location string
@description('Tags to apply to resources')
param tags object

resource defaultNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
resource defaultNSG 'Microsoft.Network/networkSecurityGroups@2024-03-01' = {
name: '${namePrefix}-default-nsg'
location: location
properties: {
Expand Down Expand Up @@ -47,7 +47,7 @@ resource defaultNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
}

// https://learn.microsoft.com/en-us/azure/container-apps/firewall-integration?tabs=consumption-only
resource containerAppEnvironmentNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
resource containerAppEnvironmentNSG 'Microsoft.Network/networkSecurityGroups@2024-03-01' = {
name: '${namePrefix}-container-app-environment-nsg'
location: location
properties: {
Expand Down Expand Up @@ -146,7 +146,7 @@ resource containerAppEnvironmentNSG 'Microsoft.Network/networkSecurityGroups@202
tags: tags
}

resource postgresqlNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
resource postgresqlNSG 'Microsoft.Network/networkSecurityGroups@2024-03-01' = {
name: '${namePrefix}-postgresql-nsg'
location: location
properties: {
Expand Down Expand Up @@ -185,7 +185,7 @@ resource postgresqlNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
tags: tags
}

resource redisNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
resource redisNSG 'Microsoft.Network/networkSecurityGroups@2024-03-01' = {
name: '${namePrefix}-redis-nsg'
location: location
properties: {
Expand Down Expand Up @@ -224,7 +224,7 @@ resource redisNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
tags: tags
}

resource serviceBusNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
resource serviceBusNSG 'Microsoft.Network/networkSecurityGroups@2024-03-01' = {
name: '${namePrefix}-service-bus-nsg'
location: location
properties: {
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ jobs:

store-infra-version:
name: Store Latest Deployed Infra Version as GitHub Variable
runs-on: ubuntu-latest
needs: [deploy-infra, get-current-version]
if: ${{ needs.deploy-infra.result == 'success' }}
env:
uses: ./.github/workflows/workflow-store-github-env-variable.yml
with:
variable_name: LATEST_DEPLOYED_INFRA_VERSION
variable_value: ${{ needs.get-current-version.outputs.version }}
environment: prod
secrets:
GH_TOKEN: ${{ secrets.RELEASE_VERSION_STORAGE_PAT }}
steps:
- name: Set GitHub variable for latest deployed infra version
run: |
gh variable set LATEST_DEPLOYED_INFRA_VERSION --body "${{ needs.get-current-version.outputs.version }}" --env prod --repo ${{ github.repository }}

dry-run-deploy-apps:
name: Dry run deploy apps to prod
Expand Down Expand Up @@ -129,15 +129,15 @@ jobs:

store-apps-version:
name: Store Latest Deployed Apps Version as GitHub Variable
runs-on: ubuntu-latest
needs: [deploy-apps, get-current-version]
if: ${{ needs.deploy-apps.result == 'success' }}
env:
uses: ./.github/workflows/workflow-store-github-env-variable.yml
with:
variable_name: LATEST_DEPLOYED_APPS_VERSION
variable_value: ${{ needs.get-current-version.outputs.version }}
environment: prod
secrets:
GH_TOKEN: ${{ secrets.RELEASE_VERSION_STORAGE_PAT }}
steps:
- name: Set GitHub variable for latest deployed apps version
run: |
gh variable set LATEST_DEPLOYED_APPS_VERSION --body "${{ needs.get-current-version.outputs.version }}" --env prod --repo ${{ github.repository }}

deploy-slack-notifier:
name: Deploy slack notifier (prod)
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci-cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:

store-infra-version:
name: Store Latest Deployed Infra Version as GitHub Variable
runs-on: ubuntu-latest
needs: [deploy-infra, get-current-version]
if: ${{ needs.deploy-infra.result == 'success' }}
env:
uses: ./.github/workflows/workflow-store-github-env-variable.yml
with:
variable_name: LATEST_DEPLOYED_INFRA_VERSION
variable_value: ${{ needs.get-current-version.outputs.version }}
environment: staging
secrets:
GH_TOKEN: ${{ secrets.RELEASE_VERSION_STORAGE_PAT }}
steps:
- name: Set GitHub variable for latest deployed infra version
run: |
gh variable set LATEST_DEPLOYED_INFRA_VERSION --body "${{ needs.get-current-version.outputs.version }}" --env staging --repo ${{ github.repository }}

publish:
name: Build and publish docker images
Expand Down Expand Up @@ -95,15 +95,15 @@ jobs:

store-apps-version:
name: Store Latest Deployed Apps Version as GitHub Variable
runs-on: ubuntu-latest
needs: [deploy-apps, get-current-version]
if: ${{ needs.deploy-apps.result == 'success' }}
env:
uses: ./.github/workflows/workflow-store-github-env-variable.yml
with:
variable_name: LATEST_DEPLOYED_APPS_VERSION
variable_value: ${{ needs.get-current-version.outputs.version }}
environment: staging
secrets:
GH_TOKEN: ${{ secrets.RELEASE_VERSION_STORAGE_PAT }}
steps:
- name: Set GitHub variable for latest deployed apps version
run: |
gh variable set LATEST_DEPLOYED_APPS_VERSION --body "${{ needs.get-current-version.outputs.version }}" --env staging

deploy-slack-notifier:
name: Deploy slack notifier (staging)
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci-cd-yt01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ jobs:

store-infra-version:
name: Store Latest Deployed Infra Version as GitHub Variable
runs-on: ubuntu-latest
needs: [deploy-infra, get-current-version]
if: ${{ needs.deploy-infra.result == 'success' }}
env:
uses: ./.github/workflows/workflow-store-github-env-variable.yml
with:
variable_name: LATEST_DEPLOYED_INFRA_VERSION
variable_value: ${{ needs.get-current-version.outputs.version }}
environment: yt01
secrets:
GH_TOKEN: ${{ secrets.RELEASE_VERSION_STORAGE_PAT }}
steps:
- name: Set GitHub variable for latest deployed infra version
run: |
gh variable set LATEST_DEPLOYED_INFRA_VERSION --body "${{ needs.get-current-version.outputs.version }}" --env yt01 --repo ${{ github.repository }}

deploy-apps:
name: Deploy apps to yt01
Expand Down Expand Up @@ -97,15 +97,15 @@ jobs:

store-apps-version:
name: Store Latest Deployed Apps Version as GitHub Variable
runs-on: ubuntu-latest
needs: [deploy-apps, get-current-version]
if: ${{ needs.deploy-apps.result == 'success' }}
env:
uses: ./.github/workflows/workflow-store-github-env-variable.yml
with:
variable_name: LATEST_DEPLOYED_APPS_VERSION
variable_value: ${{ needs.get-current-version.outputs.version }}
environment: yt01
secrets:
GH_TOKEN: ${{ secrets.RELEASE_VERSION_STORAGE_PAT }}
steps:
- name: Set GitHub variable for latest deployed apps version
run: |
gh variable set LATEST_DEPLOYED_APPS_VERSION --body "${{ needs.get-current-version.outputs.version }}" --env yt01 --repo ${{ github.repository }}

deploy-slack-notifier:
name: Deploy slack notifier (yt01)
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/dispatch-k6-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:
environment:
description: 'Environment'
required: true
default: 'staging'
default: 'yt01'
type: choice
options:
- test
- staging
- performance
- yt01
tokens:
description: 'Tokens to generate; for create dialog, search, none, or both'
required: true
Expand All @@ -26,10 +26,15 @@ on:
- enterprise
- personal
- none
tag:
description: 'tag the performance test'
required: true
default: 'Performance test'
type: string
vus:
description: 'Number of VUS'
required: true
default: 10
default: 1
type: number
duration:
description: 'Duration of test, ie 30s, 1m, 10m'
Expand All @@ -43,8 +48,12 @@ on:
type: choice
options:
- 'tests/k6/tests/serviceowner/performance/create-dialog.js'
- 'tests/k6/tests/enduser/performance/simple-search.js'
- 'tests/k6/tests/serviceowner/performance/create-remove-dialog.js'
- 'tests/k6/tests/serviceowner/performance/serviceowner-search.js'
- 'tests/k6/tests/enduser/performance/enduser-search.js'
- 'tests/k6/tests/graphql/performance/graphql-search.js'

run-name: ${{ inputs.tag }} vus ${{ inputs.vus }} duration ${{ inputs.duration }}
jobs:
k6-performance:
name: "Run K6 performance test"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/workflow-run-k6-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
jobs:
k6-test:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
checks: write
pull-requests: write
Expand Down
Loading

0 comments on commit ae709b9

Please sign in to comment.