Skip to content

Fixed coverage threshold check not storing results on low values in CI.#2372

Merged
AlexSkrypnyk merged 1 commit intomainfrom
feature/fix-threshold-not-storing-on-failure-in-ci
Mar 12, 2026
Merged

Fixed coverage threshold check not storing results on low values in CI.#2372
AlexSkrypnyk merged 1 commit intomainfrom
feature/fix-threshold-not-storing-on-failure-in-ci

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Mar 12, 2026

Summary by CodeRabbit

  • Chores
    • Refactored CI/CD coverage validation into two steps: one step now extracts and publishes the numeric coverage result for reuse, and a later, separate step enforces the configured coverage threshold and fails the run if not met. This preserves existing reporting and PR comment behavior while clarifying pipeline flow and improving maintainability of coverage checks.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Walkthrough

The PR refactors CI coverage checks by splitting the inline threshold validation into two steps: one step extracts and exports the numeric coverage percent (COVERAGE_PERCENT), and a later step enforces the VORTEX_CI_CODE_COVERAGE_THRESHOLD using that exported value.

Changes

Cohort / File(s) Summary
CircleCI main config
​.circleci/config.yml
Renamed coverage check step to "Extract code coverage"; compute and export COVERAGE_PERCENT instead of failing inline; enforcement moved out to a separate step.
GitHub Actions workflow
​.github/workflows/build-test-deploy.yml
Same refactor applied: extraction step computes/exports COVERAGE_PERCENT and emits content; added final "Check code coverage threshold" step that fails if COVERAGE_PERCENT < VORTEX_CI_CODE_COVERAGE_THRESHOLD.
CircleCI shared steps
​.circleci/vortex-test-common.yml
Updated shared workflow piece to extract/export COVERAGE_PERCENT (via BASH_ENV) and removed inline exit; added separate threshold-check step consuming exported value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I parsed the lines of coverage bright,
I hopped and stored the percent in flight—
First I fetch, then later I test,
A two-step jig that feels the best. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring the coverage threshold check to export results before enforcing the threshold, fixing the issue where results were not stored when coverage was low.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/fix-threshold-not-storing-on-failure-in-ci

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

Copy link

@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: 2

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

Inline comments:
In @.circleci/config.yml:
- Around line 434-441: The coverage check currently assumes COVERAGE_PERCENT is
set and does a numeric comparison, which breaks if COVERAGE_PERCENT is empty;
modify the check in the CI step that references COVERAGE_PERCENT and
VORTEX_CI_CODE_COVERAGE_THRESHOLD so it first verifies COVERAGE_PERCENT is
non-empty and numeric (or defaults it to 0) before performing the integer
comparison, and if empty/malformed emit a clear failure message and exit
non‑zero; update the existing conditional around the comparison (the block using
COVERAGE_PERCENT//. and VORTEX_CI_CODE_COVERAGE_THRESHOLD) to include this guard
so the script fails gracefully when cobertura.xml is missing or malformed.

In @.github/workflows/build-test-deploy.yml:
- Around line 455-463: The Check code coverage threshold step fails when
COVERAGE_PERCENT is empty; update the shell logic in that step to handle an
unset/empty COVERAGE_PERCENT before doing the integer comparison with
VORTEX_CI_CODE_COVERAGE_THRESHOLD: detect if COVERAGE_PERCENT is empty or
non-numeric (e.g., [ -z "$COVERAGE_PERCENT" ]), set a safe default value (such
as 0) or emit a clear message and fail gracefully, then perform the existing
numeric comparison using the sanitized value (the expression that currently
strips dots from COVERAGE_PERCENT should operate on the validated/sanitized
variable); reference the step name "Check code coverage threshold" and the
variables COVERAGE_PERCENT and VORTEX_CI_CODE_COVERAGE_THRESHOLD when making the
change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 89520d5a-e3a1-40bf-8792-1e7c97d9b16b

📥 Commits

Reviewing files that changed from the base of the PR and between 0a9c34f and a37cf37.

⛔ Files ignored due to path filters (24)
  • .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/ciprovider_circleci/.circleci/config.yml 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_none_circleci/.circleci/config.yml 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/migration_disabled_circleci/.circleci/config.yml 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/provision_profile/.github/workflows/build-test-deploy.yml 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/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_tests/.github/workflows/build-test-deploy.yml 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_no_theme_circleci/.circleci/config.yml 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_eslint_circleci/.circleci/config.yml 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_phpmd_circleci/.circleci/config.yml 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_phpunit/.github/workflows/build-test-deploy.yml 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_stylelint_circleci/.circleci/config.yml 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 (2)
  • .circleci/config.yml
  • .github/workflows/build-test-deploy.yml

Comment on lines +434 to +441
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Handle unset COVERAGE_PERCENT gracefully.

If the cobertura.xml file is missing or malformed, COVERAGE_PERCENT will be empty, causing the integer comparison on line 438 to fail with a shell error. Consider adding a guard:

🛡️ Proposed fix
       - run:
           name: Check code coverage threshold
           command: |
             [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
+            if [ -z "${COVERAGE_PERCENT:-}" ]; then
+              echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
+              exit 1
+            fi
             if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
               echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
               exit 1
             fi
📝 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
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ -z "${COVERAGE_PERCENT:-}" ]; then
echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
exit 1
fi
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.circleci/config.yml around lines 434 - 441, The coverage check currently
assumes COVERAGE_PERCENT is set and does a numeric comparison, which breaks if
COVERAGE_PERCENT is empty; modify the check in the CI step that references
COVERAGE_PERCENT and VORTEX_CI_CODE_COVERAGE_THRESHOLD so it first verifies
COVERAGE_PERCENT is non-empty and numeric (or defaults it to 0) before
performing the integer comparison, and if empty/malformed emit a clear failure
message and exit non‑zero; update the existing conditional around the comparison
(the block using COVERAGE_PERCENT//. and VORTEX_CI_CODE_COVERAGE_THRESHOLD) to
include this guard so the script fails gracefully when cobertura.xml is missing
or malformed.

Comment on lines +455 to +463
- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Handle unset COVERAGE_PERCENT gracefully.

Same as the CircleCI config: if COVERAGE_PERCENT is empty (e.g., cobertura.xml missing), the integer comparison on line 458 will fail with a shell error.

🛡️ Proposed fix
       - name: Check code coverage threshold
         if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
         run: |
+          if [ -z "${COVERAGE_PERCENT:-}" ]; then
+            echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
+            exit 1
+          fi
           if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
             echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
             exit 1
           fi
         env:
           VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
📝 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
- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
- name: Check code coverage threshold
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
run: |
if [ -z "${COVERAGE_PERCENT:-}" ]; then
echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
exit 1
fi
if [ "${COVERAGE_PERCENT//.}" -lt "$((VORTEX_CI_CODE_COVERAGE_THRESHOLD*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD}%"
exit 1
fi
env:
VORTEX_CI_CODE_COVERAGE_THRESHOLD: ${{ vars.VORTEX_CI_CODE_COVERAGE_THRESHOLD || '90' }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build-test-deploy.yml around lines 455 - 463, The Check
code coverage threshold step fails when COVERAGE_PERCENT is empty; update the
shell logic in that step to handle an unset/empty COVERAGE_PERCENT before doing
the integer comparison with VORTEX_CI_CODE_COVERAGE_THRESHOLD: detect if
COVERAGE_PERCENT is empty or non-numeric (e.g., [ -z "$COVERAGE_PERCENT" ]), set
a safe default value (such as 0) or emit a clear message and fail gracefully,
then perform the existing numeric comparison using the sanitized value (the
expression that currently strips dots from COVERAGE_PERCENT should operate on
the validated/sanitized variable); reference the step name "Check code coverage
threshold" and the variables COVERAGE_PERCENT and
VORTEX_CI_CODE_COVERAGE_THRESHOLD when making the change.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-03-12 11:53:40

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@github-actions

This comment has been minimized.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-03-12 11:57:10

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-03-12 11:57:22

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.91%. Comparing base (bfd9a5b) to head (2cce293).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2372      +/-   ##
==========================================
- Coverage   79.41%   78.91%   -0.50%     
==========================================
  Files         125      118       -7     
  Lines        6654     6502     -152     
  Branches       44        0      -44     
==========================================
- Hits         5284     5131     -153     
- Misses       1370     1371       +1     

☔ 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.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/fix-threshold-not-storing-on-failure-in-ci branch from a37cf37 to 2cce293 Compare March 12, 2026 12:07
Copy link

@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: 1

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

Inline comments:
In @.circleci/vortex-test-common.yml:
- Around line 300-307: The script's coverage check uses COVERAGE_PERCENT in an
integer comparison but doesn't guard against it being empty; update the "Check
code coverage threshold" run step to first validate COVERAGE_PERCENT (e.g., test
-z or non-numeric) and, if missing or malformed, print a clear failure like
"FAIL: could not determine coverage (cobertura missing or malformed)" and exit
1; otherwise proceed with the existing comparison against
VORTEX_CI_CODE_COVERAGE_THRESHOLD using the normalized value
(${COVERAGE_PERCENT//.}) so the integer arithmetic won't error when coverage is
absent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0ecd61a0-9bd4-4d7a-8463-7cba58b02706

📥 Commits

Reviewing files that changed from the base of the PR and between a37cf37 and 2cce293.

⛔ Files ignored due to path filters (24)
  • .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/ciprovider_circleci/.circleci/config.yml 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_none_circleci/.circleci/config.yml 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/migration_disabled_circleci/.circleci/config.yml 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/provision_profile/.github/workflows/build-test-deploy.yml 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/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_tests/.github/workflows/build-test-deploy.yml 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_no_theme_circleci/.circleci/config.yml 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_eslint_circleci/.circleci/config.yml 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_phpmd_circleci/.circleci/config.yml 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_phpunit/.github/workflows/build-test-deploy.yml 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_stylelint_circleci/.circleci/config.yml 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 (3)
  • .circleci/config.yml
  • .circleci/vortex-test-common.yml
  • .github/workflows/build-test-deploy.yml

Comment on lines +300 to +307
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Handle unset COVERAGE_PERCENT gracefully.

If the cobertura.xml file is missing or malformed, COVERAGE_PERCENT will be empty, causing the integer comparison on line 304 to fail with a shell error. Add a guard to fail gracefully with a clear message.

🛡️ Proposed fix
       - run:
           name: Check code coverage threshold
           command: |
             [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
+            if [ -z "${COVERAGE_PERCENT:-}" ]; then
+              echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
+              exit 1
+            fi
             if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
               echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
               exit 1
             fi
📝 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
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
- run:
name: Check code coverage threshold
command: |
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
if [ -z "${COVERAGE_PERCENT:-}" ]; then
echo "FAIL: COVERAGE_PERCENT is not set (coverage report may be missing)"
exit 1
fi
if [ "${COVERAGE_PERCENT//.}" -lt "$((${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}*100))" ]; then
echo "FAIL: coverage ${COVERAGE_PERCENT}% is below threshold ${VORTEX_CI_CODE_COVERAGE_THRESHOLD:-90}%"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.circleci/vortex-test-common.yml around lines 300 - 307, The script's
coverage check uses COVERAGE_PERCENT in an integer comparison but doesn't guard
against it being empty; update the "Check code coverage threshold" run step to
first validate COVERAGE_PERCENT (e.g., test -z or non-numeric) and, if missing
or malformed, print a clear failure like "FAIL: could not determine coverage
(cobertura missing or malformed)" and exit 1; otherwise proceed with the
existing comparison against VORTEX_CI_CODE_COVERAGE_THRESHOLD using the
normalized value (${COVERAGE_PERCENT//.}) so the integer arithmetic won't error
when coverage is absent.

@github-actions
Copy link

Code Coverage Report:
  2026-03-12 12:13:42

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-03-12 12:14:19

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-03-12 12:16:25

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-03-12 12:17:08

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)

Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk AlexSkrypnyk merged commit e7e8ad8 into main Mar 12, 2026
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-threshold-not-storing-on-failure-in-ci branch March 12, 2026 12:47
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Mar 12, 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.

1 participant