Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .claude/skills/format/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Auto-format code via the developer CLI - backend (.NET via JetBrain
# Format

```bash
dotnet run --project developer-cli -- format [--backend] [--frontend] [--cli] [--self-contained-system <name>] [--no-build] --quiet
dotnet run --project developer-cli -- format [--backend] [--frontend] [--cli] [--self-contained-system <name>] [--no-build] [--all-files] --quiet
```

Use `developer-cli` exactly as written - do not expand to an absolute worktree path.
Expand All @@ -16,8 +16,9 @@ Use `developer-cli` exactly as written - do not expand to an absolute worktree p
- `--cli` - the developer CLI itself
- `--self-contained-system <name>` - narrows backend formatting to one SCS (e.g. `account`, `main`)
- `--no-build` - skip the `dotnet tool restore` step (faster after a recent run)
- `--all-files` - format every file in the solution. Default is to format only `.cs` files changed against `origin/main` (faster).

No arguments formats everything. Unformatted code fails CI - commit all changes, never revert.
No arguments formats everything (changed-only by default). Unformatted code fails CI - commit all changes, never revert.

After `build` succeeds, run `format`, `lint`, `test` in parallel with `--no-build`.

Expand Down
22 changes: 16 additions & 6 deletions .claude/skills/lint/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Lint code via the developer CLI - backend (.NET via JetBrains inspe
# Lint

```bash
dotnet run --project developer-cli -- lint [--backend] [--frontend] [--cli] [--self-contained-system <name>] [--no-build] --quiet
dotnet run --project developer-cli -- lint [--backend] [--frontend] [--cli] [--self-contained-system <name>] [--no-build] [--changed-only] --quiet
```

Use `developer-cli` exactly as written - do not expand to an absolute worktree path.
Expand All @@ -16,18 +16,28 @@ Use `developer-cli` exactly as written - do not expand to an absolute worktree p
- `--cli` - the developer CLI itself
- `--self-contained-system <name>` - narrows backend linting to one SCS (e.g. `account`, `main`)
- `--no-build` - skip the rebuild step (faster after a recent build)
- `--changed-only` - lint only `.cs` files changed against `origin/main` (much faster; see guidance below)

No arguments lints everything. Every finding fails CI regardless of severity - fix all of them.
No arguments lints the whole solution. Every finding fails CI regardless of severity - fix all of them.

After `build` succeeds, run `format`, `lint`, `test` in parallel with `--no-build`. Backend lint is slow - run last. Frontend lint often needs code rewrites - run after each bigger change.

## When to use `--changed-only`

Inspectcode has cross-file rules ("unused public method", "member can be private", flow analysis across method calls). `--changed-only` only inspects the listed files - it doesn't catch issues in untouched files that became invalid because of edits elsewhere.

- **Routine work:** use `--changed-only`. Most lint findings are local (style, naming, hints) and the saving is large (~4m → ~30s).
- **Larger changes that affect other files** (refactoring a public API, deleting a method's only caller, changing a widely-used type): omit `--changed-only` and lint the full solution.

CI always lints the full solution, so anything missed by a local `--changed-only` run gets caught before merge.

## Examples

```bash
dotnet run --project developer-cli -- lint --quiet # everything
dotnet run --project developer-cli -- lint --backend --quiet # all backend
dotnet run --project developer-cli -- lint --frontend --quiet # frontend
dotnet run --project developer-cli -- lint --backend --self-contained-system main --quiet # one SCS
dotnet run --project developer-cli -- lint --quiet # everything (full solution)
dotnet run --project developer-cli -- lint --backend --changed-only --quiet # backend, changed files only (recommended for routine work)
dotnet run --project developer-cli -- lint --frontend --quiet # frontend
dotnet run --project developer-cli -- lint --backend --self-contained-system main --quiet # one SCS, full
```

## Always pass --quiet
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/_migrate-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ on:
apply_migrations:
required: true
type: boolean
build_artifact_name:
description: "Name of the artifact uploaded by the caller's build-and-test job that contains application/**/bin and application/**/obj"
required: true
type: string

outputs:
has_migrations_to_apply:
Expand Down Expand Up @@ -68,9 +72,18 @@ jobs:
working-directory: application
run: dotnet tool restore

- name: Build Backend Solution
- name: Download Backend Build Artifacts
uses: actions/download-artifact@v8
with:
name: ${{ inputs.build_artifact_name }}
path: application

# The artifact carries bin/ and obj/ but not the global NuGet package cache.
# `dotnet ef --no-build` loads compiled assemblies that reference packages by
# absolute path under ~/.nuget/packages — those must exist on this runner.
- name: Restore .NET Dependencies
working-directory: application
run: dotnet build ${{ inputs.relative_startup_project }}
run: dotnet restore ${{ inputs.relative_startup_project }}

- name: Login to Azure
uses: azure/login@v3
Expand Down
111 changes: 15 additions & 96 deletions .github/workflows/account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,25 @@ jobs:
# Generate a 512-bit key and set it as a user secret that can be use for token signing when running tests
dotnet user-secrets set "authentication-token-signing-key" "$(openssl rand -base64 64)" --id $USER_SECRETS_ID

- name: Setup Java JDK for SonarScanner
uses: actions/setup-java@v5
with:
distribution: "microsoft"
java-version: "17"

- name: Build Email Templates
working-directory: application
run: npx turbo run build --filter=@repo/emails

- name: Run Tests with SonarScanner Analysis
- name: Run Tests
working-directory: application
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
if [[ "${{ vars.SONAR_PROJECT_KEY }}" == "" ]] || [[ "${{ vars.SONAR_ORGANIZATION }}" == "" ]] || [[ "${{ secrets.SONAR_TOKEN }}" == "" ]]; then
echo "SonarCloud is not enabled. Skipping SonarCloud analysis."
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 }} &&
dotnet test account/Account.slnf --no-build
else
dotnet sonarscanner begin /k:"${{ vars.SONAR_PROJECT_KEY }}" /o:"${{ vars.SONAR_ORGANIZATION }}" /d:sonar.host.url="https://sonarcloud.io" &&
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 }} &&
dotnet test account/Account.slnf --no-build &&
dotnet sonarscanner end
fi
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 }}
dotnet test account/Account.slnf --no-build

- name: Save Backend Build Artifacts for Migration Plan
if: ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}
uses: actions/upload-artifact@v7
with:
name: account-build
path: |
application/**/bin
application/**/obj
retention-days: 1

- name: Build Frontend Artifacts
if: ${{ steps.determine_deployment.outputs.deploy_staging == 'true' }}
Expand Down Expand Up @@ -158,82 +151,6 @@ jobs:
with:
name: account-workers
path: application/account/Workers/publish/**/*

code-style-and-linting:
name: Code Style and Linting
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04

steps:
- name: Checkout Code
uses: actions/checkout@v6

- name: Setup Node.js Environment
uses: actions/setup-node@v6
with:
node-version: 24

- name: Install Node Modules
working-directory: application
run: npm ci

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: application/global.json

- name: Restore .NET Tools
working-directory: application
run: dotnet tool restore

- name: Restore .NET Dependencies
working-directory: application
run: dotnet restore

- name: Build Backend Solution
working-directory: application
run: dotnet build account/Account.slnf --no-restore

- name: Run Code Linting
working-directory: developer-cli
run: |
dotnet run lint --backend --self-contained-system account | tee lint-output.log

if ! grep -q "No backend issues found!" lint-output.log; then
echo "Code linting issues found."
exit 1
fi

- name: Check for Code Formatting Issues
working-directory: developer-cli
run: |
dotnet run format --backend --self-contained-system account

# Check for any changes made by the code formatter
git diff --exit-code || {
echo "Formatting issues detected. Please run 'dotnet run format --backend --self-contained-system account' from /developer-cli folder locally and commit the formatted code."
exit 1
}

- name: Build Frontend Artifacts
working-directory: application
run: npm run build

- name: Run Lint
working-directory: developer-cli
run: dotnet run -- lint --frontend

- name: Run Format
working-directory: developer-cli
run: |
dotnet run -- format --frontend

# Check for any changes made by the code formatter
git diff --exit-code || {
echo "Formatting issues detected. Please run 'dotnet run --project developer-cli -- format --frontend' locally and commit the formatted code."
exit 1
}

database-migrations-stage:
name: Database Staging
if: ${{ vars.STAGING_CLUSTER_ENABLED == 'true' }}
Expand All @@ -250,6 +167,7 @@ jobs:
relative_startup_project: account/Api/Account.Api.csproj
db_context: AccountDbContext
apply_migrations: ${{ needs.build-and-test.outputs.deploy_staging == 'true' }}
build_artifact_name: account-build

api-stage:
name: API Staging
Expand Down Expand Up @@ -322,6 +240,7 @@ jobs:
relative_startup_project: account/Api/Account.Api.csproj
db_context: AccountDbContext
apply_migrations: true
build_artifact_name: account-build

api-prod1:
name: API Production
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/app-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,63 +93,6 @@ jobs:
with:
name: app-gateway
path: application/AppGateway/publish/**/*

code-style-and-linting:
name: Code Style and Linting
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04

steps:
- name: Checkout Code
uses: actions/checkout@v6

- name: Setup Node.js Environment
uses: actions/setup-node@v6
with:
node-version: 24

- name: Install Node Modules
working-directory: application
run: npm ci

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: application/global.json

- name: Restore .NET Tools
working-directory: application
run: dotnet tool restore

- name: Restore .NET Dependencies
working-directory: application
run: dotnet restore

- name: Build Backend Solution
working-directory: application
run: dotnet build PlatformPlatform.slnx --no-restore

- name: Run Code Linting
working-directory: developer-cli
run: |
dotnet run lint --backend | tee lint-output.log

if ! grep -q "No backend issues found!" lint-output.log; then
echo "Code linting issues found."
exit 1
fi

- name: Check for Code Formatting Issues
working-directory: developer-cli
run: |
dotnet run format --backend

# Check for any changes made by the code formatter
git diff --exit-code || {
echo "Formatting issues detected. Please run 'dotnet run format --backend' from /developer-cli folder locally and commit the formatted code."
exit 1
}

api-stage:
name: Staging
if: ${{ needs.build-and-test.outputs.deploy_staging == 'true' }}
Expand Down
Loading
Loading