Skip to content

Commit c61382c

Browse files
authored
Add CI workflow for developer CLI and tighten frontend-quality gates (#890)
### Summary & Motivation Bring the developer CLI under CI and close two gaps in the existing frontend pipeline. - Add `.github/workflows/developer-cli.yml` that runs build, format, and lint on the developer CLI whenever files under `developer-cli/**` change. Mirrors the backend pattern from `main.yml` and skips the CLI's self-rebuild path with `DEVELOPERCLI_SKIP_CHANGE_DETECTION=1`. Make it a required check on `main` to gate merges. - Add a frontend formatting diff check to `main.yml` and `account.yml` (run `npm run format` then `git diff --exit-code`). The backend already had this; the frontend only ran lint, so `oxfmt`/`oxlint --fix` drift could land silently. - Replace the AI-driven `translate` developer-CLI command with a missing-translation check inside `lint --frontend`. The check parses every non-`en-US` `.po` file (excluding `node_modules`) with `Karambolo.PO` and fails with a per-file count when entries have empty `msgstr`. Drops the `translate` command and its OpenAI/Azure dependency closure (Azure.AI.OpenAI, Microsoft.Extensions.AI{,.OpenAI}, OpenAI). `Karambolo.PO` is kept for the new check; `SecretHelper` is kept since downstream projects may use it. - Fill in the existing 26 missing Danish translations in `account/WebApp` and `account/BackOffice` so the new check passes on this branch. - Drop dotCover from the PR workflows in `main.yml` / `account.yml`. SonarCloud's static analysis stays; coverage is not enforced on PRs. Re-introducing coverage on `main` (full-backend, no TypeScript) is tracked separately. - Drop the now-stale Coverage badge from `README.md` since coverage is no longer produced on every PR. - Drop the redundant `forcePrompt:` named argument in `InstallCommand.GitHooksSync.Sync(true)` so JetBrains cleanup doesn't rewrite it under the new format gate. ### Checklist - [x] I have added tests, or done manual regression tests - [x] I have updated the documentation, if necessary
2 parents 892592d + f1b7ee5 commit c61382c

9 files changed

Lines changed: 195 additions & 546 deletions

File tree

.github/workflows/account.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
working-directory: application
104104
run: npx turbo run build --filter=@repo/emails
105105

106-
- name: Run Tests with dotCover and SonarScanner Reporting
106+
- name: Run Tests with SonarScanner Analysis
107107
working-directory: application
108108
env:
109109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -114,9 +114,9 @@ jobs:
114114
dotnet build account/Account.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
115115
dotnet test account/Account.slnf --no-build
116116
else
117-
dotnet sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.dotcover.reportsPaths="coverage/dotCover.html" &&
117+
dotnet sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.host.url="https://sonarcloud.io" &&
118118
dotnet build account/Account.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
119-
dotnet dotcover test account/Account.slnf --no-build --dcOutput=coverage/dotCover.html --dcReportType=HTML --dcFilters="+:Account*;+:SharedKernel;-:*.Tests;-:type=*.AppHost.*" &&
119+
dotnet test account/Account.slnf --no-build &&
120120
dotnet sonarscanner end
121121
fi
122122
@@ -223,10 +223,32 @@ jobs:
223223
working-directory: application/account/WebApp
224224
run: npm run lint
225225

226+
- name: Check for Frontend Formatting Issues
227+
working-directory: application/account/WebApp
228+
run: |
229+
npm run format
230+
231+
# Check for any changes made by the code formatter
232+
git diff --exit-code || {
233+
echo "Formatting issues detected. Please run 'npm run format' from /application/account/WebApp folder locally and commit the formatted code."
234+
exit 1
235+
}
236+
226237
- name: Run Back Office Lint
227238
working-directory: application/account/BackOffice
228239
run: npm run lint
229240

241+
- name: Check for Back Office Formatting Issues
242+
working-directory: application/account/BackOffice
243+
run: |
244+
npm run format
245+
246+
# Check for any changes made by the code formatter
247+
git diff --exit-code || {
248+
echo "Formatting issues detected. Please run 'npm run format' from /application/account/BackOffice folder locally and commit the formatted code."
249+
exit 1
250+
}
251+
230252
database-migrations-stage:
231253
name: Database Staging
232254
if: ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Developer CLI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "developer-cli/**"
9+
- ".github/workflows/developer-cli.yml"
10+
- "!**.md"
11+
pull_request:
12+
paths:
13+
- "developer-cli/**"
14+
- ".github/workflows/developer-cli.yml"
15+
- "!**.md"
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build-and-verify:
23+
name: Build, Lint, and Format
24+
runs-on: ubuntu-24.04
25+
26+
env:
27+
# Skip the CLI's self-rebuild on every invocation; we build explicitly below.
28+
DEVELOPERCLI_SKIP_CHANGE_DETECTION: "1"
29+
30+
steps:
31+
- name: Checkout Code
32+
uses: actions/checkout@v6
33+
34+
- name: Setup .NET Core SDK
35+
uses: actions/setup-dotnet@v5
36+
with:
37+
global-json-file: developer-cli/global.json
38+
39+
- name: Restore .NET Tools
40+
working-directory: developer-cli
41+
run: dotnet tool restore
42+
43+
- name: Restore .NET Dependencies
44+
working-directory: developer-cli
45+
run: dotnet restore
46+
47+
- name: Build Developer CLI
48+
working-directory: developer-cli
49+
run: dotnet build DeveloperCli.slnx --no-restore
50+
51+
- name: Run Code Linting
52+
working-directory: developer-cli
53+
run: |
54+
dotnet run --no-build -- lint --cli --no-build | tee lint-output.log
55+
56+
if ! grep -q "No developer-cli issues found!" lint-output.log; then
57+
echo "Code linting issues found."
58+
exit 1
59+
fi
60+
61+
- name: Check for Code Formatting Issues
62+
working-directory: developer-cli
63+
run: |
64+
dotnet run --no-build -- format --cli --no-build
65+
66+
# Check for any changes made by the code formatter
67+
git diff --exit-code || {
68+
echo "Formatting issues detected. Please run 'dotnet run -- format --cli' from /developer-cli folder locally and commit the formatted code."
69+
exit 1
70+
}

.github/workflows/main.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
working-directory: application
104104
run: npx turbo run build --filter=@repo/emails
105105

106-
- name: Run Tests with dotCover and SonarScanner Reporting
106+
- name: Run Tests with SonarScanner Analysis
107107
working-directory: application
108108
env:
109109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -114,9 +114,9 @@ jobs:
114114
dotnet build main/Main.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
115115
dotnet test main/Main.slnf --no-build
116116
else
117-
dotnet sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.dotcover.reportsPaths="coverage/dotCover.html" &&
117+
dotnet sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.host.url="https://sonarcloud.io" &&
118118
dotnet build main/Main.slnf --no-restore /p:Version=${{ steps.generate_version.outputs.version }} /p:DeploymentCommitHash=${{ github.event.pull_request.head.sha || github.sha }} /p:DeploymentGithubActionId=${{ github.run_id }} &&
119-
dotnet dotcover test main/Main.slnf --no-build --dcOutput=coverage/dotCover.html --dcReportType=HTML --dcFilters="+:Main*;+:SharedKernel;-:*.Tests;-:type=*.AppHost.*" &&
119+
dotnet test main/Main.slnf --no-build &&
120120
dotnet sonarscanner end
121121
fi
122122
@@ -218,6 +218,17 @@ jobs:
218218
working-directory: application/main/WebApp
219219
run: npm run lint
220220

221+
- name: Check for Frontend Formatting Issues
222+
working-directory: application/main/WebApp
223+
run: |
224+
npm run format
225+
226+
# Check for any changes made by the code formatter
227+
git diff --exit-code || {
228+
echo "Formatting issues detected. Please run 'npm run format' from /application/main/WebApp folder locally and commit the formatted code."
229+
exit 1
230+
}
231+
221232
database-migrations-stage:
222233
name: Database Staging
223234
if: ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
[![GitHub issues with roadmap label](https://img.shields.io/github/issues-raw/platformplatform/PlatformPlatform/roadmap?label=roadmap&logo=github&color=%23006B75)](https://github.com/orgs/PlatformPlatform/projects/2/views/2?filterQuery=is%3Aopen+label%3Aroadmap)
1212
[![GitHub issues with bug label](https://img.shields.io/github/issues-raw/platformplatform/PlatformPlatform/bug?label=bugs&logo=github&color=red)](https://github.com/platformplatform/PlatformPlatform/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
1313

14-
<a href="https://sonarcloud.io/component_measures?id=PlatformPlatform_platformplatform&metric=coverage" target="_blank" rel="noopener noreferrer"><img src="https://sonarcloud.io/api/project_badges/measure?project=PlatformPlatform_platformplatform&metric=coverage" alt="Coverage" /></a>
1514
<a href="https://sonarcloud.io/summary/overall?id=PlatformPlatform_platformplatform" target="_blank" rel="noopener noreferrer"><img src="https://sonarcloud.io/api/project_badges/measure?project=PlatformPlatform_platformplatform&metric=alert_status" alt="Quality Gate Status" /></a>
1615
<a href="https://sonarcloud.io/component_measures?id=PlatformPlatform_platformplatform&metric=Security" target="_blank" rel="noopener noreferrer"><img src="https://sonarcloud.io/api/project_badges/measure?project=PlatformPlatform_platformplatform&metric=security_rating" alt="Security Rating" /></a>
1716
<a href="https://sonarcloud.io/component_measures?id=PlatformPlatform_platformplatform&metric=Reliability" target="_blank" rel="noopener noreferrer"><img src="https://sonarcloud.io/api/project_badges/measure?project=PlatformPlatform_platformplatform&metric=reliability_rating" alt="Reliability Rating" /></a>

application/account/WebApp/shared/translations/locale/da-DK.po

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ msgid "Achieved in Microsoft Defender for Cloud following Azure best practices"
186186
msgstr "Opnået i Microsoft Defender for Cloud ved at følge Azures bedste praksis"
187187

188188
msgid "Action"
189-
msgstr ""
189+
msgstr "Handling"
190190

191191
msgid "Activating subscription"
192192
msgstr "Aktiverer abonnement"
@@ -204,7 +204,7 @@ msgid "Active users in the past 30 days"
204204
msgstr "Aktive brugere i de sidste 30 dage"
205205

206206
msgid "Add an extra layer of security to your account."
207-
msgstr ""
207+
msgstr "Tilføj et ekstra sikkerhedslag til din konto."
208208

209209
msgid "Add billing information"
210210
msgstr "Tilføj faktureringsoplysninger"
@@ -461,7 +461,7 @@ msgid "Bold"
461461
msgstr "Fed"
462462

463463
msgid "Bordered row for stand-alone settings or list items."
464-
msgstr ""
464+
msgstr "Række med kant til selvstændige indstillinger eller listeelementer."
465465

466466
msgid "Bottom"
467467
msgstr "Bund"
@@ -1059,7 +1059,7 @@ msgid "Email address"
10591059
msgstr "E-mailadresse"
10601060

10611061
msgid "Email me when a new device signs in."
1062-
msgstr ""
1062+
msgstr "Send mig en e-mail, når en ny enhed logger ind."
10631063

10641064
msgid "Email support"
10651065
msgstr "E-mail-support"
@@ -1137,7 +1137,7 @@ msgid "Export as PDF"
11371137
msgstr "Eksporter som PDF"
11381138

11391139
msgid "External"
1140-
msgstr ""
1140+
msgstr "Ekstern"
11411141

11421142
msgid "Extra large"
11431143
msgstr "Ekstra stor"
@@ -1290,7 +1290,7 @@ msgid "Indeterminate"
12901290
msgstr "Ubestemt"
12911291

12921292
msgid "Indeterminate loading indicator. Use Progress when you can show how much work remains; reach for Spinner when you can't."
1293-
msgstr ""
1293+
msgstr "Ubestemt indlæsningsindikator. Brug Progress, når du kan vise, hvor meget arbejde der er tilbage; vælg Spinner, når du ikke kan."
12941294

12951295
msgid "Indian"
12961296
msgstr "Indisk"
@@ -1344,13 +1344,13 @@ msgid "Italic"
13441344
msgstr "Kursiv"
13451345

13461346
msgid "Item — clickable row"
1347-
msgstr ""
1347+
msgstr "Element — klikbar række"
13481348

13491349
msgid "Item — image media"
1350-
msgstr ""
1350+
msgstr "Element — billedmedie"
13511351

13521352
msgid "Item — variants"
1353-
msgstr ""
1353+
msgstr "Element — varianter"
13541354

13551355
msgid "Item archived"
13561356
msgstr "Element arkiveret"
@@ -1359,7 +1359,7 @@ msgid "Item deleted"
13591359
msgstr "Element slettet"
13601360

13611361
msgid "ItemGroup — settings list"
1362-
msgstr ""
1362+
msgstr "ItemGroup — indstillingsliste"
13631363

13641364
msgid "January - June 2024"
13651365
msgstr "Januar - juni 2024"
@@ -1506,7 +1506,7 @@ msgid "Logged out"
15061506
msgstr "Logget ud"
15071507

15081508
msgid "Login alerts"
1509-
msgstr ""
1509+
msgstr "Login-advarsler"
15101510

15111511
msgid "Login method"
15121512
msgstr "Login-metode"
@@ -1533,7 +1533,7 @@ msgid "Main navigation"
15331533
msgstr "Hovednavigation"
15341534

15351535
msgid "Manage"
1536-
msgstr ""
1536+
msgstr "Administrer"
15371537

15381538
msgid "Manage subscription"
15391539
msgstr "Administrer abonnement"
@@ -1641,7 +1641,7 @@ msgid "Multi-select summary side pane"
16411641
msgstr "Oversigtspanel for flervalg"
16421642

16431643
msgid "Muted"
1644-
msgstr ""
1644+
msgstr "Dæmpet"
16451645

16461646
msgid "Name"
16471647
msgstr "Navn"
@@ -1740,7 +1740,7 @@ msgid "Number (integer)"
17401740
msgstr "Tal (heltal)"
17411741

17421742
msgid "Off"
1743-
msgstr ""
1743+
msgstr "Fra"
17441744

17451745
msgid "OK"
17461746
msgstr "OK"
@@ -1749,7 +1749,7 @@ msgid "Okonomiyaki"
17491749
msgstr "Okonomiyaki"
17501750

17511751
msgid "On"
1752-
msgstr ""
1752+
msgstr "Til"
17531753

17541754
msgid "One-time code"
17551755
msgstr "Engangskode"
@@ -1824,7 +1824,7 @@ msgid "Palak paneer"
18241824
msgstr "Palak paneer"
18251825

18261826
msgid "Passkeys"
1827-
msgstr ""
1827+
msgstr "Passkeys"
18281828

18291829
msgid "Passwordless deployments"
18301830
msgstr "Adgangskodeløse implementeringer"
@@ -2388,7 +2388,7 @@ msgid "Sidebar footer"
23882388
msgstr "Sidemenu-sidefod"
23892389

23902390
msgid "Sign in without a password using your device."
2391-
msgstr ""
2391+
msgstr "Log ind uden adgangskode med din enhed."
23922392

23932393
msgid "Sign up"
23942394
msgstr "Tilmeld dig"
@@ -2421,10 +2421,10 @@ msgid "SLA"
24212421
msgstr "SLA"
24222422

24232423
msgid "Slider (range)"
2424-
msgstr ""
2424+
msgstr "Slider (interval)"
24252425

24262426
msgid "Slider with steps"
2427-
msgstr ""
2427+
msgstr "Slider med trin"
24282428

24292429
msgid "Slow-cooked classics"
24302430
msgstr "Langtidsstegte klassikere"
@@ -2463,7 +2463,7 @@ msgid "Spaghetti carbonara"
24632463
msgstr "Spaghetti carbonara"
24642464

24652465
msgid "Spinner"
2466-
msgstr ""
2466+
msgstr "Spinner"
24672467

24682468
msgid "Split buttons"
24692469
msgstr "Delte knapper"
@@ -2512,7 +2512,7 @@ msgid "Subscription"
25122512
msgstr "Abonnement"
25132513

25142514
msgid "Subtle background for grouped rows inside a panel."
2515-
msgstr ""
2515+
msgstr "Diskret baggrund til grupperede rækker i et panel."
25162516

25172517
msgid "Succeeded"
25182518
msgstr "Gennemført"
@@ -2542,7 +2542,7 @@ msgid "Tablet"
25422542
msgstr "Tablet"
25432543

25442544
msgid "Tabs"
2545-
msgstr ""
2545+
msgstr "Faner"
25462546

25472547
msgid "Tacos al pastor"
25482548
msgstr "Tacos al pastor"
@@ -2731,7 +2731,7 @@ msgid "Try again"
27312731
msgstr "Prøv igen"
27322732

27332733
msgid "Two-factor authentication"
2734-
msgstr ""
2734+
msgstr "Tofaktor-godkendelse"
27352735

27362736
msgid "Type a command or search..."
27372737
msgstr "Skriv en kommando eller søg..."
@@ -2921,7 +2921,7 @@ msgid "View profile"
29212921
msgstr "Se profil"
29222922

29232923
msgid "View profile verification"
2924-
msgstr ""
2924+
msgstr "Vis profilbekræftelse"
29252925

29262926
msgid "View users"
29272927
msgstr "Se brugere"
@@ -3038,7 +3038,7 @@ msgid "Your plan will be downgraded to {planName} at the end of your current bil
30383038
msgstr "Din plan vil blive nedgraderet til {planName} ved udgangen af din nuværende faktureringsperiode. Du beholder dine nuværende planfunktioner indtil da."
30393039

30403040
msgid "Your profile has been verified"
3041-
msgstr ""
3041+
msgstr "Din profil er blevet bekræftet"
30423042

30433043
msgid "Your scheduled downgrade has been cancelled."
30443044
msgstr "Din planlagte nedgradering er blevet afbrudt."

developer-cli/Commands/InstallCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private static void Execute(bool force)
6868
{
6969
AnsiConsole.WriteLine();
7070
RegisterAlias();
71-
GitHooksSync.Sync(forcePrompt: true);
71+
GitHooksSync.Sync(true);
7272
}
7373

7474
AnsiConsole.MarkupLine(

0 commit comments

Comments
 (0)