|
| 1 | +# VPGE Drupal Site Update Process |
| 2 | + |
| 3 | +This document serves as a guide to updating VPGE site, blending practical steps with higher-level technical considerations. It aims to support SWS developers in managing upgrades across local, staging, and production environments while maintaining stability, test coverage, and developer clarity. |
| 4 | +## Purpose |
| 5 | + |
| 6 | +This document is a comprehensive guide for updating Drupal sites maintained by **VPGE**. It synthesizes hands-on update steps with technical and architectural recommendations to ensure each site upgrade—from local development through deployment—is stable, testable, and maintainable. |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## 1. Install the Site Locally |
| 11 | + |
| 12 | +### Steps |
| 13 | + |
| 14 | +- Clone the site repository. |
| 15 | +- Run `composer install`. |
| 16 | +- Import the database (from Acquia or backup). |
| 17 | +- Run database and config updates: |
| 18 | +``` |
| 19 | +drush updb -y |
| 20 | +drush cim -y |
| 21 | +``` |
| 22 | + |
| 23 | +## 2. Assess and Pull Downstream Changes |
| 24 | + |
| 25 | +> **VPGE** uses a downstream profile like stanford_profile, you’ll want to sync updates: |
| 26 | +
|
| 27 | +1. Remove the current profile directory: `rm -rf docroot/profiles/custom/vpge_profile` |
| 28 | +2. Clone and pull updates from the canonical profile: `git pull https://github.com/SU-SWS/stanford_profile.git 11.x -X ours --no-edit` |
| 29 | +3. Run `drush cim -y` to integrate any config changes from the updated profile. For **VPGE**, please make sure you have any config changes are duplicated and/or applied to the /config/split directory. . |
| 30 | +4. |
| 31 | + |
| 32 | +## 3. Update stanford_profile and dependencies |
| 33 | + |
| 34 | +In the project root composer.json, update the reference to stanford_profile to use the appropriate dev branch or 11.x-dev. |
| 35 | +1. Run `composer update -w` or `composer update su-sws/stanford_profile -W` to only update the profile. |
| 36 | +2. Add the dev version of the VPGE profile to the composer json in project route. |
| 37 | +2. Commit and push changes. Create a PR from this branch. |
| 38 | +3. Recommendation: Standardize branch naming conventions (e.g., update/drupal-11) and PR titles ([Update] Drupal 11 + Profile Changes) to improve clarity across teams. |
| 39 | + |
| 40 | +## 4. Audit VPGE Modules and Custom Code Updates Use Upgrade Status |
| 41 | +1. If not installed: `composer require drupal/upgrade_status --dev` |
| 42 | +2. Visit `/admin/reports/upgrade-status` to assess module readiness, deprecated code, and unsupported projects. |
| 43 | +3. Follow the steps to update custom VPGE code. |
| 44 | +4. Check for any outdated dependencies: `composer outdated' |
| 45 | +5. Review patch failures; use Composer’s output to remove fixed patches or address changes upstream. |
| 46 | +6. Use PHP Codesniffer to review custom theme, modules and PHP: |
| 47 | + |
| 48 | + phpcs --standard=Drupal,DrupalPractice path/to/custom/modules |
| 49 | + |
| 50 | + Or rely on Upgrade Status module’s deprecated code analysis. |
| 51 | + |
| 52 | + Stack-level tip: As part of long-term sustainability, encourage teams to phase out deprecated contrib modules and rely on upstream-supported alternatives. |
| 53 | +7. If any downstream updates necessitate updates to the theme, update npm. Review to see node --version needs updating. |
| 54 | + |
| 55 | +## 5. Push code to intiate a code review. |
| 56 | +Push, Review, and Test in CI/Remote |
| 57 | +Steps |
| 58 | + |
| 59 | +Commit your changes, including: |
| 60 | + |
| 61 | + Composer updates |
| 62 | + |
| 63 | + Config exports (drush cex -y) |
| 64 | + Test-related YAML updates |
| 65 | +Push to GitHub and open a PR for review. |
| 66 | + |
| 67 | +Use Acquia’s Dev/Stage for integration testing: |
| 68 | + |
| 69 | + Sync latest DB to dev environment |
| 70 | + |
| 71 | + Run visual regression tools like Backstop.js |
| 72 | +Ensure all tests pass before merging. |
| 73 | + |
| 74 | +Technical recommendation: Integrate Nightwatch tests or Cypress for critical path UX flows (e.g., login, form submission) and ensure they run pre-deploy. |
0 commit comments