Skip to content

Allow Codecov to fail in CI without failing the pipeline. #2477

Merged
AlexSkrypnyk merged 2 commits intomainfrom
feature/optional-codecov2
Apr 27, 2026
Merged

Allow Codecov to fail in CI without failing the pipeline. #2477
AlexSkrypnyk merged 2 commits intomainfrom
feature/optional-codecov2

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Apr 27, 2026

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated demo database source to latest version
    • Improved CI/CD workflow resilience by allowing Codecov upload failures without blocking pipeline completion
  • Documentation

    • Refactored test asset maintenance documentation with automated workflow approach
  • Tests

    • Enhanced test setup with additional cache clearing step

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Walkthrough

The pull request updates the demo database source URL to a newer release, modifies GitHub Actions workflows to make Codecov upload failures non-fatal, refactors maintenance documentation to centralize test asset updates, adds a Redis cache flush step to a test, and introduces a new automation script for rebuilding and publishing test assets.

Changes

Cohort / File(s) Summary
Environment Configuration
.env
Updates demo database download URL from drevops/vortex 25.4.0 to 1.37.0 release asset.
GitHub Actions Codecov Integration
.github/workflows/build-test-deploy.yml, .github/workflows/vortex-test-common.yml, .github/workflows/vortex-test-docs.yml, .github/workflows/vortex-test-installer.yml
Adds continue-on-error: true to Codecov upload steps across four workflows, making upload failures non-fatal while preserving existing fail_ci_if_error settings.
Maintenance Documentation
.vortex/docs/content/contributing/maintenance/template.mdx
Consolidates manual test asset update instructions into mode-based php .vortex/tests/update-test-assets command interface with demo-dump, demo-image, test-dump, test-image, destination-images, and all modes; adds --tag option for image tagging.
Test Coverage
.vortex/tests/phpunit/Functional/AhoyWorkflowTest.php
Adds Redis cache flush step (ahoy flush-redis) between database drop and provisioning assertions in testAhoyWorkflowProvisionFallbackToProfile.
Test Asset Automation
.vortex/tests/update-test-assets
New executable PHP CLI script automating rebuild and publication of Vortex test assets: stack builds, database dumps with normalization, image seeding/pushing, and content configuration via Drush with validation and error handling.

Suggested Labels

Requires more work

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

Poem

🐰 A script hops in, automation's delight,
Building test assets from container to site,
Codecov won't break our workflow's fine flow,
Assets updated with one command below! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title describes allowing Codecov to fail without failing the pipeline, but the changeset includes multiple unrelated modifications: .env database URL updates, test asset automation scripts, documentation refactoring, and test workflow changes beyond just Codecov error handling. The title should reflect all significant changes in the PR. Consider a more comprehensive title like 'Update test assets automation, Codecov error handling, and demo database configuration' or split into multiple focused PRs.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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/optional-codecov2

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: 4

🤖 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/docs/content/contributing/maintenance/template.mdx:
- Around line 269-275: Update the "destination-images" caveat: it currently
claims the image drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest must
exist locally, but the script .vortex/tests/update-test-assets (the pull logic
around the block that fetches
drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag>) actually pulls the
specified <tag> from Docker Hub first, so change the wording to state that the
source tag must be pushed to Docker Hub (e.g., "Ensure drevops/...-11.x:<tag> is
already pushed to Docker Hub; the script pulls that tag from the registry")
rather than requiring a local :latest image.

In @.vortex/tests/update-test-assets:
- Around line 275-276: The build step currently swallows all failures by using
"run('ahoy fe || true', $cwd)", which masks real build regressions; change it to
only skip the front-end build when the real precondition (theme not configured)
is true and otherwise run the build normally. Replace the unconditional
"run('ahoy fe || true', $cwd)" with a guarded check around the step/ run call
(e.g., query the theme configuration flag or existence of theme assets) and call
"run('ahoy fe', $cwd)" only when the theme is configured, letting the step fail
on non-zero exit for real build errors; ensure you update the same step/ run
invocation in this file.
- Around line 407-412: When handling the --tag branch, reject an explicitly
empty string value the same as --tag= by validating $tag after assignment; after
$tag = $args[$i + 1]; add a check if ($tag === '') and call usage_error($script,
$valid_modes, "Option '--tag' requires a value."); so that variables $arg,
$args, $i, $tag and the usage_error(...) call enforce a fast fail for empty tag
values.
- Around line 382-389: The seed_image function currently downloads and executes
an unpinned seed.sh from SEED_URL which risks running arbitrary upstream
changes; update this to use a versioned/checked asset (or vendor the script) and
verify its checksum before making it executable and running it: change SEED_URL
to a specific release URL or add a bundled seed.sh, add a constant expected
checksum (e.g., SEED_SHA256) and after downloading compute and compare the
file's sha256, abort with an error if it doesn't match, only then run chmod +x
and execute the script in seed_image; ensure the verification and failure paths
are implemented inside seed_image (or a helper) so run(sprintf('curl ...')) is
replaced by a secure fetch+verify flow.
🪄 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: 66ba7eba-15af-48ec-9c25-d85d25aab30d

📥 Commits

Reviewing files that changed from the base of the PR and between e5a43dc and fc0f2f3.

⛔ Files ignored due to path filters (21)
  • .vortex/installer/tests/Fixtures/handler_process/_baseline/.env 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/db_download_source_acquia/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/provision_profile/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/.env is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (8)
  • .env
  • .github/workflows/build-test-deploy.yml
  • .github/workflows/vortex-test-common.yml
  • .github/workflows/vortex-test-docs.yml
  • .github/workflows/vortex-test-installer.yml
  • .vortex/docs/content/contributing/maintenance/template.mdx
  • .vortex/tests/phpunit/Functional/AhoyWorkflowTest.php
  • .vortex/tests/update-test-assets

Comment on lines +269 to +275
### Caveats

### Updating *test* database *container image*
- Demo modes are **destructive** against the current repository: containers
are reset and `.data/db.sql` is removed before the rebuild.
- Test modes wipe and recreate `/tmp/star-wars` on each run.
- `destination-images` expects `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest`
to already exist locally - run `demo-image` (or `all`) first.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

The destination-images caveat no longer matches the script.

The implementation pulls drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag> first in .vortex/tests/update-test-assets, Lines 139-146, so the prerequisite is “that source tag is already pushed to Docker Hub”, not “:latest exists locally”. As written, destination-images --tag rc1 is documented incorrectly.

Suggested fix
-- `destination-images` expects `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest`
-  to already exist locally - run `demo-image` (or `all`) first.
+- `destination-images` pulls `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag>`
+  first, so that source tag must already be published to Docker Hub.
+  Run `demo-image --tag <tag>` (or `all --tag <tag>`) before using it standalone.
📝 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
### Caveats
### Updating *test* database *container image*
- Demo modes are **destructive** against the current repository: containers
are reset and `.data/db.sql` is removed before the rebuild.
- Test modes wipe and recreate `/tmp/star-wars` on each run.
- `destination-images` expects `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest`
to already exist locally - run `demo-image` (or `all`) first.
### Caveats
- Demo modes are **destructive** against the current repository: containers
are reset and `.data/db.sql` is removed before the rebuild.
- Test modes wipe and recreate `/tmp/star-wars` on each run.
- `destination-images` pulls `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag>`
first, so that source tag must already be published to Docker Hub.
Run `demo-image --tag <tag>` (or `all --tag <tag>`) before using it standalone.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vortex/docs/content/contributing/maintenance/template.mdx around lines 269
- 275, Update the "destination-images" caveat: it currently claims the image
drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest must exist locally, but
the script .vortex/tests/update-test-assets (the pull logic around the block
that fetches drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag>) actually
pulls the specified <tag> from Docker Hub first, so change the wording to state
that the source tag must be pushed to Docker Hub (e.g., "Ensure
drevops/...-11.x:<tag> is already pushed to Docker Hub; the script pulls that
tag from the registry") rather than requiring a local :latest image.

Comment on lines +275 to +276
step('Build front-end assets (skipped if theme not configured)');
run('ahoy fe || true', $cwd);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Don't mask real front-end build failures with || true.

This treats “theme not configured” and an actual asset-build regression the same way, so the script can continue publishing refreshed dumps/images from a broken build. Guard the step with the real precondition instead of swallowing every non-zero exit.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vortex/tests/update-test-assets around lines 275 - 276, The build step
currently swallows all failures by using "run('ahoy fe || true', $cwd)", which
masks real build regressions; change it to only skip the front-end build when
the real precondition (theme not configured) is true and otherwise run the build
normally. Replace the unconditional "run('ahoy fe || true', $cwd)" with a
guarded check around the step/ run call (e.g., query the theme configuration
flag or existence of theme assets) and call "run('ahoy fe', $cwd)" only when the
theme is configured, letting the step fail on non-zero exit for real build
errors; ensure you update the same step/ run invocation in this file.

Comment on lines +382 to +389
function seed_image(string $cwd, string $filename, string $image): void {
step('Download seed.sh');
run(sprintf('curl -fsSL -o seed.sh %s', escapeshellarg(SEED_URL)), $cwd);
run('chmod +x seed.sh', $cwd);

step(sprintf('Seed and push image to %s', $image));
run(sprintf('./seed.sh .data/%s %s', escapeshellarg($filename), escapeshellarg($image)), $cwd);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the file in question
find . -name "update-test-assets" -type f 2>/dev/null

Repository: drevops/vortex

Length of output: 93


🏁 Script executed:

# Search for SEED_URL definition
rg "SEED_URL" -B 2 -A 2

Repository: drevops/vortex

Length of output: 40


🏁 Script executed:

# Check the full context of the file around lines 382-389
if [ -f ".vortex/tests/update-test-assets" ]; then
  wc -l ".vortex/tests/update-test-assets"
fi

Repository: drevops/vortex

Length of output: 95


🏁 Script executed:

# Read the file to find SEED_URL definition and context around lines 382-389
cat -n ".vortex/tests/update-test-assets" | grep -A 5 -B 5 "SEED_URL"

Repository: drevops/vortex

Length of output: 1210


🏁 Script executed:

# Read the specific section around lines 382-389
sed -n '370,400p' ".vortex/tests/update-test-assets"

Repository: drevops/vortex

Length of output: 1019


🏁 Script executed:

# Check if there's any checksum or signature verification in the file
rg -i "checksum|sha|hash|signature|verify|gpg" ".vortex/tests/update-test-assets"

Repository: drevops/vortex

Length of output: 343


🏁 Script executed:

# Look for all seed.sh references in the file
grep -n "seed\.sh" ".vortex/tests/update-test-assets"

Repository: drevops/vortex

Length of output: 412


🏁 Script executed:

# Check if seed.sh is vendored elsewhere in the repo
find . -name "seed.sh" -type f 2>/dev/null

Repository: drevops/vortex

Length of output: 40


🏁 Script executed:

# Check the entire context of the seed_image function usage to understand the risk
rg "seed_image" -B 3 -A 3 ".vortex/tests/update-test-assets"

Repository: drevops/vortex

Length of output: 1422


Pin or verify seed.sh before executing it.

Fetching from /releases/latest/ makes this workflow non-reproducible and executes whatever the newest upstream release serves at runtime. A bad upstream release changes behavior here without any code change in this repo. Prefer a versioned asset plus checksum verification, or vendor the script.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vortex/tests/update-test-assets around lines 382 - 389, The seed_image
function currently downloads and executes an unpinned seed.sh from SEED_URL
which risks running arbitrary upstream changes; update this to use a
versioned/checked asset (or vendor the script) and verify its checksum before
making it executable and running it: change SEED_URL to a specific release URL
or add a bundled seed.sh, add a constant expected checksum (e.g., SEED_SHA256)
and after downloading compute and compare the file's sha256, abort with an error
if it doesn't match, only then run chmod +x and execute the script in
seed_image; ensure the verification and failure paths are implemented inside
seed_image (or a helper) so run(sprintf('curl ...')) is replaced by a secure
fetch+verify flow.

Comment on lines +407 to +412
if ($arg === '--tag') {
if (!isset($args[$i + 1])) {
usage_error($script, $valid_modes, "Option '--tag' requires a value.");
}
$tag = $args[$i + 1];
$i += 2;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Reject --tag '' the same way as --tag=.

--tag '' passes parsing today, then fails much later when Docker receives an invalid image reference like repo:. Fail fast here with the same usage error you already use for an empty --tag= value.

Suggested fix
     if ($arg === '--tag') {
       if (!isset($args[$i + 1])) {
         usage_error($script, $valid_modes, "Option '--tag' requires a value.");
       }
       $tag = $args[$i + 1];
+      if ($tag === '') {
+        usage_error($script, $valid_modes, "Option '--tag' requires a value.");
+      }
       $i += 2;
       continue;
     }
📝 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
if ($arg === '--tag') {
if (!isset($args[$i + 1])) {
usage_error($script, $valid_modes, "Option '--tag' requires a value.");
}
$tag = $args[$i + 1];
$i += 2;
if ($arg === '--tag') {
if (!isset($args[$i + 1])) {
usage_error($script, $valid_modes, "Option '--tag' requires a value.");
}
$tag = $args[$i + 1];
if ($tag === '') {
usage_error($script, $valid_modes, "Option '--tag' requires a value.");
}
$i += 2;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vortex/tests/update-test-assets around lines 407 - 412, When handling the
--tag branch, reject an explicitly empty string value the same as --tag= by
validating $tag after assignment; after $tag = $args[$i + 1]; add a check if
($tag === '') and call usage_error($script, $valid_modes, "Option '--tag'
requires a value."); so that variables $arg, $args, $i, $tag and the
usage_error(...) call enforce a fast fail for empty tag values.

@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)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.51%. Comparing base (e5a43dc) to head (fc0f2f3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2477      +/-   ##
==========================================
- Coverage   79.97%   79.51%   -0.46%     
==========================================
  Files         129      122       -7     
  Lines        6895     6736     -159     
  Branches       47        3      -44     
==========================================
- Hits         5514     5356     -158     
+ Misses       1381     1380       -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 merged commit 8984c40 into main Apr 27, 2026
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/optional-codecov2 branch April 27, 2026 11:15
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex Apr 27, 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