Skip to content

Triggered 'Vortex - Test docs' from both per-major test workflows. - #2880

Merged
AlexSkrypnyk merged 1 commit into
mainfrom
feature/docs-trigger-cli
Jul 31, 2026
Merged

Triggered 'Vortex - Test docs' from both per-major test workflows.#2880
AlexSkrypnyk merged 1 commit into
mainfrom
feature/docs-trigger-cli

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

vortex-test-docs.yml is defined once, on the default branch (main), because GitHub only registers workflow_run triggers from a repository's default-branch copy of a workflow file, so that single definition has to serve pull requests on every major version's branches. It previously listened only for Vortex - Test installer, a workflow that does not exist on the 2.x lineage, where the installer was relocated into the drevops/vortex-cli package and its test workflow renamed to Vortex - Test CLI. As a result the trigger never fired on 2.x branches, the required Vortex - Test docs status was never posted, and every 2.x pull request was blocked indefinitely (the failure mode behind PR #2877, for example). This change makes the workflow trigger on both Vortex - Test installer and Vortex - Test CLI, derives the artifact name and phar filename from whichever workflow triggered the run, and downloads the artifact by run_id instead of by workflow name so it always matches the triggering commit rather than the most recent successful run across all branches.

Changes

.github/workflows/vortex-test-docs.yml

  • Added Vortex - Test CLI alongside Vortex - Test installer to the workflow_run trigger list, so the workflow fires regardless of which major produced the triggering run.
  • Added job-level env vars BINARY_ARTIFACT and BINARY_FILE, derived from github.event.workflow_run.name, so the artifact name (vortex-installer vs vortex-cli) and the downloaded phar filename (installer.phar vs vortex.phar) match whichever workflow triggered the run.
  • Changed the artifact download step to resolve by run_id: ${{ github.event.workflow_run.id }} instead of by workflow: vortex-test-installer.yml, because resolving by workflow name returns the most recent successful run across all branches and can download a binary built from an unrelated commit.
  • Renamed the download and copy steps and updated their comments to describe a binary artifact from either source workflow instead of assuming the installer.

.vortex/tests/zizmor.yml

  • Updated the stale vortex-test-docs ignore-rule comment to describe the trigger generically (a per-major test workflow) instead of naming only Vortex - Test installer, keeping it accurate now that two workflows can trigger the chained run.

Before / After

Before - the trigger list names one workflow, so only main-lineage runs match, and the artifact is fetched by workflow name (latest successful run on any branch):

┌─────────────────────────┐    ┌─────────────────────────┐
│ main: 'Test installer'  │    │ 2.x: 'Test CLI'          │
│ workflow completes      │    │ workflow completes       │
└────────────┬─────────────┘    └────────────┬─────────────┘
             │ name matches                   │ name NOT in
             │ workflow_run list               workflow_run list
             ▼                                 ✕
┌──────────────────────────┐        (workflow_run never fires)
│ vortex-test-docs          │
│ download ARTIFACT BY NAME │
│ 'vortex-installer' from   │
│ vortex-test-installer.yml │
│ (latest run, any branch)  │
└────────────┬───────────────┘
             ▼
  'Test docs' posted             'Test docs' NEVER posted
  on main PRs                    -> 2.x PRs blocked forever

After - both workflows are listed, the artifact/file names are derived from the triggering run's own name, and the download is pinned to that exact run:

┌─────────────────────────┐    ┌─────────────────────────┐
│ main: 'Test installer'  │    │ 2.x: 'Test CLI'          │
│ workflow completes      │    │ workflow completes       │
└────────────┬─────────────┘    └────────────┬─────────────┘
             │                                │
             └───────────────┬────────────────┘
                              │ both names in workflow_run list
                              ▼
              ┌───────────────────────────────────┐
              │ vortex-test-docs                  │
              │ BINARY_ARTIFACT/BINARY_FILE set    │
              │ from event.workflow_run.name       │
              │ download pinned to                 │
              │ run_id: event.workflow_run.id      │
              └────────────────┬────────────────────┘
                                ▼
              'Test docs' posted on BOTH lineages
              -> 2.x PRs unblocked

Summary by CodeRabbit

  • Bug Fixes

    • Documentation tests now run reliably after successful installer or CLI test workflows.
    • The correct build artifact and executable are selected automatically for each triggering workflow.
    • Artifacts are downloaded from the exact workflow run that initiated the documentation tests.
  • Documentation

    • Updated workflow security documentation to reflect the revised chained test execution.

'workflow_run' triggers are registered from the default branch only, so this file is the single definition serving branches of every major. Listening for 'Vortex - Test installer' alone leaves the required 'Vortex - Test docs' status unreported on '2.x', which ships 'Vortex - Test CLI' instead, blocking every '2.x' pull request.

The artifact download now resolves from the triggering run rather than by workflow name, which selects the most recent successful run across all branches and can yield a binary built from an unrelated commit.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The documentation workflow now runs after successful installer or CLI test workflows. It selects the matching artifact and PHAR name, retrieves the artifact from the triggering run, and installs the selected binary.

Changes

Documentation binary workflow

Layer / File(s) Summary
Upstream trigger selection
.github/workflows/vortex-test-docs.yml, .vortex/tests/zizmor.yml
The workflow accepts successful installer and CLI test completions. Environment variables select the matching artifact and binary. The audit comment describes the updated upstream trigger.
Exact run artifact retrieval
.github/workflows/vortex-test-docs.yml
Artifact retrieval uses the triggering workflow run and BINARY_ARTIFACT. The selected BINARY_FILE is copied to the documentation install path as install.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: Needs review

Poem

I’m a rabbit with a binary to bring,
From the matching test workflow’s wing.
I fetch the right artifact, quick and bright,
Then place install exactly right.
Hop, hop—docs are ready tonight!

🚥 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 summarizes the main change: triggering the documentation test workflow from both per-major test workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/docs-trigger-cli

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

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.55% (204/207)
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.55% (204/207)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.38%. Comparing base (8bd16d3) to head (c70d44f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2880      +/-   ##
==========================================
- Coverage   86.81%   86.38%   -0.43%     
==========================================
  Files         100       93       -7     
  Lines        4846     4687     -159     
  Branches       47        3      -44     
==========================================
- Hits         4207     4049     -158     
+ Misses        639      638       -1     

☔ View full report in Codecov by Harness.
📢 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/vortex-test-docs.yml:
- Around line 63-77: The workflow must separate untrusted execution from the
privileged workflow_run job: in .github/workflows/vortex-test-docs.yml lines
63-99, move checkout, artifact download/execution, and package scripts into an
unprivileged pull_request job, keeping write permissions and deployment secrets
out of it; in .vortex/tests/zizmor.yml lines 20-22, remove or narrow the
dangerous-triggers exception so it no longer permits this untrusted-code
execution pattern.
🪄 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: c0539d7f-463f-4a96-9e71-e5cb28c13540

📥 Commits

Reviewing files that changed from the base of the PR and between 8bd16d3 and c70d44f.

📒 Files selected for processing (2)
  • .github/workflows/vortex-test-docs.yml
  • .vortex/tests/zizmor.yml

Comment thread .github/workflows/vortex-test-docs.yml
@github-actions

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6a6c6ba072919006761e7a76--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Jul 31, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit 9a88831 into main Jul 31, 2026
34 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/docs-trigger-cli branch July 31, 2026 09:39
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs review Pull request needs a review from assigned developers

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

1 participant