Skip to content
Merged
Show file tree
Hide file tree
Changes from 130 commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
4d2a231
implementação inicial users module
Aug 19, 2025
254ba13
adiciona eventos para o modulo Users
Sep 4, 2025
a81930b
completa domain e application, algumas melhorias no Shared
Sep 10, 2025
85f277e
finaliza users module
Sep 12, 2025
4b19dec
finaliza a infra do keycloak
Sep 12, 2025
5c746da
implementa docs, arquivos de infra, modulo users API e Application re…
Sep 19, 2025
1858230
finaliza revisão do módulo Users
Sep 23, 2025
9e64a3c
todo projeto em srv revisado
Sep 23, 2025
ea1b678
pequena correçao
Sep 23, 2025
18ed970
projetos de testes revisados
Sep 23, 2025
4207033
integration tests revisados e passando
Sep 25, 2025
08a80b9
corrigindo ultimos testes não passando
Sep 25, 2025
2439c24
migra para uuidv7
Sep 25, 2025
0fe9e55
implementando module users public api
Sep 25, 2025
bfadc69
melhora a documentacao e as collections
Sep 25, 2025
c2c5c7b
melhorias documentacao
Sep 25, 2025
3d71a35
docs: remove stray commit messages from development guidelines
Sep 25, 2025
0613c9a
coderabbit review parte 01
Sep 25, 2025
a529251
correçoes do review
Sep 26, 2025
e4c2900
mais uma revisao de código
Sep 26, 2025
775042a
correcao de namespaces
Sep 26, 2025
973fb18
Update src/Bootstrapper/MeAjudaAi.ApiService/Middlewares/RateLimiting…
frigini Sep 29, 2025
0140375
revisão de documentos e scripts
Sep 29, 2025
7c9733e
mais revisao de documentos s scripts
Sep 29, 2025
a30f864
mais um review
Sep 29, 2025
e6793d4
feat: Add markdown link checker to CI/CD pipeline
Sep 29, 2025
f796d30
fix: Update branch references from 'main' to 'master' in README and w…
Sep 29, 2025
1b49c61
fix: Improve test script robustness with CONFIG default and E2E Docke…
Sep 29, 2025
2faaf0e
docs: Fix Testing environment MessageBus strategy consistency
Sep 29, 2025
92dc0f5
docs: Fix TestAuthenticationHandler constructor with required framewo…
Sep 29, 2025
7cdee27
fix: Use local variable in dotnet-install.sh error message
Sep 29, 2025
77284e8
security: Harden backup file validation in optimize.sh restore function
Sep 29, 2025
c3d5771
fix: Improve Docker context handling and test failure detection in op…
Sep 29, 2025
66810e9
fix: Improve error handling and namespace validation in test.sh
Sep 29, 2025
8e16148
fix: Add proper quoting to prevent word-splitting in dotnet-install.sh
Sep 29, 2025
b5a2b28
pequenos revies
Sep 29, 2025
6020671
fix para as pipelines
Sep 29, 2025
f807c96
code rabbit review
Sep 29, 2025
02eaabf
atualiza lychee
Sep 29, 2025
1030a95
minor fixes
Sep 30, 2025
7a000be
outros fixes
Sep 30, 2025
58cd3c8
security: remove appsettings.Development.json from gitleaks allowlist
Sep 30, 2025
e441f35
docs: fix Development messaging configuration contradiction
Sep 30, 2025
b983be1
security: fix Keycloak script credential encoding and permissions
Sep 30, 2025
313f73c
fix: remove unsupported -m:0 MSBuild flag from test script
Sep 30, 2025
ad002e3
fix serialization
Sep 30, 2025
46fb21f
security: enforce secret detection failures in PR validation
Sep 30, 2025
af56b20
security: fix gitleaks config for v8.28.0 and tighten allowlist
Sep 30, 2025
ed27dec
fix: add conditional execution for Gitleaks based on license availabi…
Sep 30, 2025
61c9824
docs: fix inconsistent security scanner behavior descriptions
Sep 30, 2025
e1a567d
fix: resolve actionlint warning for secrets in step conditional
Sep 30, 2025
ce0d546
🔧 Fix C# code formatting and YAML structure issues
Oct 1, 2025
2ba1f71
✨ Enhance CI/CD pipeline with improved permissions and configuration
Oct 1, 2025
6c34c3c
fix some formatting
Oct 1, 2025
c04cd0e
mais correcoes coderabbit
Oct 1, 2025
a29e11d
nitpicks
Oct 1, 2025
830f47f
fix production .yml
Oct 1, 2025
e611ef0
try to fix lychee
Oct 1, 2025
250212c
reivsao de docs e ymls
Oct 1, 2025
cb17c2b
yaml fixes
Oct 1, 2025
cc96889
fix yaml de validacao
Oct 1, 2025
4bdbe97
fix em diversos yml
Oct 1, 2025
5e03a5f
seguem mais fix
Oct 1, 2025
16ae5a8
fixes
Oct 1, 2025
12d4556
fix pipelines
Oct 2, 2025
2fc8a97
fix comments
Oct 2, 2025
0a3c43f
keep fixing
Oct 2, 2025
3dc687a
try to fix again
Oct 2, 2025
42dcfda
feat: improve code coverage collection and eliminate duplicates
Oct 2, 2025
13b4780
fix: allow Aspire manifest generation without database password
Oct 2, 2025
11f2cfb
style: fix whitespace formatting issues
Oct 2, 2025
dde2422
fix: clean up local coverage files and improve gitignore
Oct 2, 2025
005eaa3
fix: simplify coverage collection to prevent duplicates
Oct 2, 2025
346abd5
fix: standardize directory naming to MeAjudaAi convention
Oct 2, 2025
aee32ae
reorganiza algumas pastas inconsistentes
Oct 2, 2025
f70e8b2
fix code coverage
Oct 2, 2025
eea00b0
ajustes code coverage
Oct 2, 2025
5b6e8df
tentativa de correcao pr validation
Oct 2, 2025
c21b373
mais fixes
Oct 2, 2025
0be0c73
Fix CI/CD workflow issues and infrastructure setup
Oct 2, 2025
2c7718f
pr validation
Oct 2, 2025
0d000d5
Fix critical workflow and infrastructure issues
Oct 2, 2025
698f514
Fix OSV Scanner severity detection and infrastructure issues
Oct 2, 2025
c8967aa
Fix bash syntax error in PostgreSQL wait loop
Oct 2, 2025
5e0a9cb
Replace non-existent OSV Scanner action with direct binary
Oct 2, 2025
c29985c
Remove trailing whitespace from YAML workflow
Oct 2, 2025
8548b5b
Force workflow re-execution with corrected bash syntax
Oct 2, 2025
6badff0
Replace PostgreSQL wait loop with while syntax for better compatibility
Oct 2, 2025
0badca7
Fix critical workflow and infrastructure configuration issues
Oct 2, 2025
e66c481
Remove trailing whitespace from PostgreSQL readiness step
Oct 2, 2025
d0d17f4
Fix bash syntax error in secrets validation
Oct 2, 2025
827dcbf
Fix quote escaping issues in secrets validation
Oct 2, 2025
05304af
Fix quote escaping in Database and Keycloak configuration checks
Oct 2, 2025
a3adc2d
Fix PostgreSQL wait step and remaining secret interpolations
Oct 2, 2025
96dbf1a
Improve PostgreSQL service configuration and wait logic
Oct 2, 2025
97c8933
Fix PostgreSQL environment variable names in test step
Oct 2, 2025
e155356
Add workflow_dispatch trigger for manual testing
Oct 2, 2025
b456979
Update README with workflow fixes timestamp
Oct 2, 2025
8f4c8d7
Fix bash syntax in aspire-ci-cd.yml workflow
Oct 2, 2025
ae0e562
Add comprehensive workflow fixes documentation
Oct 2, 2025
d6069d8
Fix code coverage collection and file handling
Oct 2, 2025
449d4cd
Remove trailing whitespace from workflow YAML
Oct 3, 2025
c28049d
Remove all trailing whitespace from workflow YAML
Oct 3, 2025
15ade90
Fix coverage fallback step condition logic
Oct 3, 2025
924d613
Fix test failures and reduce excessive logging
Oct 3, 2025
f21772d
Fix TruffleHog step for workflow_dispatch compatibility
Oct 3, 2025
c308731
fix documents not referenced
Oct 3, 2025
328080a
feat: melhorar visualização de code coverage
Oct 3, 2025
fce6161
fix: remove trailing spaces from YAML workflow
Oct 3, 2025
013df70
feat: optimize workflow and fix documentation links
Oct 3, 2025
1d9c91c
fix: correct Code Coverage Summary workflow behavior
Oct 3, 2025
268c8b4
ix: resolve undefined jq variables in OSV-Scanner step
Oct 3, 2025
8e23eb9
feat: improve workflow robustness and fallback handling
Oct 3, 2025
d199bd5
fix: correct OSV-Scanner command syntax
Oct 3, 2025
48a6d79
fix: improve coverage validation and prevent duplicate PR comments
Oct 3, 2025
b876f91
fix: resolve yamllint violations in workflow
Oct 3, 2025
4b22c2c
fix: properly enforce coverage thresholds in workflow
Oct 3, 2025
eb2af00
Update .github/workflows/pr-validation.yml
frigini Oct 3, 2025
6b05359
Update .github/workflows/pr-validation.yml
frigini Oct 3, 2025
ab32eab
aumenta cobertura de testes
Oct 7, 2025
8b261b5
Merge branch 'users-module-implementation' of https://github.com/frig…
Oct 7, 2025
c3359cf
algumas correcoes
Oct 7, 2025
ef857c6
tenta resolver pipe
Oct 7, 2025
7ecf294
trailing spaces fix
Oct 7, 2025
9af4bcc
fix failing test
Oct 7, 2025
c69d664
Update .github/workflows/pr-validation.yml
frigini Oct 7, 2025
d2f443e
fix osv
Oct 7, 2025
70358f5
enhance debug
Oct 7, 2025
a2d78d1
feat: Add enhanced diagnostics to Keycloak authentication tests
Oct 7, 2025
c21af97
fix: Improve coverage file detection and support multiple formats
Oct 7, 2025
9ff9148
fix: Resolve YAML linting issues in PR validation workflow
Oct 7, 2025
cdbb61b
fix: Resolve final YAML linting issues and improve coverage handling
Oct 7, 2025
5a30ea4
fix: Add missing ID to Select Coverage Outputs step
Oct 7, 2025
9c8a697
fix: Correct JWT token generation using Base64URL encoding
Oct 7, 2025
861985d
fix: Enhance coverage analysis with direct file parsing fallback
Oct 7, 2025
57b612c
fix: Resolve YAML linting, code formatting, and coverage threshold is…
Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
283 changes: 181 additions & 102 deletions .github/workflows/aspire-ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
---
name: MeAjudaAi CI Pipeline

on:
"on":
push:
branches: [ main, develop ]
branches: [master, develop]
paths:
- 'src/Aspire/**'
- '.github/workflows/aspire-ci-cd.yml'
pull_request:
branches: [ main, develop ]
branches: [master, develop]
paths:
- 'src/Aspire/**'
- '.github/workflows/aspire-ci-cd.yml'

permissions:
contents: read
checks: write

env:
DOTNET_VERSION: '9.0.x'
Expand All @@ -13,96 +24,165 @@ jobs:
# Build and test the solution
build-and-test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD || 'test123' }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER || 'postgres' }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB || 'meajudaai_test' }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Aspire workload
run: dotnet workload install aspire

- name: Restore dependencies
run: dotnet restore MeAjudaAi.sln

- name: Build solution
run: dotnet build MeAjudaAi.sln --no-restore --configuration Release

- name: Run unit tests
run: dotnet test tests/MeAjudaAi.Tests/MeAjudaAi.Tests.csproj --no-build --configuration Release --logger trx --results-directory TestResults

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: TestResults
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Aspire workload
run: dotnet workload install aspire

- name: Restore dependencies
run: dotnet restore MeAjudaAi.sln

- name: Build solution
run: dotnet build MeAjudaAi.sln --no-restore --configuration Release

- name: Install PostgreSQL client
run: |
# Install PostgreSQL client tools for health checks
sudo apt-get update
sudo apt-get install -y postgresql-client

- name: Wait for PostgreSQL to be ready
env:
PGPASSWORD: ${{ secrets.POSTGRES_PASSWORD || 'test123' }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER || 'postgres' }}
run: |
echo "🔄 Waiting for PostgreSQL to be ready..."
echo "Debug: POSTGRES_USER=$POSTGRES_USER"
echo "Debug: Checking PostgreSQL availability..."

counter=1
max_attempts=30

while [ $counter -le $max_attempts ]; do
if pg_isready -h localhost -p 5432 -U "$POSTGRES_USER"; then
echo "✅ PostgreSQL is ready!"
break
fi
echo "Waiting for PostgreSQL... ($counter/$max_attempts)"
sleep 2
counter=$((counter + 1))
done

# Check if we exited the loop due to timeout
if ! pg_isready -h localhost -p 5432 -U "$POSTGRES_USER"; then
echo "❌ PostgreSQL failed to become ready within 60 seconds"
exit 1
fi

- name: Run tests
env:
ASPNETCORE_ENVIRONMENT: Testing
# Database configuration for tests that need it
MEAJUDAAI_DB_PASS: ${{ secrets.POSTGRES_PASSWORD || 'test123' }}
MEAJUDAAI_DB_USER: ${{ secrets.POSTGRES_USER || 'postgres' }}
MEAJUDAAI_DB: ${{ secrets.POSTGRES_DB || 'meajudaai_test' }}
DB_PASSWORD: ${{ secrets.POSTGRES_PASSWORD || 'test123' }}
DB_USERNAME: ${{ secrets.POSTGRES_USER || 'postgres' }}
run: |
echo "🧪 Running core test suite (excluding E2E)..."
# Run only Architecture and Integration tests - skip E2E tests for Aspire validation
dotnet test tests/MeAjudaAi.Architecture.Tests/ --no-build --configuration Release
dotnet test tests/MeAjudaAi.Integration.Tests/ --no-build --configuration Release
dotnet test src/Modules/Users/MeAjudaAi.Modules.Users.Tests/ --no-build --configuration Release
echo "✅ Core tests passed successfully"

# Validate Aspire configuration
aspire-validation:
runs-on: ubuntu-latest
needs: build-and-test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Aspire workload
run: dotnet workload install aspire

- name: Restore dependencies
run: dotnet restore MeAjudaAi.sln

- name: Validate Aspire AppHost
run: |
cd src/Aspire/MeAjudaAi.AppHost
dotnet build --configuration Release
echo "✅ Aspire AppHost builds successfully"

- name: Generate Aspire manifest (for future deployment)
run: |
cd src/Aspire/MeAjudaAi.AppHost
# This validates the Aspire configuration without deploying
dotnet run --project . --publisher manifest --output-path ./aspire-manifest.json --dry-run || echo "Manifest generation ready for future deployment"
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Aspire workload
run: dotnet workload install aspire

- name: Restore dependencies
run: dotnet restore MeAjudaAi.sln

- name: Validate Aspire AppHost
run: |
cd src/Aspire/MeAjudaAi.AppHost
dotnet build --configuration Release
echo "✅ Aspire AppHost builds successfully"

- name: Generate Aspire manifest (for future deployment)
env:
# Set fallback values for manifest generation (dry-run mode)
DB_PASSWORD: 'manifest-generation'
MEAJUDAAI_DB_PASS: 'manifest-generation'
KEYCLOAK_ADMIN_PASSWORD: 'manifest-generation'
ASPNETCORE_ENVIRONMENT: Testing
run: |
cd src/Aspire/MeAjudaAi.AppHost
# This validates the Aspire configuration without deploying
dotnet run --project . --publisher manifest \
--output-path ./aspire-manifest.json --dry-run
echo "✅ Aspire manifest generated successfully"

# Code quality and security analysis
code-analysis:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dotnet format
run: dotnet tool install -g dotnet-format

- name: Check code formatting
run: |
dotnet format --verify-no-changes --verbosity normal MeAjudaAi.sln || echo "⚠️ Code formatting issues found. Run 'dotnet format' locally to fix."

- name: Run security analysis
uses: github/super-linter@v4
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_CSHARP: true
VALIDATE_DOCKERFILE: true
VALIDATE_JSON: true
VALIDATE_YAML: true
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dotnet format
run: dotnet tool install -g dotnet-format

- name: Check code formatting
run: |
dotnet format --verify-no-changes --verbosity normal \
MeAjudaAi.sln || {
echo "⚠️ Code formatting issues found."
echo "Run 'dotnet format' locally to fix."
exit 1
}

- name: Run vulnerability scan
run: |
echo "🔍 Scanning for vulnerable packages..."
dotnet list package --vulnerable --include-transitive
echo "✅ Vulnerability scan completed"

- name: Basic code quality checks
run: |
echo "🔍 Running focused code quality checks..."
# Check for basic C# issues (quiet mode)
echo "Checking C# syntax..."
dotnet build MeAjudaAi.sln --verbosity quiet --no-restore
echo "✅ Code quality checks passed"

# Build validation for individual services (without publishing)
service-build-validation:
Expand All @@ -114,25 +194,24 @@ jobs:
- name: "ApiService"
path: "src/Bootstrapper/MeAjudaAi.ApiService"
- name: "Users.API"
path: "src/Modules/Users/API/MeajudaAi.Modules.Users.API"

path: "src/Modules/Users/MeAjudaAi.Modules.Users.API"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Validate ${{ matrix.service.name }} builds for containerization
run: |
cd ${{ matrix.service.path }}
# Test that the service can be published (simulates container build)
dotnet publish -c Release -o ./publish-output

echo "✅ ${{ matrix.service.name }} builds successfully for containerization"

# Cleanup
rm -rf ./publish-output
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore MeAjudaAi.sln

- name: Validate ${{ matrix.service.name }} builds for containerization
run: |
cd ${{ matrix.service.path }}
# Test that the service can be published (simulates container build)
dotnet publish -c Release -o ./publish-output
echo "✅ ${{ matrix.service.name }} builds successfully for containers"
# Cleanup
rm -rf ./publish-output
Loading
Loading