Skip to content

[#2444] Added 'CodeCoverageProvider' installer prompt with Codecov option.#2464

Merged
AlexSkrypnyk merged 3 commits intomainfrom
feature/2444-codecov-select
Apr 20, 2026
Merged

[#2444] Added 'CodeCoverageProvider' installer prompt with Codecov option.#2464
AlexSkrypnyk merged 3 commits intomainfrom
feature/2444-codecov-select

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Apr 20, 2026

Closes #2444

Summary

Adds a CodeCoverageProvider Select handler to the Vortex installer under the "Automations" section, letting users choose between Codecov and None (default). When Codecov is selected, the Codecov upload step is preserved in both .github/workflows/build-test-deploy.yml and .circleci/config.yml; otherwise those blocks are stripped. The Codecov badge in README.md follows the same token. Discovery auto-detects existing Codecov usage in upgraded projects so they are not silently downgraded.

Changes

New handler (.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php):

  • options(): codecov / none, default none
  • discover(): inspects GHA and CircleCI configs for existing Codecov references
  • process(): calls File::removeTokenAsync with or without ! prefix to keep or strip the CODE_COVERAGE_PROVIDER_CODECOV token block

Token wrapping in CI configs:

  • .github/workflows/build-test-deploy.yml - Codecov upload step wrapped in #;< CODE_COVERAGE_PROVIDER_CODECOV / #;> CODE_COVERAGE_PROVIDER_CODECOV
  • .circleci/config.yml - same token wrapping around the codecov -Z -s upload step

Installer registration (.vortex/installer/src/Prompts/PromptManager.php):

  • Handler added to the "Automations" section after DependencyUpdatesProvider
  • Handler ID included in the summary output

Tests:

  • CodeCoverageProviderHandlerProcessTest - process scenarios
  • CodeCoverageProviderHandlerDiscoveryTest - discovery scenarios (GHA, CircleCI, both, neither)
  • New fixture code_coverage_provider_codecov with full GHA + CircleCI snapshots
  • All existing CircleCI-containing fixtures updated to strip the Codecov block (matching the new none default)

README.dist.md: Codecov badge wrapped in the same token so it appears only when Codecov is selected.

Before / After

Installer "Automations" section:

Before                              After
──────────────────────────────      ──────────────────────────────────────
  Automations                         Automations
  ─ Dependency updates provider       ─ Dependency updates provider
  ─ Assign author to PR               ─ Code coverage provider        <NEW>
  ─ Label merge conflicts PR          ─ Assign author to PR
                                      ─ Label merge conflicts PR

Token wrapping in CI configs:

# Before (.github/workflows/build-test-deploy.yml)
      - name: Upload coverage report to Codecov
        uses: codecov/codecov-action@...
        ...

# After
      #;< CODE_COVERAGE_PROVIDER_CODECOV
      - name: Upload coverage report to Codecov
        uses: codecov/codecov-action@...
        ...
      #;> CODE_COVERAGE_PROVIDER_CODECOV

Installer output when none is selected - Codecov block is removed entirely.
Installer output when codecov is selected - Codecov block is preserved as-is.

Summary by CodeRabbit

  • New Features

    • Added an interactive installer prompt to choose a code coverage provider (Codecov or none).
  • Tests

    • Added new unit and functional tests covering the code coverage provider prompt and discovery.
  • Documentation

    • Updated installer documentation (new section on updating installer videos) and adjusted README coverage badge handling.
  • Chores

    • Minor CI/workflow markings to support installer behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2d2d85d2-0e86-4a2c-b8e6-afbc4583c8da

📥 Commits

Reviewing files that changed from the base of the PR and between f804339 and 32d7e2d.

⛔ Files ignored due to path filters (1)
  • .vortex/docs/static/img/installer.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • .circleci/vortex-test-common.yml
  • .vortex/docs/static/img/installer.json
  • .vortex/installer/CLAUDE.md
  • .vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php

Walkthrough

Adds a Code Coverage Provider prompt to the Vortex installer (options: codecov or none) with discovery logic and processing that inserts/removes Vortex boundary markers around existing Codecov upload steps and badge locations in CI/workflow/docs.

Changes

Cohort / File(s) Summary
CI Workflow Markers
.circleci/config.yml, .circleci/vortex-test-common.yml, .github/workflows/build-test-deploy.yml
Wrapped existing Codecov upload steps with Vortex boundary comment markers (#;< CODE_COVERAGE_PROVIDER_CODECOV / #;> CODE_COVERAGE_PROVIDER_CODECOV) without changing the upload logic or conditions.
Installer Handler
.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php
New handler class implementing prompt UI, options (codecov, none), discovery (scans GH Actions and CircleCI for Codecov usage), and process() to queue removal of appropriate marker tokens.
Prompt Integration
.vortex/installer/src/Prompts/PromptManager.php
Registered the new CodeCoverageProvider handler under "Automations", added it to processing order, included it in response summaries, and incremented TOTAL_RESPONSES from 32 to 33.
Unit & Functional Tests
.vortex/installer/tests/Unit/Handlers/CodeCoverageProviderHandlerDiscoveryTest.php, .vortex/installer/tests/Functional/Handlers/CodeCoverageProviderHandlerProcessTest.php, .vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php, .vortex/installer/tests/Unit/Handlers/AbstractHandlerTypeTest.php
Added discovery and processing tests for the new handler, updated test harness defaults and type-inference datasets to include the new prompt.
Docs / Badges
README.dist.md, .vortex/installer/CLAUDE.md
Inserted Vortex marker blocks around the Codecov badge in README and documented installer video update steps and prompt changes in CLAUDE.md.

Sequence Diagram

sequenceDiagram
    participant Installer as Installer
    participant PromptMgr as Prompt Manager
    participant Handler as CodeCoverageProvider Handler
    participant CIConfig as CI Config Files (GH Actions / CircleCI)

    Installer->>PromptMgr: init prompts
    PromptMgr->>Handler: discover()
    Handler->>CIConfig: scan workflows / circleci config for Codecov
    CIConfig-->>Handler: detection result
    Handler-->>PromptMgr: discovery result (codecov / none / null)
    PromptMgr->>Installer: present selection (default based on discovery)
    Installer-->>PromptMgr: user selection
    PromptMgr->>Handler: process(selection)
    Handler->>CIConfig: add/remove Vortex markers (`CODE_COVERAGE_PROVIDER_CODECOV`)
    CIConfig-->>Handler: files updated
    Handler-->>PromptMgr: processing complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

AUTOMERGE

Poem

🐰 I hopped through workflows, sniffed each line,
Markers planted where Codecov signs.
A prompt, a choice — then files realigned,
Installer hums, discovery kind.
Hooray, coverage blooms, rabbit-approved and fine! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new CodeCoverageProvider installer prompt with Codecov as an option.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #2444 by adding a CodeCoverageProvider installer prompt allowing users to select codecov or none.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the CodeCoverageProvider feature: handler implementation, token wrapping in CI configs, installer registration, tests, and documentation updates.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/2444-codecov-select

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php:
- Around line 54-62: The current detection in CodeCoverageProvider.php is too
narrow—replace the hardcoded checks against a single workflow file ($gha) and a
specific CircleCI substring ($circle) with broader searches: scan all files
under .github/workflows/*.y*ml for any occurrence of "codecov" (or
"codecov/codecov-action") and check .circleci/config.yml (if present) for the
substring "codecov" rather than the exact "codecov -Z -s"; use glob() to
enumerate workflow files and File::contains() or similar to search contents, and
keep returning self::CODECOV when any match is found so existing Codecov setups
aren’t silently missed.

In
@.vortex/installer/tests/Functional/Handlers/CodeCoverageProviderHandlerProcessTest.php:
- Around line 14-23: Add a new data provider case in dataProviderHandlerProcess
to exercise the "none" branch: yield a case named like
'code_coverage_provider_none' that uses the same static::cw helper and sets
$test->prompts[CodeCoverageProvider::id()] to the "none" constant (e.g.,
CodeCoverageProvider::NONE) so the handler's else-branch is executed; keep the
pattern consistent with the existing 'codecov' yields and include no CiProvider
prompt for this scenario.

In
@.vortex/installer/tests/Unit/Handlers/CodeCoverageProviderHandlerDiscoveryTest.php:
- Line 63: The invalid discovery test's setup closure currently accepts only one
parameter (AbstractHandlerDiscoveryTestCase $test) but the test harness calls
setup callbacks with two arguments (the test instance and a Config object);
update the closure used in CodeCoverageProviderHandlerDiscoveryTest's "invalid"
case to accept two parameters (e.g., function(AbstractHandlerDiscoveryTestCase
$test, Config $config): void) and, if necessary, import or fully qualify the
Config type and adjust the closure body to use or ignore the $config parameter
so the arity matches the harness invocation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 334913e8-0f67-4144-acb7-64b65ad5e0aa

📥 Commits

Reviewing files that changed from the base of the PR and between c98ee30 and f804339.

⛔ Files ignored due to path filters (69)
  • .vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/_baseline/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/post-coverage-comment.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.github/workflows/-build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/docs/ci.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/CircleCiConfigTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/web/sites/default/includes/providers/-settings.gha.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/web/sites/default/includes/providers/settings.circleci.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_none/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_acquia/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/names/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/provision_profile/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/provision_profile/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/timezone_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_behat/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_none/.github/workflows/build-test-deploy.yml is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (9)
  • .circleci/config.yml
  • .github/workflows/build-test-deploy.yml
  • .vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php
  • .vortex/installer/src/Prompts/PromptManager.php
  • .vortex/installer/tests/Functional/Handlers/CodeCoverageProviderHandlerProcessTest.php
  • .vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php
  • .vortex/installer/tests/Unit/Handlers/AbstractHandlerTypeTest.php
  • .vortex/installer/tests/Unit/Handlers/CodeCoverageProviderHandlerDiscoveryTest.php
  • README.dist.md

Comment thread .vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php Outdated
Comment on lines +14 to +23
public static function dataProviderHandlerProcess(): \Iterator {
yield 'code_coverage_provider_codecov' => [
static::cw(fn($test): string => $test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV),
];
yield 'code_coverage_provider_codecov_circleci' => [
static::cw(function ($test): void {
$test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV;
$test->prompts[CiProvider::id()] = CiProvider::CIRCLECI;
}),
];
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add an explicit none process scenario to cover the else-branch.

This provider has two process paths; this test currently validates only codecov variants.

✅ Suggested test addition
   public static function dataProviderHandlerProcess(): \Iterator {
+    yield 'code_coverage_provider_none' => [
+      static::cw(function ($test): void {
+          $test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::NONE;
+      }),
+    ];
+
     yield 'code_coverage_provider_codecov' => [
       static::cw(fn($test): string => $test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV),
     ];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static function dataProviderHandlerProcess(): \Iterator {
yield 'code_coverage_provider_codecov' => [
static::cw(fn($test): string => $test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV),
];
yield 'code_coverage_provider_codecov_circleci' => [
static::cw(function ($test): void {
$test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV;
$test->prompts[CiProvider::id()] = CiProvider::CIRCLECI;
}),
];
public static function dataProviderHandlerProcess(): \Iterator {
yield 'code_coverage_provider_none' => [
static::cw(function ($test): void {
$test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::NONE;
}),
];
yield 'code_coverage_provider_codecov' => [
static::cw(fn($test): string => $test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV),
];
yield 'code_coverage_provider_codecov_circleci' => [
static::cw(function ($test): void {
$test->prompts[CodeCoverageProvider::id()] = CodeCoverageProvider::CODECOV;
$test->prompts[CiProvider::id()] = CiProvider::CIRCLECI;
}),
];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
@.vortex/installer/tests/Functional/Handlers/CodeCoverageProviderHandlerProcessTest.php
around lines 14 - 23, Add a new data provider case in dataProviderHandlerProcess
to exercise the "none" branch: yield a case named like
'code_coverage_provider_none' that uses the same static::cw helper and sets
$test->prompts[CodeCoverageProvider::id()] to the "none" constant (e.g.,
CodeCoverageProvider::NONE) so the handler's else-branch is executed; keep the
pattern consistent with the existing 'codecov' yields and include no CiProvider
prompt for this scenario.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not adding this scenario. NONE is the default for this handler, so the baseline fixture already exercises the else-branch end-to-end (no codecov content anywhere in the generated project). A code_coverage_provider_none fixture would be a zero-diff copy of _baseline/ and add no coverage on top of what the baseline snapshot tests already assert.

If the default later flips to CODECOV, that assumption no longer holds and the none fixture becomes meaningful - happy to add it at that point.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexSkrypnyk, that's a clear and reasonable explanation — the baseline fixture serving as the implicit none coverage makes perfect sense given NONE is the default. I'll withdraw the suggestion.

(ᵔᴥᵔ)


✏️ Learnings added
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 2464
File: .vortex/installer/tests/Functional/Handlers/CodeCoverageProviderHandlerProcessTest.php:14-23
Timestamp: 2026-04-20T01:43:31.229Z
Learning: In `.vortex/installer/tests/Functional/Handlers/`, the `_baseline/` fixture implicitly exercises the "else-branch" (i.e. default value) of every handler. For `CodeCoverageProvider` (in `CodeCoverageProviderHandlerProcessTest.php`), `NONE` is the default, so no explicit `code_coverage_provider_none` fixture is needed — it would be a zero-diff copy of the baseline. A dedicated `none` fixture only becomes meaningful if the default is later changed to `CODECOV`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 2011
File: .vortex/tests/phpunit/Traits/Steps/StepAhoyTrait.php:20-23
Timestamp: 2025-09-13T04:14:41.765Z
Learning: In .vortex/tests/phpunit PHPUnit tests using cmd/cmdFail helpers, patterns in the expected output arrays support '*' markers for positive assertions (text must be present) and '!' markers for negative assertions (text must NOT be present). The '*' markers are NOT literal text matches but rather indicate expected presence.

yield 'code coverage provider - discovery - invalid' => [
[],
$expected_defaults,
function (AbstractHandlerDiscoveryTestCase $test): void {
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Confirm how setup callbacks are invoked in the shared discovery harness.
rg -n -C4 --type=php 'call_user_func|->\(|\$config|dataProviderRunPrompts|\[\s*2\s*\]' \
  .vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php

# 2) Compare callback signatures in this test file.
rg -n -C1 --type=php 'function \(AbstractHandlerDiscoveryTestCase \$test' \
  .vortex/installer/tests/Unit/Handlers/CodeCoverageProviderHandlerDiscoveryTest.php

Repository: drevops/vortex

Length of output: 2927


Fix callback arity mismatch in the invalid discovery case.

The setup callback at line 63 accepts only one parameter, but the test harness (AbstractHandlerDiscoveryTestCase) invokes all setup callbacks with two arguments: the test instance and a Config object (lines 99 and 115). This will cause an ArgumentCountError at runtime.

Proposed fix
-      function (AbstractHandlerDiscoveryTestCase $test): void {
+      function (AbstractHandlerDiscoveryTestCase $test, Config $config): void {
         // No CI config and not installed - fall back to default.
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function (AbstractHandlerDiscoveryTestCase $test): void {
function (AbstractHandlerDiscoveryTestCase $test, Config $config): void {
// No CI config and not installed - fall back to default.
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
@.vortex/installer/tests/Unit/Handlers/CodeCoverageProviderHandlerDiscoveryTest.php
at line 63, The invalid discovery test's setup closure currently accepts only
one parameter (AbstractHandlerDiscoveryTestCase $test) but the test harness
calls setup callbacks with two arguments (the test instance and a Config
object); update the closure used in CodeCoverageProviderHandlerDiscoveryTest's
"invalid" case to accept two parameters (e.g.,
function(AbstractHandlerDiscoveryTestCase $test, Config $config): void) and, if
necessary, import or fully qualify the Config type and adjust the closure body
to use or ignore the $config parameter so the arity matches the harness
invocation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive - no action taken.

PHP closures silently discard extra positional arguments; calling a 1-parameter closure with 2 arguments does not raise ArgumentCountError. ArgumentCountError only fires when fewer arguments are passed than the function requires.

Existing tests in this codebase use the exact same one-arg signature on the invalid case and pass:

  • .vortex/installer/tests/Unit/Handlers/PullRequestHandlerDiscoveryTest.php line 50
  • .vortex/installer/tests/Unit/Handlers/DependencyUpdatesProviderHandlerDiscoveryTest.php line 63

The full unit suite (1336 tests) is green on this branch, which empirically confirms the invocation pattern is valid.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexSkrypnyk, you're absolutely right — I apologize for the noise. PHP closures silently discard extra positional arguments passed beyond what the closure declares; ArgumentCountError is only thrown when the caller provides fewer arguments than the closure requires. The 1-parameter signature on the invalid case is perfectly valid, and the existing test precedents in the codebase confirm this.

I'll record this to avoid repeating the mistake in future reviews.


✏️ Learnings added
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 2464
File: .vortex/installer/tests/Unit/Handlers/CodeCoverageProviderHandlerDiscoveryTest.php:63-63
Timestamp: 2026-04-20T01:43:38.833Z
Learning: In PHP, calling a closure (or any function) with *more* positional arguments than it declares does NOT raise an `ArgumentCountError` — the extra arguments are silently discarded. `ArgumentCountError` is only thrown when *fewer* arguments are provided than the function requires. In the drevops/vortex test harness (e.g., `AbstractHandlerDiscoveryTestCase`), setup callbacks for discovery tests are invoked with two arguments (test instance + Config object), but individual test cases may legitimately declare only one parameter (e.g., `function (AbstractHandlerDiscoveryTestCase $test): void`) without causing any runtime error. Do not flag this as an arity mismatch.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 2011
File: .vortex/tests/phpunit/Traits/Steps/StepAhoyTrait.php:20-23
Timestamp: 2025-09-13T04:14:41.765Z
Learning: In .vortex/tests/phpunit PHPUnit tests using cmd/cmdFail helpers, patterns in the expected output arrays support '*' markers for positive assertions (text must be present) and '!' markers for negative assertions (text must NOT be present). The '*' markers are NOT literal text matches but rather indicate expected presence.

Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 2446
File: jest.config.js:34-34
Timestamp: 2026-04-02T07:57:37.453Z
Learning: In the drevops/vortex repository, all coverage reports follow the convention `.logs/coverage/<tool>` (e.g. `.logs/coverage/jest` for Jest, `.logs/coverage/phpunit` for PHPUnit). The CI PHPUnit coverage extraction paths (e.g. `/tmp/artifacts/coverage/phpunit/cobertura.xml`) are specific to PHPUnit. Jest CI coverage integration is separate and will be configured independently. Do not flag `.logs/coverage/jest` as misaligned with PHPUnit CI artifact paths.

@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.44%. Comparing base (c98ee30) to head (32d7e2d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...Unit/Handlers/AbstractHandlerDiscoveryTestCase.php 0.00% 3 Missing ⚠️
...ller/src/Prompts/Handlers/CodeCoverageProvider.php 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2464      +/-   ##
==========================================
- Coverage   79.88%   79.44%   -0.44%     
==========================================
  Files         128      122       -6     
  Lines        6861     6729     -132     
  Branches       47        3      -44     
==========================================
- Hits         5481     5346     -135     
- Misses       1380     1383       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.53% (201/204)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk
Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.53% (201/204)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk AlexSkrypnyk merged commit 2abe9d3 into main Apr 20, 2026
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/2444-codecov-select branch April 20, 2026 02:14
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex Apr 20, 2026
@AlexSkrypnyk AlexSkrypnyk added this to the 1.38.0 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Allow selecting codecov in the installer

1 participant