From ea2e6e1993d11d47949af690fb2d73f305aa7f23 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Thu, 1 Oct 2026 14:27:27 +0200 Subject: [PATCH 01/14] ci: run cognitive complexity audit from very_good_workflows#520 --- .github/workflows/very_good_cli.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index 38b7b95e3..a4aab27fc 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -27,7 +27,10 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1.21.1 + permissions: + contents: read + pull-requests: write + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@vgv-ai-bot/issue-519 with: runs_on: ${{ matrix.os }} flutter_version: "3.47.x" @@ -38,6 +41,7 @@ jobs: # The CLI's own test suite is run directly rather than through the test optimizer, # matching the CI behavior prior to adopting this shared workflow. test_optimization: false + run_cognitive_complexity: true pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1.21.1 From 48c2ff59d01052151ea32e0b74268506ca05e91b Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Thu, 1 Oct 2026 14:27:27 +0200 Subject: [PATCH 02/14] ci: temporarily force a full cognitive complexity scan --- .github/workflows/very_good_cli.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index a4aab27fc..c5a6dab2b 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -42,6 +42,9 @@ jobs: # matching the CI behavior prior to adopting this shared workflow. test_optimization: false run_cognitive_complexity: true + # TEMP: diffing against the root commit simulates the push-to-main full + # scan on a pull request. Revert before review. + cognitive_complexity_diff_base: aed35ed622031513fc2b7f046b081a647ef34f21 pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1.21.1 From 0898089dd0aeb47494553a38ffe0df9363776f87 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Thu, 1 Oct 2026 14:39:16 +0200 Subject: [PATCH 03/14] ci: run the build matrix without fail-fast --- .github/workflows/very_good_cli.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index c5a6dab2b..7ae41c2e8 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -25,6 +25,7 @@ on: jobs: build: strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] permissions: From 093b05a7663218b5f01eb48f9d1978d2baf5f410 Mon Sep 17 00:00:00 2001 From: "unicoderbot[bot]" <269805761+unicoderbot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:19:22 +0000 Subject: [PATCH 04/14] fix: address review feedback on PR #1755 Co-authored-by: marcossevilla --- .github/workflows/very_good_cli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index 7ae41c2e8..b6b9c2327 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -31,7 +31,7 @@ jobs: permissions: contents: read pull-requests: write - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@vgv-ai-bot/issue-519 + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v2 with: runs_on: ${{ matrix.os }} flutter_version: "3.47.x" From 41bfe5aac7ca39cec4f5172c436c365e43b01d2a Mon Sep 17 00:00:00 2001 From: "unicoderbot[bot]" <269805761+unicoderbot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:07:42 +0000 Subject: [PATCH 05/14] fix: address review feedback on PR #1755 Co-authored-by: marcossevilla --- .github/workflows/very_good_cli.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index b6b9c2327..39b0d5a21 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -43,9 +43,6 @@ jobs: # matching the CI behavior prior to adopting this shared workflow. test_optimization: false run_cognitive_complexity: true - # TEMP: diffing against the root commit simulates the push-to-main full - # scan on a pull request. Revert before review. - cognitive_complexity_diff_base: aed35ed622031513fc2b7f046b081a647ef34f21 pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1.21.1 From e5c13d3731e282c0c86eeb51c377640aa39f9848 Mon Sep 17 00:00:00 2001 From: "unicoderbot[bot]" <269805761+unicoderbot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:51:01 +0000 Subject: [PATCH 06/14] fix: address review feedback on PR #1755 Co-authored-by: marcossevilla --- .github/workflows/very_good_cli.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index 39b0d5a21..ffb0c44d1 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -43,6 +43,12 @@ jobs: # matching the CI behavior prior to adopting this shared workflow. test_optimization: false run_cognitive_complexity: true + # TEMP: `flutter_package.yml@v2` checks the repo out with the default + # shallow depth, so `kevmoo/analytica.dart` cannot resolve a merge base + # against `origin/main` and the step exits 1. Pinning the diff base to + # HEAD skips the merge-base lookup; remove this once the shared workflow + # checks out with `fetch-depth: 0`. + cognitive_complexity_diff_base: HEAD pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1.21.1 From d532b06cb0bb53dfdafb336e11148fde626c26ea Mon Sep 17 00:00:00 2001 From: Marcos Sevilla <31174242+marcossevilla@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:01:36 +0200 Subject: [PATCH 07/14] chore: apply suggestion --- .github/workflows/very_good_cli.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index ffb0c44d1..c6d2cd93a 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -43,11 +43,6 @@ jobs: # matching the CI behavior prior to adopting this shared workflow. test_optimization: false run_cognitive_complexity: true - # TEMP: `flutter_package.yml@v2` checks the repo out with the default - # shallow depth, so `kevmoo/analytica.dart` cannot resolve a merge base - # against `origin/main` and the step exits 1. Pinning the diff base to - # HEAD skips the merge-base lookup; remove this once the shared workflow - # checks out with `fetch-depth: 0`. cognitive_complexity_diff_base: HEAD pana: From 7938979e86e664ee3af9efad864ce64521e9349a Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Fri, 16 Oct 2026 17:09:19 +0200 Subject: [PATCH 08/14] ci: migrate remaining workflows to very_good_workflows@v2 Pin every reusable workflow to @v2, drop run_bloc_lint (false is the v2 default), and remove the HEAD diff base, which diffed the checkout against itself and made the complexity scan a no-op. The scan now runs only on the ubuntu matrix leg so both jobs do not race on the sticky PR comment. --- .github/workflows/ci.yaml | 2 +- .github/workflows/very_good_cli.yaml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 99e90d200..6291ad38d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ on: jobs: build: - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1.21.1 + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v2 spell-check: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v2 diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index c6d2cd93a..97c5dd9b0 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -38,14 +38,13 @@ jobs: coverage_excludes: "**/*.{gen,g}.dart" concurrency: 1 run_skipped: true - run_bloc_lint: false # The CLI's own test suite is run directly rather than through the test optimizer, # matching the CI behavior prior to adopting this shared workflow. test_optimization: false - run_cognitive_complexity: true - cognitive_complexity_diff_base: HEAD + # Run once per workflow so the matrix jobs do not race on the sticky PR comment. + run_cognitive_complexity: ${{ matrix.os == 'ubuntu-latest' }} pana: - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1.21.1 + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v2 with: pana_version: 0.22.22 From 45cf55a1c8b39af6b53b263b2d94cde63ba90a8d Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Fri, 16 Oct 2026 17:11:19 +0200 Subject: [PATCH 09/14] ci: fail on cognitive complexity increases Block pull requests that make an existing function more complex relative to the base branch, in addition to the absolute threshold. --- .github/workflows/very_good_cli.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index 97c5dd9b0..c536fe3fb 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -43,6 +43,7 @@ jobs: test_optimization: false # Run once per workflow so the matrix jobs do not race on the sticky PR comment. run_cognitive_complexity: ${{ matrix.os == 'ubuntu-latest' }} + cognitive_complexity_fail_on_increase: true pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v2 From 48770024609d3f49269cf188ef6f0336903d3b88 Mon Sep 17 00:00:00 2001 From: "unicoderbot[bot]" <269805761+unicoderbot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 09:58:45 +0000 Subject: [PATCH 10/14] fix: address review feedback on PR #1755 Co-authored-by: marcossevilla --- .github/workflows/very_good_cli.yaml | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index c536fe3fb..dadf77672 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -28,9 +28,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - permissions: - contents: read - pull-requests: write uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v2 with: runs_on: ${{ matrix.os }} @@ -41,9 +38,30 @@ jobs: # The CLI's own test suite is run directly rather than through the test optimizer, # matching the CI behavior prior to adopting this shared workflow. test_optimization: false - # Run once per workflow so the matrix jobs do not race on the sticky PR comment. - run_cognitive_complexity: ${{ matrix.os == 'ubuntu-latest' }} - cognitive_complexity_fail_on_increase: true + + cognitive_complexity: + # Runs the audit from a dedicated job so the checkout can request full + # history: `flutter_package.yml@v2` checks the repo out at the default + # shallow depth, which prevents `kevmoo/analytica.dart` from resolving a + # merge base against `origin/main` and makes the step exit 1. + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: 📚 Git Checkout + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: 🎯 Setup Dart + uses: dart-lang/setup-dart@v1.8.1 + + - name: 🧠 Cognitive Complexity + uses: kevmoo/analytica.dart/packages/cognitive_complexity@main + with: + fail-threshold: "15" + fail-on-increase: "true" pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v2 From c7202d84e52714a802abef8d0df20e042511a291 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 19 Oct 2026 13:08:44 +0200 Subject: [PATCH 11/14] ci: run cognitive complexity through very_good_workflows very_good_workflows v2.0.2 checks out full history when run_cognitive_complexity is enabled (VeryGoodOpenSource/very_good_workflows#532), so the dedicated job with its own fetch-depth: 0 checkout is no longer needed. --- .github/workflows/very_good_cli.yaml | 30 ++++++---------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index dadf77672..c536fe3fb 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -28,6 +28,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] + permissions: + contents: read + pull-requests: write uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v2 with: runs_on: ${{ matrix.os }} @@ -38,30 +41,9 @@ jobs: # The CLI's own test suite is run directly rather than through the test optimizer, # matching the CI behavior prior to adopting this shared workflow. test_optimization: false - - cognitive_complexity: - # Runs the audit from a dedicated job so the checkout can request full - # history: `flutter_package.yml@v2` checks the repo out at the default - # shallow depth, which prevents `kevmoo/analytica.dart` from resolving a - # merge base against `origin/main` and makes the step exit 1. - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: 📚 Git Checkout - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - - name: 🎯 Setup Dart - uses: dart-lang/setup-dart@v1.8.1 - - - name: 🧠 Cognitive Complexity - uses: kevmoo/analytica.dart/packages/cognitive_complexity@main - with: - fail-threshold: "15" - fail-on-increase: "true" + # Run once per workflow so the matrix jobs do not race on the sticky PR comment. + run_cognitive_complexity: ${{ matrix.os == 'ubuntu-latest' }} + cognitive_complexity_fail_on_increase: true pana: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v2 From 1b90c3573029edbf3e2fec579ac071f03aec8d24 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 19 Oct 2026 13:21:32 +0200 Subject: [PATCH 12/14] ci: temporarily validate very_good_workflows#535 Points the build at the PR branch to confirm the fetch-depth fix lets the cognitive complexity step resolve a merge base. Revert to @v2 once the fix is released. --- .github/workflows/very_good_cli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index c536fe3fb..d4779a978 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -31,7 +31,7 @@ jobs: permissions: contents: read pull-requests: write - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v2 + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@fix/cognitive-complexity-fetch-depth with: runs_on: ${{ matrix.os }} flutter_version: "3.47.x" From b0b796c7d846a78de873d8b3edf845d0de42a402 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 19 Oct 2026 15:38:27 +0200 Subject: [PATCH 13/14] ci: re-validate very_good_workflows#535 From a820e54c181b5df2019f81202c08ab1dc81517f1 Mon Sep 17 00:00:00 2001 From: Marcos Sevilla Date: Mon, 19 Oct 2026 15:51:22 +0200 Subject: [PATCH 14/14] ci: use very_good_workflows@v2 for cognitive complexity v2.0.3 includes the fetch-depth fix (VeryGoodOpenSource/very_good_workflows#535), so the temporary pin to the PR branch is no longer needed. --- .github/workflows/very_good_cli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/very_good_cli.yaml b/.github/workflows/very_good_cli.yaml index d4779a978..c536fe3fb 100644 --- a/.github/workflows/very_good_cli.yaml +++ b/.github/workflows/very_good_cli.yaml @@ -31,7 +31,7 @@ jobs: permissions: contents: read pull-requests: write - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@fix/cognitive-complexity-fetch-depth + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v2 with: runs_on: ${{ matrix.os }} flutter_version: "3.47.x"