-
Notifications
You must be signed in to change notification settings - Fork 1
Allow empty Alt text, config management init, & automated config imports #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Infi-Knight
wants to merge
10
commits into
main
Choose a base branch
from
ravi/intorg-70
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
12390c9
style(news): update profile layout to mobile-first column
Infi-Knight 27e46e2
bump stylesheet version
Infi-Knight bc6ef84
add config to vcs
Infi-Knight 787bcfd
Merge branch 'main' into ravi/intorg-70
Infi-Knight 3c66d3f
sync config with one on prod
Infi-Knight b525e80
update readmes
Infi-Knight 35a5d40
update readmes - remove ddev reference
Infi-Knight 9b45536
Automate config import
Infi-Knight 884320f
note about perf on config auto imports
Infi-Knight b330ea8
update local config path, add htaccess, update docs
Infi-Knight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Configuration Management Workflow | ||
|
|
||
| This project uses Drupal's configuration management system to track site settings (fields, content types, views, etc.) in code. The active configuration is stored in the `config/` directory at the project root. | ||
|
|
||
| ## Initial Setup: Syncing with Production (One-Time) | ||
|
|
||
| When initializing the configuration directory or when you suspect severe drift, it is best to start by exporting the current production configuration to ensure your local setup matches the live site. | ||
|
|
||
| ### 1. Export Config on Production Server | ||
| We use the `production-drush.sh` convenience script. We export to `/tmp` to avoid permission issues with the `deployer` vs `www-data` users. | ||
|
|
||
| ```bash | ||
| ssh deployer@IP | ||
|
|
||
| # 1. Create a temp directory | ||
| mkdir -p /tmp/prod-config-export | ||
|
|
||
| # 2. Make it writable by everyone (solves www-data write permission isssues) | ||
| chmod 777 /tmp/prod-config-export | ||
|
|
||
| # 3. Running the export | ||
| ~/production-drush.sh config:export --destination=/tmp/prod-config-export -y | ||
| ``` | ||
|
|
||
| ### 2. Download to Local Machine | ||
| From your local machine (not inside the SSH session), download the files using `scp`. | ||
|
|
||
| ```bash | ||
| # Navigate to project root | ||
| cd /path/to/interledger.org-v4 | ||
|
|
||
| # Secure copy from the temp folder on the server | ||
| scp -r deployer@34.23.109.31:/tmp/prod-config-export/ . | ||
| ``` | ||
|
|
||
| ### 3. Establish Baseline | ||
| Copy these files into your version-controlled config directory. | ||
|
|
||
| ```bash | ||
| # Clean existing config to avoid stale files | ||
| rm -rf config/* | ||
|
|
||
| # Copy production files | ||
| cp -r prod-config-export/* config/ | ||
| ``` | ||
|
|
||
| ### 4. Apply Local Changes | ||
| Once you have the production baseline, re-apply your specific changes locally. | ||
|
|
||
| ```bash | ||
| # Example: Disable alt text requirement | ||
| drush config:set field.field.media.image.field_media_image settings.alt_field_required 0 -y | ||
|
|
||
| # Export just the changes (will modify only the relevant files) | ||
| drush config:export --destination=/var/www/html/config -y | ||
| ``` | ||
|
|
||
| ## Routine Workflow | ||
|
|
||
| For regular updates: | ||
|
|
||
| > [!NOTE] | ||
| > Ensure your local environment is configured to use the root `config/` directory. | ||
| > - **DDEV**: Handled automatically via `settings.php`. | ||
| > - **Custom Docker (`local/`)**: Ensure `local/docker-compose.yaml` mounts `../config` and `local/settings.php` points to `/var/www/html/config`. | ||
|
|
||
| 1. **Make changes locally**: | ||
| - **Option A (Drupal Admin UI)**: Log in to your local site (e.g., `ddev login`), navigate to the configuration page (e.g., *Structure > Content types*), and make your changes. Save the form. | ||
| - **Option B (DDEV + Drush)**: Run `ddev drush config:set ...` commands. | ||
| - **Option C (Custom Docker + Drush)**: Run `make drush config:set ...` from the `local/` directory. If running manually inside the container, use `./vendor/bin/drush` from the project root (`/var/www/html`). | ||
| 2. Run `drush config:export --destination=/var/www/html/config -y`. | ||
| 3. Commit the changed YAML files to git. | ||
| 4. Deploy to Staging/Production. | ||
| 5. **Deployment:** The deployment process (via GitHub Actions or `make deploy`) now **automatically** runs: | ||
| - `drush config:import -y` (Configuration import) | ||
| - `drush cr` (Cache rebuild) | ||
|
|
||
| 6. **Verify:** Check the changes on the site. | ||
|
|
||
| > [!NOTE] | ||
| > If you need to debug or run it manually: | ||
| > ```bash | ||
| > ssh deployer@34.23.109.31 | ||
| > ~/staging-drush.sh config:import -y | ||
| > ``` | ||
|
|
||
| ## Merging & Consolidating Changes | ||
|
|
||
| If you are working on a separate feature and want to incorporate these configuration changes, the procedure is standard Git merging for YAML files. | ||
|
|
||
| ### Steps to consolidate: | ||
| 1. **Export your current local configuration**: | ||
| - **Inside container**: `./vendor/bin/drush config:export --destination=/var/www/html/config -y` | ||
| - **Outside container**: `make drush config:export -y` (from the `local/` directory) | ||
| 2. **Pull/Merge this branch**: | ||
| ```bash | ||
| git pull origin <this-feature-branch> | ||
| ``` | ||
| - Git will merge the YAML files in the `config/` directory. | ||
| 3. **Import the merged configuration**: | ||
| - **Inside container**: `./vendor/bin/drush config:import -y` | ||
| - **Outside container**: `make drush config:import -y` | ||
|
|
||
| > [!IMPORTANT] | ||
| > Since the `config/` directory is now at the project root, it is tracked by Git. Previously, it was buried in `web/sites/default/files/` which was ignored by `.gitignore`. This move is what allows you and the team to finally share and version-control configuration correctly. | ||
|
|
||
| ## Performance Considerations & Future Improvements | ||
|
|
||
| Currently, `config:import` runs on every deployment. | ||
| - **Efficiency**: Drush first checks for differences. If no configuration files have changed, the operation is very fast (seconds) and effectively skipped. | ||
| - **Scaling**: As the site grows, if deployment times become a concern, we may strictly separate code deployment from configuration updates by moving `config:import` to a separate, manually triggered GitHub Action or Makefile target. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Deny all requests from Apache 2.4+. | ||
| <IfModule mod_authz_core.c> | ||
| Require all denied | ||
| </IfModule> | ||
|
|
||
| # Deny all requests from Apache 2.0-2.2. | ||
| <IfModule !mod_authz_core.c> | ||
| Deny from all | ||
| </IfModule> | ||
|
|
||
| # Turn off all options we don't need. | ||
| Options -Indexes -ExecCGI -Includes -MultiViews | ||
|
|
||
| # Set the catch-all handler to prevent scripts from being executed. | ||
| SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 | ||
| <Files *> | ||
| # Override the handler again if we're run later in the evaluation list. | ||
| SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 | ||
| </Files> | ||
|
|
||
| # If we know how to do it safely, disable the PHP engine entirely. | ||
| <IfModule mod_php.c> | ||
| php_flag engine off | ||
| </IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| _core: | ||
| default_config_hash: jvTSppzcgH5wnzBhX5xnAExcp2I1CzkQ_aky65XNfYI | ||
| menu_depth: 4 | ||
| hoverintent_behavior: | ||
| enabled: true | ||
| timeout: 500 | ||
| enable_toggle_shortcut: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| _core: | ||
| default_config_hash: fUksROt4FfkAU9BV4hV2XvhTBSS2nTNrZS4U7S-tKrs | ||
| interval: 10800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| uuid: 84fda1cc-591f-47fd-8e69-e1471bd8b104 | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| module: | ||
| - system | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: NjcxOBrPOiK5-38t56DwFBDVY4yer7YSlbRWXFuHe7A | ||
| id: claro_breadcrumbs | ||
| theme: claro | ||
| region: breadcrumb | ||
| weight: 0 | ||
| provider: null | ||
| plugin: system_breadcrumb_block | ||
| settings: | ||
| id: system_breadcrumb_block | ||
| label: Breadcrumbs | ||
| label_display: '0' | ||
| provider: system | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| uuid: 3f5566f1-f8b7-4174-97d8-6aba732fd169 | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| module: | ||
| - system | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: a0Yyx1GeyKarZ4T_yXQBR_ZFKnXiFLtxAb6gWLd8nr0 | ||
| id: claro_content | ||
| theme: claro | ||
| region: content | ||
| weight: 0 | ||
| provider: null | ||
| plugin: system_main_block | ||
| settings: | ||
| id: system_main_block | ||
| label: 'Main page content' | ||
| label_display: '0' | ||
| provider: system | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| uuid: 71721130-266c-4e4e-bdec-1d26eecc613e | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| module: | ||
| - help | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: jccFSSVqV0WCDb6NtML1VWAWTtDbZ-zn5YgTRMgMrIM | ||
| id: claro_help | ||
| theme: claro | ||
| region: help | ||
| weight: 0 | ||
| provider: null | ||
| plugin: help_block | ||
| settings: | ||
| id: help_block | ||
| label: Help | ||
| label_display: '0' | ||
| provider: help | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| module: | ||
| - search | ||
| - system | ||
| theme: | ||
| - claro | ||
| enforced: | ||
| config: | ||
| - search.page.help_search | ||
| id: claro_help_search | ||
| theme: claro | ||
| region: help | ||
| weight: -4 | ||
| provider: null | ||
| plugin: search_form_block | ||
| settings: | ||
| id: search_form_block | ||
| label: 'Search help' | ||
| label_display: visible | ||
| provider: search | ||
| page_id: help_search | ||
| visibility: | ||
| request_path: | ||
| id: request_path | ||
| negate: false | ||
| context_mapping: { } | ||
| pages: /admin/help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| uuid: e39f9d58-dd8e-48e9-b05b-727c80df495a | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: CdXfDmRgAvms7EQovxxWPdYi0GitxeRbVtScYK16ZH0 | ||
| id: claro_local_actions | ||
| theme: claro | ||
| region: content | ||
| weight: -10 | ||
| provider: null | ||
| plugin: local_actions_block | ||
| settings: | ||
| id: local_actions_block | ||
| label: 'Primary admin actions' | ||
| label_display: '0' | ||
| provider: core | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| uuid: 4da8a50a-ffc0-4443-beec-7c87b8984114 | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| module: | ||
| - system | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: '-Ac3ISpIT0PQ-whzD7_dw0SdKi6dAbRFNWdSjOiVDqg' | ||
| id: claro_messages | ||
| theme: claro | ||
| region: highlighted | ||
| weight: 0 | ||
| provider: null | ||
| plugin: system_messages_block | ||
| settings: | ||
| id: system_messages_block | ||
| label: 'Status messages' | ||
| label_display: '0' | ||
| provider: system | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| uuid: 6985e74a-9571-4ecd-bc73-097d5f35f7ca | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: fNwDdW063tk_ktzSWzZVeQS9wzvLooVO280BQ9WrsIs | ||
| id: claro_page_title | ||
| theme: claro | ||
| region: header | ||
| weight: -30 | ||
| provider: null | ||
| plugin: page_title_block | ||
| settings: | ||
| id: page_title_block | ||
| label: 'Page title' | ||
| label_display: '0' | ||
| provider: core | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| uuid: 7b2c68bd-2790-4e8c-be01-2759dbdf24c0 | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: ACjBZI5shAMiiUpsz-inLYVXDqNNXRnSzAWV3kV_8Hw | ||
| id: claro_primary_local_tasks | ||
| theme: claro | ||
| region: header | ||
| weight: 0 | ||
| provider: null | ||
| plugin: local_tasks_block | ||
| settings: | ||
| id: local_tasks_block | ||
| label: 'Primary tabs' | ||
| label_display: '0' | ||
| provider: core | ||
| primary: true | ||
| secondary: false | ||
| visibility: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| uuid: 4802883d-3eea-45a6-9a28-5fd3c0ef2d97 | ||
| langcode: en-gb | ||
| status: true | ||
| dependencies: | ||
| theme: | ||
| - claro | ||
| _core: | ||
| default_config_hash: 2L0geP-ixCbCkEpW6BVF6H7vDUZN4ea07_Y9CociQm4 | ||
| id: claro_secondary_local_tasks | ||
| theme: claro | ||
| region: pre_content | ||
| weight: 0 | ||
| provider: null | ||
| plugin: local_tasks_block | ||
| settings: | ||
| id: local_tasks_block | ||
| label: 'Secondary tabs' | ||
| label_display: '0' | ||
| provider: core | ||
| primary: false | ||
| secondary: true | ||
| visibility: { } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that this process is configured to import configuration changes only into the staging/production databases, and not into the local database?
If that is true, we need a way to import `/config' pulled from the PR into the local Db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most likely this was the reason, I have updated the local config path so it should not pick up the tracked config