Skip to content

Allow to deploy manually.#156

Closed
AlexSkrypnyk wants to merge 7 commits intodevelopfrom
feature/manual-deploy
Closed

Allow to deploy manually.#156
AlexSkrypnyk wants to merge 7 commits intodevelopfrom
feature/manual-deploy

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Mar 19, 2026

Checklist before requesting a review

  • Subject includes ticket number as [#123] Verb in past tense.
  • Ticket number #123 added to description
  • Added context in Changed section
  • Self-reviewed code and commented in commented complex areas.
  • Added tests for fix/feature.
  • Relevant tests run and passed locally.

Changed

Screenshots

Summary by CodeRabbit

  • Chores
    • Added manual dispatch inputs for CI: deploy_target (string) and override_db (boolean); deploy runs can be targeted or overridden.
    • CI now skips lint/database/build when deploy_target is set; deploy resolves branch/PR info for targeted runs and restricts artifact unpack to non-targeted runs.
    • Updated CI runner image and added PHPMD plus Vortex markers; extended DB download/provisioning (including a second migration DB).
    • Coverage reporting now posts a thresholded summary with collapsible per-class details; deploy sets VORTEX_DEPLOY_ACTION when overriding DB.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

Adds manual workflow_dispatch inputs deploy_target and override_db; gates lint/database/build when deploy_target is set and enables deploy for dispatch runs. Adds Acquia DB download support, PHPMD linting, changed PHPUnit coverage payload, and runner image bumps to drevops/ci-runner:26.3.0.

Changes

Cohort / File(s) Summary
Workflow configuration
.github/workflows/build-test-deploy.yml
Added workflow_dispatch inputs (deploy_target, override_db); updated job if conditions to skip lint/database/build when deploy_target is provided and allow deploy on dispatch; bumped drevops/ci-runner to 26.3.0; added Acquia creds env vars and second DB download step; build provisioning copies optional secondary SQL (db2.sql); added PHPMD and Vortex markers around lint steps; replaced COVERAGE_CONTENT with COVERAGE_SUMMARY/COVERAGE_DETAILS and updated PR comment; added deploy-target resolution (uses gh for PR metadata when PR-<num>), prefer resolved DEPLOY_BRANCH for checkout, restrict artifact unpack to non-dispatch runs, and set VORTEX_DEPLOY_ACTION=deploy_override_db when override_db is true.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant GH_Actions as GitHub Actions
  participant GH_CLI as gh
  participant Acquia
  participant Runner

  User->>GH_Actions: workflow_dispatch(deploy_target?, override_db?)
  GH_Actions->>GH_Actions: resolve deploy target (if provided)
  alt deploy_target matches PR-*
    GH_Actions->>GH_CLI: fetch PR number, head SHA/branch
    GH_CLI-->>GH_Actions: PR metadata
  end
  GH_Actions->>Runner: start jobs (lint/database/build) if deploy_target empty
  alt database job runs
    Runner->>Acquia: attempt DB download using VORTEX_ACQUIA_KEY/SECRET (optional)
    Acquia-->>Runner: DB artifact
  end
  Runner->>Runner: build provisioning (may copy .data/${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql})
  alt deploy job
    GH_Actions->>Runner: set VORTEX_DEPLOY_ACTION (deploy_override_db if override_db)
    Runner->>Runner: checkout DEPLOY_BRANCH, run deploy script
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 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 'Allow to deploy manually.' is directly related to the main change—enabling manual deployment via workflow_dispatch inputs and supporting manual deploy resolution logic.
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
  • Commit unit tests in branch feature/manual-deploy
📝 Coding Plan
  • Generate coding plan for human review comments

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

@github-actions

This comment has been minimized.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/build-test-deploy.yml (1)

565-577: ⚠️ Potential issue | 🟠 Major

Pin PR deploys to the resolved head SHA.

Resolve deploy target records DEPLOY_PR_HEAD_SHA, but checkout uses the mutable branch name. A push between those steps can deploy a different revision than the workflow metadata reports.

🐛 Suggested fix
-          ref: ${{ env.DEPLOY_BRANCH || github.head_ref || github.ref_name }}
+          ref: ${{ env.DEPLOY_PR_HEAD_SHA || env.DEPLOY_BRANCH || github.head_ref || github.ref_name }}
🤖 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 565 - 577, The workflow
records DEPLOY_PR_HEAD_SHA but still checks out by branch name, so a concurrent
push can change the branch between resolution and checkout; update the Checkout
step (actions/checkout usage) to prefer the pinned commit by using env
DEPLOY_PR_HEAD_SHA as the ref when present (falling back to DEPLOY_BRANCH ||
github.head_ref || github.ref_name) so the job always checks out the exact
resolved head SHA.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 588-595: The workflow allows a manual deploy (inputs.deploy_target
set) while VORTEX_DEPLOY_TYPES contains "artifact", which leads to
VORTEX_DEPLOY_ARTIFACT_SRC pointing to a non-existent /tmp/workspace/code; add
an explicit guard that rejects this unsupported configuration by adding a
workflow step before the Deploy step (or adding an if on the Deploy step) that
checks both inputs.deploy_target and whether env.VORTEX_DEPLOY_TYPES contains
"artifact" and fails early with a clear error (exit non-zero) if both are true;
reference the variables VORTEX_DEPLOY_TYPES, inputs.deploy_target and
VORTEX_DEPLOY_ARTIFACT_SRC and ensure the message explains that manual deploys
with artifact type are unsupported.
- Line 78: The deploy job is being skipped when lint/build are skipped because
its needs: [build, lint] creates an implicit success() gate; update the deploy
job (deploy) to use always() in its if expression so it will run even when
dependencies were skipped, and then combine always() with the existing condition
that checks inputs.deploy_target and the push/branch logic (i.e. change the
deploy job's if to start with always() && (your current condition OR
inputs.deploy_target) ), leaving needs: [build, lint] in place so
artifacts/outputs remain available when present but not blocking manual deploys.

---

Outside diff comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 565-577: The workflow records DEPLOY_PR_HEAD_SHA but still checks
out by branch name, so a concurrent push can change the branch between
resolution and checkout; update the Checkout step (actions/checkout usage) to
prefer the pinned commit by using env DEPLOY_PR_HEAD_SHA as the ref when present
(falling back to DEPLOY_BRANCH || github.head_ref || github.ref_name) so the job
always checks out the exact resolved head SHA.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 416e6b8c-3872-4d62-9a6f-4516f4b4676a

📥 Commits

Reviewing files that changed from the base of the PR and between 8a46f3d and 217b7d7.

📒 Files selected for processing (1)
  • .github/workflows/build-test-deploy.yml

runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }}
#;< !PROVISION_TYPE_PROFILE
if: ${{ !inputs.deploy_target && github.event_name != 'schedule' && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')) }}
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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/build-test-deploy.yml | sed -n '70,90p'

Repository: drevops/website

Length of output: 1020


🏁 Script executed:

cat -n .github/workflows/build-test-deploy.yml | sed -n '300,315p'

Repository: drevops/website

Length of output: 879


🏁 Script executed:

cat -n .github/workflows/build-test-deploy.yml | sed -n '530,550p'

Repository: drevops/website

Length of output: 1088


🌐 Web query:

GitHub Actions job needs dependency skipped if condition semantics

💡 Result:

In GitHub Actions, a job that declares needs: is implicitly gated by if: success(). So if any job in its dependency chain is skipped (or fails/cancels), downstream jobs are skipped by default (“a failure or skip applies to all jobs in the dependency chain…”). [1]

To override that default and decide yourself, put always() in the dependent job’s if: (this removes the implicit success() gate), then check dependency results via needs.<job_id>.result (values: success, failure, cancelled, skipped). [1][2]

Example: run deploy even if build was skipped, but not if it failed/cancelled:

jobs:
  build:
    if: ${{ github.ref == 'refs/heads/main' }}   # may be skipped

  deploy:
    needs: build
    if: ${{ always() && (needs.build.result == 'success' || needs.build.result == 'skipped') }}
    runs-on: ubuntu-latest
    steps:
      - run: echo "deploying..."

If you only write if: needs.build.result == 'skipped' without always(), deploy will still be skipped, because the implicit success() gate prevents the job from running/evaluating as you expect when a dependency is skipped. [1][3]

Sources: GitHub Docs on dependency-chain skip behavior and using always() [1], and on needs.<job_id>.result values [2], plus GitHub Community discussion of success() being false when dependencies are skipped [3].

[1] (docs.github.com)
[2] (docs.github.com)
[3] (github.com)

Citations:


🏁 Script executed:

cat -n .github/workflows/build-test-deploy.yml | sed -n '546,565p'

Repository: drevops/website

Length of output: 1081


Manual deploy_target runs are blocked by the implicit success gate on job dependencies.

When inputs.deploy_target is set, the lint and build jobs are skipped by their if conditions (lines 78 and 313). However, the deploy job declares needs: [build, lint] without always(), which adds an implicit if: success() gate to the entire dependency chain. GitHub Actions will skip the deploy job when its dependencies are skipped, regardless of the explicit if condition on line 551 evaluating to true.

Use always() to remove the implicit success gate and explicitly check dependency results only for the normal (non-manual) deployment path:

Suggested fix
   deploy:
     runs-on: ubuntu-latest
     needs: [build, lint]
-    if: ${{ !cancelled() && (inputs.deploy_target || (github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }}
+    if: ${{ always() && (inputs.deploy_target || (needs.build.result == 'success' && needs.lint.result == 'success' && github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build-test-deploy.yml at line 78, The deploy job is being
skipped when lint/build are skipped because its needs: [build, lint] creates an
implicit success() gate; update the deploy job (deploy) to use always() in its
if expression so it will run even when dependencies were skipped, and then
combine always() with the existing condition that checks inputs.deploy_target
and the push/branch logic (i.e. change the deploy job's if to start with
always() && (your current condition OR inputs.deploy_target) ), leaving needs:
[build, lint] in place so artifacts/outputs remain available when present but
not blocking manual deploys.

Comment on lines +588 to 595
if: ${{ !inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }}
with:
name: code-artifact
path: "/tmp/artifacts"

- name: Unpack downloaded exported codebase
if: ${{ contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }}
if: ${{ !inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }}
run: |
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 get the size and read the workflow file
wc -l .github/workflows/build-test-deploy.yml

Repository: drevops/website

Length of output: 102


🏁 Script executed:

# Read the relevant sections around lines 588-595 and 615
sed -n '580,630p' .github/workflows/build-test-deploy.yml

Repository: drevops/website

Length of output: 2690


🏁 Script executed:

# Search for VORTEX_DEPLOY_ARTIFACT_SRC and VORTEX_DEPLOY_TYPES to understand the flow
rg "VORTEX_DEPLOY_ARTIFACT_SRC|VORTEX_DEPLOY_TYPES" .github/workflows/build-test-deploy.yml -n

Repository: drevops/website

Length of output: 614


🏁 Script executed:

# Also search for where deploy_target is used and how it affects artifact handling
rg "inputs.deploy_target" .github/workflows/build-test-deploy.yml -B 2 -A 2 -n

Repository: drevops/website

Length of output: 1845


🏁 Script executed:

sed -n '610,620p' .github/workflows/build-test-deploy.yml

Repository: drevops/website

Length of output: 524


🏁 Script executed:

# Let's also check if there's any other artifact download/unpack step or similar condition
rg "Download|Unpack|artifact" .github/workflows/build-test-deploy.yml -n

Repository: drevops/website

Length of output: 1594


🏁 Script executed:

sed -n '615,615p' .github/workflows/build-test-deploy.yml

Repository: drevops/website

Length of output: 93


🏁 Script executed:

# Also check the context around it
sed -n '620,635p' .github/workflows/build-test-deploy.yml

Repository: drevops/website

Length of output: 1246


Reject manual artifact deployments to prevent failures.

The download and unpack steps skip when inputs.deploy_target is set, but the Deploy step always sets VORTEX_DEPLOY_ARTIFACT_SRC to /tmp/workspace/code. When artifact is in VORTEX_DEPLOY_TYPES, this causes the deploy to fail because the artifact directory doesn't exist. Since the build job is skipped for manual deploys, the artifact is never created.

Add a guard to explicitly reject this unsupported configuration:

Suggested guard
      - name: Load environment variables from .env
        run: t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && set +a && . "${t}" && env >> "$GITHUB_ENV"
+
+      - name: Reject manual artifact deploys until artifact preparation exists
+        if: ${{ inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }}
+        run: |
+          echo "Manual deploys are not supported for artifact deployments because the build job is skipped."
+          exit 1
🤖 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 588 - 595, The workflow
allows a manual deploy (inputs.deploy_target set) while VORTEX_DEPLOY_TYPES
contains "artifact", which leads to VORTEX_DEPLOY_ARTIFACT_SRC pointing to a
non-existent /tmp/workspace/code; add an explicit guard that rejects this
unsupported configuration by adding a workflow step before the Deploy step (or
adding an if on the Deploy step) that checks both inputs.deploy_target and
whether env.VORTEX_DEPLOY_TYPES contains "artifact" and fails early with a clear
error (exit non-zero) if both are true; reference the variables
VORTEX_DEPLOY_TYPES, inputs.deploy_target and VORTEX_DEPLOY_ARTIFACT_SRC and
ensure the message explains that manual deploys with artifact type are
unsupported.

@github-actions

This comment has been minimized.

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

♻️ Duplicate comments (2)
.github/workflows/build-test-deploy.yml (2)

593-605: ⚠️ Potential issue | 🟠 Major

Add guard to reject manual artifact deployments.

The comment on line 596 acknowledges artifact deployments don't work for manual deploys, but there's no enforcement. If VORTEX_DEPLOY_TYPES contains artifact, the deploy script will attempt to use /tmp/workspace/code which won't exist, causing a cryptic failure.

Add an explicit guard to fail early with a clear message:

Suggested fix
       - name: Load environment variables from .env
         run: t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && set +a && . "${t}" && env >> "$GITHUB_ENV"
 
+      - name: Reject manual artifact deploys
+        if: ${{ inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }}
+        run: |
+          echo "::error::Manual deploys are not supported when VORTEX_DEPLOY_TYPES contains 'artifact' (build job is skipped, no artifact available)."
+          exit 1
+
       # Artifact deployments do not work for manual deploys as the build job is skipped.
       - name: Download exported codebase as an artifact

,

🤖 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 593 - 605, Add an
explicit failing step that triggers when a manual deploy is requested but
VORTEX_DEPLOY_TYPES contains "artifact": create a job step (e.g., name "Reject
manual artifact deployments") with an if: condition like ${{
inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact') }} and
have it print a clear message and exit non‑zero (e.g., echo "Manual deploys
cannot use artifact deploy type; set VORTEX_DEPLOY_TYPES appropriately or remove
inputs.deploy_target" && exit 1). Place this before the "Download exported
codebase as an artifact" / "Unpack downloaded exported codebase" steps so the
workflow fails fast when inputs.deploy_target and env.VORTEX_DEPLOY_TYPES
include "artifact".

549-552: ⚠️ Potential issue | 🔴 Critical

Manual deploy_target runs will still be blocked by implicit success gate.

The condition uses !cancelled() but this does not override the implicit success() gate on job dependencies. When inputs.deploy_target is set, lint and build are skipped (lines 78, 313), and GitHub Actions will skip deploy because its needs: [build, lint] dependencies were skipped—regardless of the if condition evaluating to true.

Replace !cancelled() with always() and explicitly check dependency results for the non-manual path:

Suggested fix
   deploy:
     runs-on: ubuntu-latest
     needs: [build, lint]
     #;< !PROVISION_TYPE_PROFILE
-    if: ${{ !cancelled() && (inputs.deploy_target || (github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }}
+    if: ${{ always() && (inputs.deploy_target || (needs.build.result == 'success' && needs.lint.result == 'success' && github.event_name != 'schedule' && !startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name == 'push' || !startsWith(github.head_ref, 'project/')))) }}
     #;> !PROVISION_TYPE_PROFILE

,

🤖 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 549 - 552, The deploy
job's if condition needs to allow manual runs to bypass skipped dependencies:
replace the leading !cancelled() with always() and restructure the boolean so
manual runs short-circuit while the normal path explicitly checks dependency
results; e.g. change the condition on the deploy job (the block containing
needs: [build, lint] and the long if expression) to use always() &&
(inputs.deploy_target || (needs.build.result == 'success' && needs.lint.result
== 'success' && github.event_name != 'schedule' && !startsWith(github.head_ref
|| github.ref_name, 'deps/') && (github.event_name == 'push' ||
!startsWith(github.head_ref, 'project/')))).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 567-578: Validate DEPLOY_TARGET when it matches '^pr-' by
extracting the suffix and ensuring it's a numeric PR ID before calling gh; for
DEPLOY_PR_NUMBER extraction (DEPLOY_TARGET#*), check the regex and if not
numeric emit a clear error and exit non‑zero. For each gh pr view invocation
that sets DEPLOY_PR_HEAD_SHA and DEPLOY_BRANCH, capture the command exit status
and on failure log a descriptive message including DEPLOY_PR_NUMBER and fail the
step (or set safe defaults) instead of allowing silent failure; ensure all uses
of gh pr view are guarded so env vars are only written when the gh command
succeeds.

---

Duplicate comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 593-605: Add an explicit failing step that triggers when a manual
deploy is requested but VORTEX_DEPLOY_TYPES contains "artifact": create a job
step (e.g., name "Reject manual artifact deployments") with an if: condition
like ${{ inputs.deploy_target && contains(env.VORTEX_DEPLOY_TYPES, 'artifact')
}} and have it print a clear message and exit non‑zero (e.g., echo "Manual
deploys cannot use artifact deploy type; set VORTEX_DEPLOY_TYPES appropriately
or remove inputs.deploy_target" && exit 1). Place this before the "Download
exported codebase as an artifact" / "Unpack downloaded exported codebase" steps
so the workflow fails fast when inputs.deploy_target and env.VORTEX_DEPLOY_TYPES
include "artifact".
- Around line 549-552: The deploy job's if condition needs to allow manual runs
to bypass skipped dependencies: replace the leading !cancelled() with always()
and restructure the boolean so manual runs short-circuit while the normal path
explicitly checks dependency results; e.g. change the condition on the deploy
job (the block containing needs: [build, lint] and the long if expression) to
use always() && (inputs.deploy_target || (needs.build.result == 'success' &&
needs.lint.result == 'success' && github.event_name != 'schedule' &&
!startsWith(github.head_ref || github.ref_name, 'deps/') && (github.event_name
== 'push' || !startsWith(github.head_ref, 'project/')))).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e4524884-d301-4690-b0d2-68ef60357b17

📥 Commits

Reviewing files that changed from the base of the PR and between 217b7d7 and 0dd03d9.

📒 Files selected for processing (1)
  • .github/workflows/build-test-deploy.yml

Comment on lines +567 to +578
- name: Resolve deploy target
if: ${{ inputs.deploy_target }}
env:
DEPLOY_TARGET: ${{ inputs.deploy_target }}
GH_TOKEN: ${{ github.token }}
run: |
echo "DEPLOY_BRANCH=${DEPLOY_TARGET}" >> "$GITHUB_ENV"
if echo "${DEPLOY_TARGET}" | grep -iq '^pr-'; then
echo "DEPLOY_PR_NUMBER=${DEPLOY_TARGET#*-}" >> "$GITHUB_ENV"
echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
echo "DEPLOY_BRANCH=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add error handling for PR resolution.

If the PR number is invalid or the PR doesn't exist, gh pr view will fail silently (exit code captured but env vars won't be set correctly). Additionally, if someone passes pr-abc instead of pr-123, the behavior is undefined.

Consider adding validation and error handling:

Suggested improvement
       - name: Resolve deploy target
         if: ${{ inputs.deploy_target }}
         env:
           DEPLOY_TARGET: ${{ inputs.deploy_target }}
           GH_TOKEN: ${{ github.token }}
         run: |
           echo "DEPLOY_BRANCH=${DEPLOY_TARGET}" >> "$GITHUB_ENV"
           if echo "${DEPLOY_TARGET}" | grep -iq '^pr-'; then
-            echo "DEPLOY_PR_NUMBER=${DEPLOY_TARGET#*-}" >> "$GITHUB_ENV"
-            echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
-            echo "DEPLOY_BRANCH=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
+            PR_NUM="${DEPLOY_TARGET#*-}"
+            if ! [[ "${PR_NUM}" =~ ^[0-9]+$ ]]; then
+              echo "::error::Invalid PR number format: ${PR_NUM}. Expected 'pr-<number>'."
+              exit 1
+            fi
+            if ! gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json state --jq '.state' > /dev/null 2>&1; then
+              echo "::error::PR #${PR_NUM} not found or inaccessible."
+              exit 1
+            fi
+            echo "DEPLOY_PR_NUMBER=${PR_NUM}" >> "$GITHUB_ENV"
+            echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
+            echo "DEPLOY_BRANCH=$(gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
           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
- name: Resolve deploy target
if: ${{ inputs.deploy_target }}
env:
DEPLOY_TARGET: ${{ inputs.deploy_target }}
GH_TOKEN: ${{ github.token }}
run: |
echo "DEPLOY_BRANCH=${DEPLOY_TARGET}" >> "$GITHUB_ENV"
if echo "${DEPLOY_TARGET}" | grep -iq '^pr-'; then
echo "DEPLOY_PR_NUMBER=${DEPLOY_TARGET#*-}" >> "$GITHUB_ENV"
echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
echo "DEPLOY_BRANCH=$(gh pr view "${DEPLOY_TARGET#*-}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
fi
- name: Resolve deploy target
if: ${{ inputs.deploy_target }}
env:
DEPLOY_TARGET: ${{ inputs.deploy_target }}
GH_TOKEN: ${{ github.token }}
run: |
echo "DEPLOY_BRANCH=${DEPLOY_TARGET}" >> "$GITHUB_ENV"
if echo "${DEPLOY_TARGET}" | grep -iq '^pr-'; then
PR_NUM="${DEPLOY_TARGET#*-}"
if ! [[ "${PR_NUM}" =~ ^[0-9]+$ ]]; then
echo "::error::Invalid PR number format: ${PR_NUM}. Expected 'pr-<number>'."
exit 1
fi
if ! gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json state --jq '.state' > /dev/null 2>&1; then
echo "::error::PR #${PR_NUM} not found or inaccessible."
exit 1
fi
echo "DEPLOY_PR_NUMBER=${PR_NUM}" >> "$GITHUB_ENV"
echo "DEPLOY_PR_HEAD_SHA=$(gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')" >> "$GITHUB_ENV"
echo "DEPLOY_BRANCH=$(gh pr view "${PR_NUM}" --repo "${{ github.repository }}" --json headRefName --jq '.headRefName')" >> "$GITHUB_ENV"
fi
🤖 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 567 - 578, Validate
DEPLOY_TARGET when it matches '^pr-' by extracting the suffix and ensuring it's
a numeric PR ID before calling gh; for DEPLOY_PR_NUMBER extraction
(DEPLOY_TARGET#*), check the regex and if not numeric emit a clear error and
exit non‑zero. For each gh pr view invocation that sets DEPLOY_PR_HEAD_SHA and
DEPLOY_BRANCH, capture the command exit status and on failure log a descriptive
message including DEPLOY_PR_NUMBER and fail the step (or set safe defaults)
instead of allowing silent failure; ensure all uses of gh pr view are guarded so
env vars are only written when the gh command succeeds.

@AlexSkrypnyk AlexSkrypnyk temporarily deployed to PR-156 March 19, 2026 22:23 Inactive
@github-actions

This comment has been minimized.

4 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

Code coverage (threshold: 80%)

  Classes: 50.00% (5/10)
  Methods: 73.91% (17/23)
  Lines:   92.81% (310/334)
Per-class coverage
Drupal\do_feed\FeedUrlBuilder
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 18/ 18)
Drupal\do_feed\Form\FeedSettingsForm
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 15/ 15)
Drupal\do_feed\Hook\EntityDeleteHook
  Methods:  50.00% ( 1/ 2)   Lines:  92.31% ( 12/ 13)
Drupal\do_feed\Hook\EntityPresaveHook
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 54/ 54)
Drupal\do_feed\Hook\PreprocessParagraphHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 14/ 14)
Drupal\do_feed\Hook\PreprocessViewsViewRowRssHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
Drupal\do_feed\Hook\ViewsPreViewHook
  Methods:  50.00% ( 1/ 2)   Lines:  96.43% ( 27/ 28)

@AlexSkrypnyk AlexSkrypnyk temporarily deployed to PR-156 March 19, 2026 22:46 Inactive
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/build-test-deploy.yml (1)

575-588: ⚠️ Potential issue | 🟠 Major

Check out the resolved PR SHA, not the branch reference.

You resolve DEPLOY_PR_HEAD_SHA at line 576, but actions/checkout uses DEPLOY_BRANCH at line 588. If the PR branch receives a new push between these steps, checkout will pull a different commit than the one you resolved, causing the deployed code to diverge from VORTEX_DEPLOY_PR_HEAD that's passed to deploy.sh.

Suggested fix
       - name: Checkout code
         uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
         with:
          ref: ${{ env.DEPLOY_PR_HEAD_SHA || env.DEPLOY_BRANCH || github.head_ref || github.ref_name }}
🤖 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 575 - 588, The checkout
step currently uses DEPLOY_BRANCH which can drift; change it to explicitly
checkout the resolved PR commit by using DEPLOY_PR_HEAD_SHA (fallback to
github.head_ref or github.ref_name) as the ref for actions/checkout so the
workspace matches the exact commit stored in DEPLOY_PR_HEAD_SHA; update the
checkout `ref` to prefer env.DEPLOY_PR_HEAD_SHA (or equivalent variable) instead
of DEPLOY_BRANCH to guarantee the deployed code matches VORTEX_DEPLOY_PR_HEAD
passed to deploy.sh.
♻️ Duplicate comments (1)
.github/workflows/build-test-deploy.yml (1)

549-551: ⚠️ Potential issue | 🔴 Critical

Manual deploy_target runs are still blocked by needs.

This is the same blocker noted earlier: once inputs.deploy_target skips build and lint, the implicit success() gate from needs: [build, lint] keeps deploy skipped too.

🤖 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 549 - 551, The deploy
job is still blocked by needs: [build, lint] even for manual runs via
inputs.deploy_target; split into two jobs: keep the existing deploy job (retain
needs: [build, lint]) but change its if to require inputs.deploy_target to be
false (e.g. if: ${{ !inputs.deploy_target && <existing-expression> }}), and add
a new deploy_manual (or deploy_dispatch) job with no needs and if: ${{
inputs.deploy_target }} that performs the same deployment steps for manual runs;
reference inputs.deploy_target, the original deploy job name, and needs: [build,
lint] when implementing this split so manual triggers bypass the needs gate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 283-285: The migration DB download step that runs
"VORTEX_DB_INDEX=2 ./scripts/vortex/download-db.sh" should mirror the primary
download step by adding the same step-scoped Acquia credential environment
variables and a 30-minute timeout; update the "Download migration DB" step to
include the identical env entries used in the primary "Download DB" step (the
Acquia credentials) and add timeout: 30m so the invocation of
./scripts/vortex/download-db.sh with VORTEX_DB_INDEX=2 has the same credentials
and timeout behavior.

---

Outside diff comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 575-588: The checkout step currently uses DEPLOY_BRANCH which can
drift; change it to explicitly checkout the resolved PR commit by using
DEPLOY_PR_HEAD_SHA (fallback to github.head_ref or github.ref_name) as the ref
for actions/checkout so the workspace matches the exact commit stored in
DEPLOY_PR_HEAD_SHA; update the checkout `ref` to prefer env.DEPLOY_PR_HEAD_SHA
(or equivalent variable) instead of DEPLOY_BRANCH to guarantee the deployed code
matches VORTEX_DEPLOY_PR_HEAD passed to deploy.sh.

---

Duplicate comments:
In @.github/workflows/build-test-deploy.yml:
- Around line 549-551: The deploy job is still blocked by needs: [build, lint]
even for manual runs via inputs.deploy_target; split into two jobs: keep the
existing deploy job (retain needs: [build, lint]) but change its if to require
inputs.deploy_target to be false (e.g. if: ${{ !inputs.deploy_target &&
<existing-expression> }}), and add a new deploy_manual (or deploy_dispatch) job
with no needs and if: ${{ inputs.deploy_target }} that performs the same
deployment steps for manual runs; reference inputs.deploy_target, the original
deploy job name, and needs: [build, lint] when implementing this split so manual
triggers bypass the needs gate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5067211d-c443-4b57-9cda-0ac83b113511

📥 Commits

Reviewing files that changed from the base of the PR and between 0dd03d9 and 19d0295.

📒 Files selected for processing (1)
  • .github/workflows/build-test-deploy.yml

Comment on lines +283 to +285
- name: Download migration DB
run: VORTEX_DB_INDEX=2 ./scripts/vortex/download-db.sh
#;> MIGRATION
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:

cd /tmp && git ls-files .github/workflows/build-test-deploy.yml

Repository: drevops/website

Length of output: 129


🏁 Script executed:

sed -n '270,290p' .github/workflows/build-test-deploy.yml | cat -n

Repository: drevops/website

Length of output: 1042


🏁 Script executed:

find . -type f -name "download-db.sh" | head -5

Repository: drevops/website

Length of output: 90


🏁 Script executed:

cat ./scripts/vortex/download-db.sh | head -100

Repository: drevops/website

Length of output: 3897


🏁 Script executed:

grep -r "VORTEX_DOWNLOAD_DB.*_SOURCE" .github/workflows/ .env* 2>/dev/null | head -20

Repository: drevops/website

Length of output: 96


🏁 Script executed:

grep -r "VORTEX_DOWNLOAD_DB2_SOURCE\|VORTEX_DOWNLOAD_DB_SOURCE" . --include="*.md" --include="*.env*" --include="*.yml" 2>/dev/null | head -20

Repository: drevops/website

Length of output: 98


🏁 Script executed:

cat ./scripts/vortex/download-db-acquia.sh | head -80

Repository: drevops/website

Length of output: 3312


🏁 Script executed:

grep -r "VORTEX_DOWNLOAD_DB2_SOURCE\|VORTEX_DB2_" . --include="*.env*" --include="*.yml" 2>/dev/null

Repository: drevops/website

Length of output: 41


🏁 Script executed:

grep -r "VORTEX_DB_INDEX" .github/workflows/ 2>/dev/null

Repository: drevops/website

Length of output: 161


Mirror the primary DB download step's env and timeout.

This second download-db.sh invocation lacks the step-scoped Acquia credentials and the 30-minute timeout added above. Although the default source is lagoon, the migration step should maintain consistency with the primary download step and provide access to the same credentials in case the source is changed. Without the timeout, a hung download can consume the entire job timeout instead of failing fast.

Suggested fix
       - name: Download migration DB
         run: VORTEX_DB_INDEX=2 ./scripts/vortex/download-db.sh
+        timeout-minutes: 30
+        #;< DB_DOWNLOAD_SOURCE_ACQUIA
+        env:
+          VORTEX_ACQUIA_KEY: ${{ secrets.VORTEX_ACQUIA_KEY }}
+          VORTEX_ACQUIA_SECRET: ${{ secrets.VORTEX_ACQUIA_SECRET }}
+        #;> DB_DOWNLOAD_SOURCE_ACQUIA
🤖 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 283 - 285, The
migration DB download step that runs "VORTEX_DB_INDEX=2
./scripts/vortex/download-db.sh" should mirror the primary download step by
adding the same step-scoped Acquia credential environment variables and a
30-minute timeout; update the "Download migration DB" step to include the
identical env entries used in the primary "Download DB" step (the Acquia
credentials) and add timeout: 30m so the invocation of
./scripts/vortex/download-db.sh with VORTEX_DB_INDEX=2 has the same credentials
and timeout behavior.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.73%. Comparing base (8a46f3d) to head (19d0295).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #156   +/-   ##
========================================
  Coverage    87.73%   87.73%           
========================================
  Files           11       11           
  Lines          163      163           
========================================
  Hits           143      143           
  Misses          20       20           

☔ 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 deleted the feature/manual-deploy branch March 20, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants