From 496040963e992e4590706011af93633191ef81d3 Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Tue, 10 Nov 2026 09:26:48 -0800 Subject: [PATCH 1/3] fix(ci): run PR checks on stacked PRs - Run tests and code quality on PRs into any base, not only main - Evaluate the Development merge check on stacked PRs - Refresh red merge checks on every open PR after a Development push --- .github/workflows/code-quality.yml | 1 - .github/workflows/development-merge-check.yml | 4 ++-- .github/workflows/tests.yml | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 0a8cbcb4f..7d78d35e0 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -2,7 +2,6 @@ name: Code Quality on: pull_request: - branches: [main] # Detects whether a PR *adds* new dead code or duplication compared to main. # - fallow covers VueApp (dead code, unused exports, complexity, duplication) diff --git a/.github/workflows/development-merge-check.yml b/.github/workflows/development-merge-check.yml index 7a66c9f69..5ef4f4156 100644 --- a/.github/workflows/development-merge-check.yml +++ b/.github/workflows/development-merge-check.yml @@ -22,7 +22,7 @@ name: Development Merge Check on: pull_request: types: [opened, reopened, synchronize, ready_for_review] - branches: [main] + branches-ignore: [Development] push: branches: [Development] workflow_dispatch: @@ -95,7 +95,7 @@ jobs: // in Development without a new PR commit. Re-run each still-red PR's // check so its verdict refreshes against the updated Development. const prs = await github.paginate(github.rest.pulls.list, { - owner, repo, state: 'open', base: 'main', per_page: 100, + owner, repo, state: 'open', per_page: 100, }); const runs = await github.paginate(github.rest.actions.listWorkflowRuns, { owner, repo, workflow_id: WORKFLOW, event: 'pull_request', per_page: 100, diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f68980f40..c48d18840 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,6 @@ on: push: branches: [main] pull_request: - branches: [main] jobs: frontend: From 19bce1c7c7374484b91affb343c43b1ff4124aac Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Tue, 10 Nov 2026 09:41:19 -0800 Subject: [PATCH 2/3] feat(ci): skip C# and Vue checks a PR does not touch - Tests, code quality, and CodeQL run per stack (C# or Vue) only when the PR changes that stack or shared tooling - Pushes and scheduled runs still check everything --- .github/actions/changed-stacks/action.yml | 53 +++++++++++++++++++++++ .github/workflows/code-quality.yml | 26 +++++++++++ .github/workflows/codeql.yml | 26 +++++++++++ .github/workflows/tests.yml | 22 ++++++++++ 4 files changed, 127 insertions(+) create mode 100644 .github/actions/changed-stacks/action.yml diff --git a/.github/actions/changed-stacks/action.yml b/.github/actions/changed-stacks/action.yml new file mode 100644 index 000000000..88809ac22 --- /dev/null +++ b/.github/actions/changed-stacks/action.yml @@ -0,0 +1,53 @@ +name: Changed stacks +description: > + Report whether a pull request touches the C# or Vue stack, so workflows can + skip jobs for the stack it leaves alone. Non-PR events report both as changed. + Needs a checkout with fetch-depth 0. + +inputs: + own-paths: + description: The calling workflow's own files or folders, space-separated; a change to any runs both stacks. + required: true + +outputs: + csharp: + description: "'true' when C# code or its build/tooling changed" + value: ${{ steps.filter.outputs.csharp }} + vue: + description: "'true' when Vue code or its build/tooling changed" + value: ${{ steps.filter.outputs.vue }} + +runs: + using: composite + steps: + - id: filter + shell: bash + env: + BASE_REF: ${{ github.base_ref }} + OWN_PATHS: ${{ inputs.own-paths }} + run: | + if [ -z "$BASE_REF" ]; then + echo "csharp=true" >> "$GITHUB_OUTPUT" + echo "vue=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + + files=$(git -c core.quotePath=false diff --no-renames --name-only "origin/$BASE_REF...HEAD") + echo "Changed files:" + echo "$files" + + # Shared tooling runs both stacks; other workflow files run neither + shared="^(package(-lock)?\.json$|scripts/|\.editorconfig$|\.jscpd\.json$|\.npmrc$|\.github/actions/changed-stacks/)" + dot='\.' + for p in $OWN_PATHS; do shared="$shared|^${p//./$dot}"; done + csharp="$shared|^(web/|test/|Viper\.sln|Directory\.Build\.props$|global\.json$|\.globalconfig$|\.config/)" + vue="$shared|^(VueApp/|eslint\.config\.mjs$|\.oxlintrc\.json$|stylelint\.config\.mjs$|\.env)" + + for stack in csharp vue; do + if grep -qE "${!stack}" <<< "$files"; then + echo "$stack=true" >> "$GITHUB_OUTPUT" + else + echo "$stack=false" >> "$GITHUB_OUTPUT" + fi + done + cat "$GITHUB_OUTPUT" diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 7d78d35e0..5a0d0328e 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -12,8 +12,28 @@ on: # Passes if counts are equal to or lower than main. jobs: + changes: + name: Detect changed stacks + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + csharp: ${{ steps.stacks.outputs.csharp }} + vue: ${{ steps.stacks.outputs.vue }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - id: stacks + uses: ./.github/actions/changed-stacks + with: + own-paths: .github/workflows/code-quality.yml + fallow-regression: name: Fallow regression (VueApp) + needs: changes + if: needs.changes.outputs.vue == 'true' runs-on: ubuntu-latest steps: - name: Checkout PR head @@ -63,6 +83,8 @@ jobs: jscpd-regression-csharp: name: JSCPD regression (C#/Razor) + needs: changes + if: needs.changes.outputs.csharp == 'true' runs-on: ubuntu-latest steps: - name: Checkout PR head @@ -99,6 +121,8 @@ jobs: jscpd-regression-vue: name: JSCPD regression (Vue/TS) + needs: changes + if: needs.changes.outputs.vue == 'true' runs-on: ubuntu-latest steps: - name: Checkout PR head @@ -132,6 +156,8 @@ jobs: resharper-pr-gate: name: ReSharper PR-scoped gate (C#) + needs: changes + if: needs.changes.outputs.csharp == 'true' runs-on: ubuntu-latest steps: - name: Checkout PR head diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8874897f9..15120f790 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,9 +21,31 @@ on: - cron: '32 18 * * 6' jobs: + changes: + name: Detect changed stacks + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + csharp: ${{ steps.stacks.outputs.csharp }} + vue: ${{ steps.stacks.outputs.vue }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - id: stacks + uses: ./.github/actions/changed-stacks + with: + own-paths: .github/workflows/codeql.yml .github/codeql/ + analyze: name: Analyze + needs: changes runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + # Job-level `if` can't read the matrix; web/ holds plain JS, so a C# change runs both + env: + RUN_ANALYSIS: ${{ needs.changes.outputs.csharp == 'true' || (matrix.language == 'javascript' && needs.changes.outputs.vue == 'true') }} permissions: actions: read contents: read @@ -40,10 +62,12 @@ jobs: steps: - name: Checkout repository + if: env.RUN_ANALYSIS == 'true' uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL + if: env.RUN_ANALYSIS == 'true' uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 with: languages: ${{ matrix.language }} @@ -52,6 +76,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild + if: env.RUN_ANALYSIS == 'true' uses: github/codeql-action/autobuild@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 # ℹ️ Command-line programs to run using the OS shell. @@ -65,6 +90,7 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis + if: env.RUN_ANALYSIS == 'true' uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c48d18840..1e70e3de5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,8 +6,28 @@ on: pull_request: jobs: + changes: + name: Detect changed stacks + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + csharp: ${{ steps.stacks.outputs.csharp }} + vue: ${{ steps.stacks.outputs.vue }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - id: stacks + uses: ./.github/actions/changed-stacks + with: + own-paths: .github/workflows/tests.yml + frontend: name: Frontend Tests + needs: changes + if: needs.changes.outputs.vue == 'true' runs-on: ubuntu-latest env: HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }} @@ -53,6 +73,8 @@ jobs: backend: name: Backend Tests + needs: changes + if: needs.changes.outputs.csharp == 'true' runs-on: ubuntu-latest env: HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }} From d6a405cc726cb428817b2064df8735fdb91e0b73 Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Tue, 10 Nov 2026 09:42:37 -0800 Subject: [PATCH 3/3] feat(ci): have CodeRabbit review WIP-titled PRs - Branch protection now requires CodeRabbit's check, so a PR it skips for a WIP title could never merge --- .coderabbit.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 4a55f8f22..54386e0ae 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -23,8 +23,6 @@ reviews: - ".*" ignore_usernames: - "dependabot[bot]" - ignore_title_keywords: - - WIP path_filters: - "!**/node_modules/**"