Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,27 +449,6 @@ jobs:
DREVOPS_EXPORT_CODE_DIR: '/tmp/workspace/code_unused'
<<: *job-build

# Deploy primary branches.
deploy: &job_deploy
<<: *runner_config
steps:
- attach_workspace:
at: /tmp/workspace
- add_ssh_keys:
fingerprints:
- *deploy_ssh_fingerprint
- checkout
- *step_process_codebase
- run:
command: |
DREVOPS_DEPLOY_BRANCH="$CIRCLE_BRANCH" \
DREVOPS_DEPLOY_PR="$(echo $CIRCLE_PULL_REQUEST | cut -d'/' -f 7)" \
DREVOPS_DEPLOY_PR_HEAD=$CIRCLE_SHA1 \
./scripts/drevops/deploy.sh
no_output_timeout: 30m
- store_artifacts:
path: *artifacts

# Deploy artifact.
deploy_artifact:
<<: *runner_config
Expand Down
3 changes: 3 additions & 0 deletions .docker/cli.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ RUN cd /app/web/themes/contrib/civictheme \
RUN npm --prefix web/themes/custom/civictheme_demo install --no-audit --no-progress --unsafe-perm \
&& cd /app/web/themes/custom/civictheme_demo && npm run build
COPY .docker/entrypoints/cli/* /quant-entrypoint.d/

# Custom PHP configuration.
COPY .docker/config/php/*.ini /usr/local/etc/php/conf.d/
2 changes: 2 additions & 0 deletions .docker/config/php/zzz-memory.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
; Custom PHP memory limit
memory_limit = 768M
40 changes: 0 additions & 40 deletions .docker/entrypoints/cli/03-provision-site.sh

This file was deleted.

25 changes: 25 additions & 0 deletions .docker/entrypoints/cli/04-provision-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
set -e

# Post-rollout task: Provision site
# Generated from .lagoon.yml

if [ "$LAGOON_ENVIRONMENT_TYPE" = "production" ] || [ "$LAGOON_GIT_BRANCH" = "${DREVOPS_LAGOON_PRODUCTION_BRANCH:-main}" ]; then
echo "==> Running in PRODUCTION environment."
# Never unblock admin user in production.
export DRUPAL_UNBLOCK_ADMIN=0
# Never sanitize DB in production.
export DREVOPS_PROVISION_SANITIZE_DB_SKIP=1
fi
#
# Deployments from UI are not able to bypass the value of
# DREVOPS_PROVISION_OVERRIDE_DB set by the deploy-lagoon.sh
# during previous deployments (it sets value to '0' to mitigate Lagoon bug
# where environment variables cannot be deleted and have to be set to a value).
# @see https://github.com/uselagoon/lagoon/issues/1922
# Explicitly set DB overwrite flag to the value from .env file for
# deployments from the profile.
if [ "${DREVOPS_PROVISION_USE_PROFILE}" = "1" ]; then
export DREVOPS_PROVISION_OVERRIDE_DB="$(cat .env | grep ^DREVOPS_PROVISION_OVERRIDE_DB | cut -c31-)"
fi
./scripts/drevops/provision.sh
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ LAGOON_PROJECT=civictheme-monorepo-drupal
# `artifact`,`docker`, `webhook`, `lagoon`.
#
# See https://docs.drevops.com/workflows/deploy
DREVOPS_DEPLOY_TYPES=lagoon
DREVOPS_DEPLOY_TYPES=none
Copy link
Contributor

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:

#!/bin/bash
# First, let's see the full context of the .env file around line 127
echo "=== .env file context around line 127 ==="
sed -n '120,134p' .env

echo -e "\n=== Check if .env.local exists ==="
if [ -f .env.local ]; then
  echo ".env.local exists, showing content:"
  cat .env.local
else
  echo ".env.local does not exist"
fi

echo -e "\n=== Search for DREVOPS_DEPLOY_TYPES in codebase ==="
rg -n "DREVOPS_DEPLOY_TYPES" --type-list | head -5

echo -e "\n=== Find files that reference DREVOPS_DEPLOY_TYPES ==="
rg -l "DREVOPS_DEPLOY_TYPES"

Repository: civictheme/monorepo-drupal

Length of output: 1219


🏁 Script executed:

#!/bin/bash
# Examine the deploy.sh script that uses DREVOPS_DEPLOY_TYPES
echo "=== Content of scripts/drevops/deploy.sh ==="
wc -l scripts/drevops/deploy.sh

echo -e "\n=== First 100 lines of deploy.sh ==="
head -100 scripts/drevops/deploy.sh

echo -e "\n=== Search for DREVOPS_DEPLOY_TYPES usage in deploy.sh ==="
rg -n "DREVOPS_DEPLOY_TYPES" scripts/drevops/deploy.sh -A 5 -B 5

echo -e "\n=== Search for 'none' in deploy.sh ==="
rg -n "none" scripts/drevops/deploy.sh | head -20

Repository: civictheme/monorepo-drupal

Length of output: 7630


🏁 Script executed:

#!/bin/bash
# Check git history for changes to DREVOPS_DEPLOY_TYPES
echo "=== Git log for .env changes ==="
git log --oneline -n 20 -- .env

echo -e "\n=== Git show most recent .env change ==="
git show HEAD:.env | sed -n '120,134p'

echo -e "\n=== Git diff for .env in current PR/branch ==="
git diff HEAD~1 .env 2>/dev/null | head -50 || echo "Cannot get diff (single commit or no previous version)"

echo -e "\n=== Check current branch ==="
git rev-parse --abbrev-ref HEAD

echo -e "\n=== Search for any documentation about deploy types ==="
find . -type f \( -name "*.md" -o -name "*.txt" \) -exec grep -l "DREVOPS_DEPLOY_TYPES" {} \; 2>/dev/null | head -10

Repository: civictheme/monorepo-drupal

Length of output: 824


🏁 Script executed:

#!/bin/bash
# Check for CI/CD configuration files
echo "=== Look for CI/CD configuration files ==="
find . -maxdepth 2 -type f \( -name ".github" -o -name ".gitlab-ci*" -o -name ".circleci*" -o -name "*.yml" -o -name "*.yaml" \) 2>/dev/null | head -20

echo -e "\n=== Check for GitHub workflows ==="
find . -path "*/.github/workflows/*" -type f 2>/dev/null | head -10

echo -e "\n=== Look for any references to deployment strategy in commit ==="
git show 3020b9e3 --stat 2>/dev/null | head -30

echo -e "\n=== Get full commit message for context ==="
git log -1 --format="%B" 3020b9e3 2>/dev/null

echo -e "\n=== Check if there are alternative deploy scripts ==="
ls -la scripts/drevops/deploy*.sh 2>/dev/null || echo "No deploy scripts found"

echo -e "\n=== Search for references to 'quant' deployment ==="
rg -i "quant.*deploy" --type sh | head -20

Repository: civictheme/monorepo-drupal

Length of output: 2857


🏁 Script executed:

#!/bin/bash
# Check what the script does when DREVOPS_DEPLOY_PROCEED is not set
echo "=== Look for DREVOPS_DEPLOY_PROCEED usage ==="
rg -n "DREVOPS_DEPLOY_PROCEED" scripts/drevops/deploy.sh -B 3 -A 3

echo -e "\n=== Check if there's any README about deployment configuration ==="
find . -name "README*" -o -name "DEPLOY*" 2>/dev/null | xargs grep -l "DREVOPS_DEPLOY" 2>/dev/null | head -5

echo -e "\n=== Look at deploy.sh comments about valid values ==="
sed -n '20,30p' scripts/drevops/deploy.sh

echo -e "\n=== Check .env comments for deploy-related variables ==="
grep -n "DREVOPS_DEPLOY" .env | head -15

Repository: civictheme/monorepo-drupal

Length of output: 1900


Now I have enough information to provide a comprehensive rewritten review comment. The original concern is substantively correct—this does disable all deployments—but the issue is more nuanced. The change appears intentional based on the commit message, but it uses an undocumented workaround instead of the proper mechanism.

Document the "none" deployment type and clarify the deployment strategy.

The value DREVOPS_DEPLOY_TYPES=none disables all deployments, but this value is not documented as valid in the script comments (which list only: artifact, docker, webhook, lagoon). While the commit "Remove lagoon deploy type" confirms this is intentional, using none is a workaround that bypasses the validation.

The deploy script has a proper failsafe mechanism: DREVOPS_DEPLOY_PROCEED=0 (documented as "a failsafe to prevent any deployments"). Consider using that instead, or:

  1. Update scripts/drevops/deploy.sh to document none as a valid value in the comments (lines 23-25).
  2. Update .env to document that none disables all deployments, or use DREVOPS_DEPLOY_PROCEED=0 as the mechanism.
  3. Clarify the deployment strategy: The PR mentions updating provisioning for "quant" deploys, but doesn't explain how sites will be deployed if all deployment types are disabled. Document whether this is permanent or environment-specific (e.g., development-only).
🤖 Prompt for AI Agents
.env around line 127: the entry DREVOPS_DEPLOY_TYPES=none disables all
deployments but is undocumented and bypasses the deploy script's intended
failsafe; either document "none" as a valid deploy type in
scripts/drevops/deploy.sh comments (update lines ~23-25 to include "none") and
add a comment in .env explaining that "none" disables all deployments and
whether this is environment-specific, or revert to the intended failsafe by
setting DREVOPS_DEPLOY_PROCEED=0 in .env; also update README/PR text to clarify
the deployment strategy (how/when "quant" sites will be deployed) and whether
this is a permanent or dev-only setting.


# Dedicated branch to identify the production environment.
DREVOPS_LAGOON_PRODUCTION_BRANCH=main
Expand Down
46 changes: 11 additions & 35 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ name: Build and Push civictheme-monorepo-drupal to Quant Cloud
- release/*
- hotfix/*
- feature/editorial-*
- project/quant-provision
tags:
- '*'

Expand Down Expand Up @@ -37,28 +38,18 @@ jobs:
quant_application: civictheme-monorepo-drupal
master_branch_override: main

- name: Override outputs for quant-cloud-migration branch
- name: Override outputs for special branches
id: override-outputs
run: |-
# Override outputs for quant-cloud-migration branch to treat it as production
if [[ "${{ github.ref }}" == "refs/heads/quant-cloud-migration" ]]; then
echo "image_suffix=-latest" >> $GITHUB_OUTPUT
echo "image_suffix_clean=latest" >> $GITHUB_OUTPUT
echo "is_production=true" >> $GITHUB_OUTPUT
echo "environment_name=production" >> $GITHUB_OUTPUT
echo "environment_exists=true" >> $GITHUB_OUTPUT
echo "Overriding outputs for quant-cloud-migration branch: using -latest suffix and production environment"
else
# Use the original action outputs
echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT
# Remove leading hyphen from image_suffix for image_suffix parameter
suffix="${{ steps.init.outputs.image_suffix }}"
clean_suffix="${suffix#-}"
echo "image_suffix_clean=$clean_suffix" >> $GITHUB_OUTPUT
echo "is_production=${{ steps.init.outputs.is_production }}" >> $GITHUB_OUTPUT
echo "environment_name=${{ steps.init.outputs.environment_name }}" >> $GITHUB_OUTPUT
echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT
fi
echo "image_suffix=${{ steps.init.outputs.image_suffix }}" >> $GITHUB_OUTPUT
# Remove leading hyphen from image_suffix for image_suffix parameter
suffix="${{ steps.init.outputs.image_suffix }}"
clean_suffix="${suffix#-}"
echo "image_suffix_clean=$clean_suffix" >> $GITHUB_OUTPUT
echo "is_production=${{ steps.init.outputs.is_production }}" >> $GITHUB_OUTPUT
echo "environment_name=${{ steps.init.outputs.environment_name }}" >> $GITHUB_OUTPUT
echo "environment_exists=${{ steps.init.outputs.environment_exists }}" >> $GITHUB_OUTPUT


- name: Build and push cli image
uses: docker/build-push-action@v5
Expand Down Expand Up @@ -119,21 +110,6 @@ jobs:
from_environment: production
image_suffix: ${{ steps.override-outputs.outputs.image_suffix_clean }}

- name: Sync database from production to new environment
if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'false' && steps.override-outputs.outputs.environment_name
!= 'production' }}
uses: quantcdn/[email protected]
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: ${{ secrets.QUANT_ORGANIZATION }}
app_name: ${{ steps.init.outputs.quant_application }}
environment_name: ${{ steps.override-outputs.outputs.environment_name }}
source: production
type: database
wait: true
wait_interval: 10
max_retries: 30

- name: Redeploy existing environment
if: ${{ !startsWith(github.ref, 'refs/tags/') && steps.override-outputs.outputs.environment_exists == 'true' }}
uses: quantcdn/quant-cloud-environment-state-action@v1
Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@
"drupal/sdc_devel": {
"Change visibility of the rules constants in TwigValidatorRulePluginBase - https://www.drupal.org/project/sdc_devel/issues/3517321": "./patches/modules/sdc_devel/3517321--updated-visibility-of-rule-constants.patch",
"Remove check for use of default filter in boolean filter": "./patches/modules/sdc_devel/remove-boolean-filter-default.patch"
},
"drupal/simple_sitemap": {
"Error on installing / enabling simple_sitemap in D11: https://www.drupal.org/project/simple_sitemap/issues/3507718": "./patches/modules/simple_sitemap/fix-error-on-install.patch"
}
},
"preserve-paths": [
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading