diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 7f43374f6..afc1a1302 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -71,53 +71,11 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Validate Secrets Configuration - env: - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - POSTGRES_USER: ${{ secrets.POSTGRES_USER }} - POSTGRES_DB: ${{ secrets.POSTGRES_DB }} run: | - echo "Validating secrets configuration..." - - # Check if running in main repository (not a fork) for pull_request or workflow_dispatch - if [ "${{ github.repository }}" = "frigini/MeAjudaAi" ] && \ - ([ "${{ github.event_name }}" = "pull_request" ] || \ - [ "${{ github.event_name }}" = "workflow_dispatch" ]); then - echo "Running in main repository context - strict validation enabled" - - # Validate all required database secrets - HAS_ERROR=0 - - if [ -z "$POSTGRES_PASSWORD" ]; then - echo "ERROR: POSTGRES_PASSWORD secret not configured in main repository" - echo "This secret is required for pull request validation" - HAS_ERROR=1 - else - echo "SUCCESS: POSTGRES_PASSWORD secret configured" - fi - - if [ -z "$POSTGRES_USER" ]; then - echo "ERROR: POSTGRES_USER secret not configured in main repository" - echo "This secret is required for pull request validation" - HAS_ERROR=1 - else - echo "SUCCESS: POSTGRES_USER secret configured" - fi - - if [ -z "$POSTGRES_DB" ]; then - echo "ERROR: POSTGRES_DB secret not configured in main repository" - echo "This secret is required for pull request validation" - HAS_ERROR=1 - else - echo "SUCCESS: POSTGRES_DB secret configured" - fi - - if [ $HAS_ERROR -eq 1 ]; then - echo "Secret validation failed - exiting" - exit 1 - fi - else - echo "Running in fork or non-PR/dispatch event - lenient mode (using test defaults)" - fi + echo "Using PostgreSQL credentials with fallback defaults" + echo "POSTGRES_USER: ${{ env.POSTGRES_USER }}" + echo "POSTGRES_DB: ${{ env.POSTGRES_DB }}" + echo "POSTGRES_PASSWORD: [REDACTED]" echo "Database configuration validated" @@ -317,11 +275,14 @@ jobs: INCLUDE_FILTER="[MeAjudaAi.*]*" fi - # NOTE: EXCLUDE_FILTER is currently hardcoded for all modules. - # Future enhancement: Consider adding per-module exclusion patterns - # as part of the MODULES array definition (e.g., "Module:path/:Include:Exclude") - # to support module-specific test category or infrastructure exclusions. - EXCLUDE_FILTER="[*.Tests*]*,[*Test*]*,[testhost]*" + # NOTE: EXCLUDE_FILTER includes compiler-generated code exclusions + # to provide accurate coverage metrics for hand-written code only. + # Excluded patterns: + # - Test assemblies: [*.Tests*]*, [*Test*]*, [testhost]* + # - OpenApi generated: [*Microsoft.AspNetCore.OpenApi.Generated*]* + # - Compiler services: [*System.Runtime.CompilerServices*]* + # - Regex generator: [*System.Text.RegularExpressions.Generated*]* + EXCLUDE_FILTER="[*.Tests*]*,[*Test*]*,[testhost]*,[*Microsoft.AspNetCore.OpenApi.Generated*]*,[*System.Runtime.CompilerServices*]*,[*System.Text.RegularExpressions.Generated*]*" echo " Include: $INCLUDE_FILTER" echo " Exclude: $EXCLUDE_FILTER"