Skip to content

Commit 7c94f27

Browse files
committed
build(sln): update to Xperience v31.1.0, q&a notifications, member timezones
1 parent 6a4051f commit 7c94f27

File tree

273 files changed

+11786
-5785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+11786
-5785
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,39 @@ on:
2020
- "**.js"
2121
- "**.razor"
2222

23+
# Cancel in-progress runs when a new commit is pushed
24+
concurrency:
25+
group:
26+
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
2329
jobs:
2430
build_and_test:
2531
name: Build and Test
2632
runs-on: ubuntu-latest
33+
timeout-minutes: 30 # Fail if workflow takes longer than expected
2734
defaults:
2835
run:
2936
shell: pwsh
3037

3138
env:
3239
ASPNETCORE_ENVIRONMENT: CI
33-
NODE_VERSION: ""
3440
DATABASE_BACKUP_FILENAME: ""
3541
DOTNET_CLI_TELEMETRY_OPTOUT: 1
3642
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
3743
DOTNET_NOLOGO: 1
44+
NO_COLOR: 1
45+
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: false
3846
PROJECT_NAME: Kentico.Community.Portal.Web
3947
ASPNETCORE_URLS: https://localhost:45039;https://localhost:45040
4048
STATUS_CHECK_URL: https://localhost:45039/status
49+
SQL_SA_PASSWORD: Pass@12345
4150

4251
steps:
52+
# === Environment Setup ===
4353
- uses: actions/checkout@v6
4454

45-
- name: "Install Node.js from package.json version"
55+
- name: Setup Node.js (from package.json)
4656
uses: actions/setup-node@v6
4757
with:
4858
node-version-file: "src/Kentico.Community.Portal.Web/package.json"
@@ -62,6 +72,7 @@ jobs:
6272
restore-keys: |
6373
${{ runner.os }}-nuget-
6474
75+
# === Build ===
6576
- name: Install dependencies
6677
run: dotnet restore --locked-mode
6778

@@ -71,6 +82,7 @@ jobs:
7182
-c Release `
7283
--no-restore
7384
85+
# === Database Setup ===
7486
- name: Get Database Backup Name
7587
run: |
7688
$latestBackup = Get-ChildItem -Path "./database" -Filter "*.zip" | Select-Object -ExpandProperty BaseName
@@ -82,43 +94,45 @@ jobs:
8294
-Path "./database/${{ env.DATABASE_BACKUP_FILENAME }}.zip" `
8395
-DestinationPath "./database"
8496
85-
- name: Install a SQL Server suite of tools (SQLEngine, SQLPackage)
86-
uses: potatoqualitee/mssqlsuite@v1.11
97+
- name: Install SQL Server (2022)
98+
uses: potatoqualitee/mssqlsuite@v1.12
8799
with:
88100
install: sqlpackage, sqlengine, sqlclient
89-
sa-password: Pass@12345
101+
sa-password: ${{ env.SQL_SA_PASSWORD }}
90102
version: 2022
91103

92-
- name: Restore Database .bak
104+
- name: Restore Database from Backup
93105
run: |
106+
Write-Output "Copying database backup to SQL container..."
94107
docker cp "./database/${{ env.DATABASE_BACKUP_FILENAME }}" sql:/var/backups/Kentico.Community.bak
95108
docker exec -u root sql bash -c "chown mssql:mssql /var/backups/Kentico.Community.bak"
96109
docker exec -u root sql bash -c "chmod 644 /var/backups/Kentico.Community.bak"
97110
98-
# First, get the logical file names from the backup
99-
Write-Output "Getting logical file names from backup..."
111+
Write-Output "Verifying backup file contents..."
100112
$fileList = sqlcmd `
101113
-S localhost `
102114
-d master `
103115
-U "sa" `
104-
-P "Pass@12345" `
116+
-P "${{ env.SQL_SA_PASSWORD }}" `
105117
-N o `
106118
-C `
107119
-Q "RESTORE FILELISTONLY FROM DISK = '/var/backups/Kentico.Community.bak'"
108120
109-
Write-Output "Backup file contents:"
110121
Write-Output $fileList
111122
112-
# Now restore the database
123+
Write-Output "Restoring database..."
113124
sqlcmd `
114125
-S localhost `
115126
-d master `
116127
-U "sa" `
117-
-P "Pass@12345" `
128+
-P "${{ env.SQL_SA_PASSWORD }}" `
118129
-N o `
119130
-C `
120131
-i ./database/backup-restore.sql
121132
133+
Write-Output "✓ Database restored successfully"
134+
"## ✓ Database Restored" >> $env:GITHUB_STEP_SUMMARY
135+
122136
- name: Restore License Key
123137
working-directory: "./scripts"
124138
run: |
@@ -128,25 +142,36 @@ jobs:
128142
working-directory: "./scripts"
129143
run: |
130144
./Restore-CI.ps1
145+
"## ✓ CI Repository Restored" >> $env:GITHUB_STEP_SUMMARY
131146
147+
# === Testing ===
132148
- name: Run Unit Tests
149+
working-directory: "./scripts"
133150
run: |
134-
dotnet test `
135-
--test-modules ./test/Kentico.Community.Portal.Web.Tests/bin/Release/net10.0/Kentico.Community.Portal.Web.Tests.dll
151+
Write-Output "## 🧪 Unit Tests" >> $env:GITHUB_STEP_SUMMARY
152+
153+
$summary = ./Run-Unit-Tests.ps1 -ProjectPath "../test/Kentico.Community.Portal.Web.Tests/Kentico.Community.Portal.Web.Tests.csproj"
154+
$summary >> $env:GITHUB_STEP_SUMMARY
136155
137156
- name: Run Integration Tests
157+
working-directory: "./scripts"
138158
run: |
139-
dotnet test `
140-
--test-modules ./test/Kentico.Community.Portal.Web.Integration.Tests/bin/Release/net10.0/Kentico.Community.Portal.Web.Integration.Tests.dll
159+
Write-Output "## 🔗 Integration Tests" >> $env:GITHUB_STEP_SUMMARY
160+
161+
$summary = ./Run-Integration-Tests.ps1 -ProjectPath "../test/Kentico.Community.Portal.Web.Integration.Tests/Kentico.Community.Portal.Web.Integration.Tests.csproj"
162+
$summary >> $env:GITHUB_STEP_SUMMARY
141163
164+
# === E2E Testing ===
142165
- name: Publish Application
143166
run: |
167+
Write-Output "Publishing application..."
144168
dotnet publish `
145169
./src/${{ env.PROJECT_NAME }} `
146170
-c Release `
147171
-o ./publish `
148172
--no-build `
149173
--no-restore
174+
Write-Output "✓ Application published to ./publish"
150175
151176
- name: Cache Playwright browsers
152177
id: playwright-cache
@@ -162,54 +187,48 @@ jobs:
162187
- name: Install Playwright Dependencies
163188
if: steps.playwright-cache.outputs.cache-hit != 'true'
164189
run: |
190+
Write-Output "Installing Playwright browsers..."
165191
# Must be path to the RELEASE build
166192
./test/Kentico.Community.Portal.Web.E2E.Tests/bin/Release/net10.0/playwright.ps1 install
193+
Write-Output "✓ Playwright browsers installed"
167194
168-
- name: Install Azurite from npm
169-
run: npm install -g azurite@3.33.0
170-
- name: Run Azurite in Background
171-
run: azurite -s -l ./.azurite &
195+
- name: Cache Azurite
196+
id: azurite-cache
197+
uses: actions/cache@v5
198+
with:
199+
path: ~/.npm
200+
key: ${{ runner.os }}-azurite-3.35.0
201+
202+
- name: Install Azurite
203+
if: steps.azurite-cache.outputs.cache-hit != 'true'
204+
run: npm install -g azurite@3.35.0
205+
206+
- name: Start Azurite (Background)
207+
run: |
208+
azurite -s -l ./.azurite &
209+
Write-Output "✓ Azurite storage emulator started"
172210
173-
- name: Run Application and E2E Tests
211+
- name: Run E2E Tests (with App)
212+
working-directory: "./scripts"
174213
run: |
175-
# Run the ASP.NET Core app as a background job
176-
cd ./publish
177-
Start-Job -ScriptBlock { dotnet ./${{ env.PROJECT_NAME }}.dll } -Name ${{ env.PROJECT_NAME }}
178-
Receive-Job -Name ${{ env.PROJECT_NAME }}
179-
cd ../
180-
181-
# The ASP.NET Core app can take a few seconds to start, so we delay running tests
182-
# until it is ready, and fail if we go over a maximum wait time
183-
$limit = 10
184-
$attempts = 0
185-
$success = $false
186-
187-
while ($attempts -lt $limit -and -not $success) {
188-
Start-Sleep -Seconds 1
189-
try {
190-
$response = Invoke-WebRequest -Uri ${{ env.STATUS_CHECK_URL }} -Method Get -SkipCertificateCheck
191-
if ($response.StatusCode -eq 200) {
192-
Write-Output "Application is ready."
193-
$success = $true
194-
}
195-
}
196-
catch {
197-
Write-Output "Attempt $attempts - Application not ready yet."
198-
}
199-
$attempts++
200-
}
201-
202-
if (-not $success) {
203-
Write-Output "Application did not respond in time."
204-
exit 1
205-
}
206-
207-
# Run the E2E tests
208-
dotnet test `
209-
--test-modules ./test/Kentico.Community.Portal.Web.E2E.Tests/bin/Release/net10.0/Kentico.Community.Portal.Web.E2E.Tests.dll `
210-
--settings ./test/e2e.runsettings
211-
212-
# Stop the background ASP.NET Core application
213-
Receive-Job -Name ${{ env.PROJECT_NAME }}
214-
Stop-Job -Name ${{ env.PROJECT_NAME }}
215-
Remove-Job -Name ${{ env.PROJECT_NAME }}
214+
Write-Output "## 🎭 E2E Tests" >> $env:GITHUB_STEP_SUMMARY
215+
216+
$summary = ./Run-E2E-Tests.ps1 `
217+
-PublishPath "../publish" `
218+
-AppDllName "${{ env.PROJECT_NAME }}.dll" `
219+
-StatusCheckUrl "${{ env.STATUS_CHECK_URL }}" `
220+
-TestProjectPath "../test/Kentico.Community.Portal.Web.E2E.Tests/Kentico.Community.Portal.Web.E2E.Tests.csproj" `
221+
-TestSettings "../test/e2e.runsettings" `
222+
-MaxWaitSeconds 30
223+
$summary >> $env:GITHUB_STEP_SUMMARY
224+
225+
# === Artifacts (on failure) ===
226+
- name: Upload Application Logs (on failure)
227+
if: failure()
228+
uses: actions/upload-artifact@v4
229+
with:
230+
name: application-logs-${{ github.run_number }}
231+
path: |
232+
publish/app-*.log
233+
retention-days: 7
234+
if-no-files-found: ignore

.github/workflows/deploy.yml

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,40 @@ on:
1616
- qa
1717
- uat
1818
- prod
19+
archive_package:
20+
description: "Archive deployment package as artifact"
21+
required: false
22+
default: false
23+
type: boolean
24+
25+
# Prevent concurrent deployments to the same environment
26+
concurrency:
27+
group: deploy-${{ inputs.environment }}
28+
cancel-in-progress: false
1929

2030
jobs:
2131
createDeploymentPackage:
2232
name: Create SaaS Deployment Package
2333
runs-on: ubuntu-latest
34+
timeout-minutes: 30
2435
defaults:
2536
run:
2637
shell: pwsh
2738

2839
env:
2940
ASPNETCORE_ENVIRONMENT: CI
30-
NODE_VERSION: ""
3141
DATABASE_BACKUP_FILENAME: ""
3242
DOTNET_CLI_TELEMETRY_OPTOUT: 1
3343
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
3444
DOTNET_NOLOGO: 1
3545
PROJECT_NAME: Kentico.Community.Portal.Web
46+
SQL_SA_PASSWORD: Pass@12345
3647

3748
steps:
49+
# === Environment Setup ===
3850
- uses: actions/checkout@v6
3951

40-
- name: "Install Node.js from package.json version"
52+
- name: Setup Node.js (from package.json)
4153
uses: actions/setup-node@v6
4254
with:
4355
node-version-file: "src/Kentico.Community.Portal.Web/package.json"
@@ -57,6 +69,7 @@ jobs:
5769
restore-keys: |
5870
${{ runner.os }}-nuget-
5971
72+
# === Build ===
6073
- name: Install dependencies
6174
run: dotnet restore --locked-mode
6275

@@ -66,6 +79,7 @@ jobs:
6679
-c Release `
6780
--no-restore
6881
82+
# === Database Setup ===
6983
- name: Get Database Backup Name
7084
run: |
7185
$latestBackup = Get-ChildItem -Path "./database" -Filter "*.zip" | Select-Object -ExpandProperty BaseName
@@ -77,28 +91,33 @@ jobs:
7791
-Path "./database/${{ env.DATABASE_BACKUP_FILENAME }}.zip" `
7892
-DestinationPath "./database"
7993
80-
- name: Install a SQL Server suite of tools (SQLEngine, SQLPackage)
81-
uses: potatoqualitee/mssqlsuite@v1.11
94+
- name: Install SQL Server (2022)
95+
uses: potatoqualitee/mssqlsuite@v1.12
8296
with:
8397
install: sqlpackage, sqlengine, sqlclient
84-
sa-password: Pass@12345
98+
sa-password: ${{ env.SQL_SA_PASSWORD }}
8599
version: 2022
86100

87-
- name: Restore Database .bak
101+
- name: Restore Database from Backup
88102
run: |
103+
Write-Output "Copying database backup to SQL container..."
89104
docker cp "./database/${{ env.DATABASE_BACKUP_FILENAME }}" sql:/var/backups/Kentico.Community.bak
90105
docker exec -u root sql bash -c "chown mssql:mssql /var/backups/Kentico.Community.bak"
91106
docker exec -u root sql bash -c "chmod 644 /var/backups/Kentico.Community.bak"
92107
108+
Write-Output "Restoring database..."
93109
sqlcmd `
94110
-S localhost `
95111
-d master `
96112
-U "sa" `
97-
-P "Pass@12345" `
113+
-P "${{ env.SQL_SA_PASSWORD }}" `
98114
-N o `
99115
-C `
100116
-i ./database/backup-restore.sql
101117
118+
Write-Output "✓ Database restored successfully"
119+
"## ✓ Database Restored" >> $env:GITHUB_STEP_SUMMARY
120+
102121
- name: Restore License Key
103122
working-directory: "./scripts"
104123
run: |
@@ -108,18 +127,42 @@ jobs:
108127
working-directory: "./scripts"
109128
run: |
110129
./Restore-CI.ps1
130+
"## ✓ CI Repository Restored" >> $env:GITHUB_STEP_SUMMARY
111131
132+
# === Package Generation ===
112133
- name: Generate Deployment Package
113134
working-directory: "./scripts"
114135
run: |
136+
Write-Output "Generating deployment package with zero-downtime support..."
115137
./Export-DeploymentPackage.ps1 -ZeroDowntimeSupportEnabled -CompressPackage
138+
Write-Output "✓ Deployment package created"
139+
"## 📦 Deployment Package Created" >> $env:GITHUB_STEP_SUMMARY
116140
141+
# === Deployment ===
117142
- name: Upload Deployment Package to ${{ inputs.environment }}
118143
run: |
144+
Write-Output "Uploading deployment package to ${{ inputs.environment }}..."
145+
Write-Output "Reason: ${{ inputs.reason }}"
146+
119147
$headers = @{ Authorization = "Bearer ${{ secrets.XPERIENCE_PORTAL_DEPLOYMENT_PAT }}" }
120-
Invoke-RestMethod `
148+
$response = Invoke-RestMethod `
121149
-Uri https://xperience-portal.com/api/deployment/upload/${{ secrets.XPERIENCE_PORTAL_PROJECT_GUID }}/${{ inputs.environment }} `
122150
-Method Post `
123151
-InFile './DeploymentPackage.zip' `
124152
-ContentType "application/zip" `
125153
-Headers $headers
154+
155+
Write-Output "✓ Package uploaded successfully to ${{ inputs.environment }}"
156+
"## ✅ Deployed to ${{ inputs.environment }}" >> $env:GITHUB_STEP_SUMMARY
157+
"**Reason:** ${{ inputs.reason }}" >> $env:GITHUB_STEP_SUMMARY
158+
159+
- name: Archive Deployment Package
160+
if: ${{ inputs.archive_package }}
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name:
164+
deployment-package-${{ inputs.environment }}-${{ github.run_number
165+
}}
166+
path: DeploymentPackage.zip
167+
retention-days: 30
168+
compression-level: 0 # Already compressed

0 commit comments

Comments
 (0)