Skip to content

Commit a875fa9

Browse files
Merge pull request #77 from adam-vessey/fix/config-enforcement
Sunsetting: Remove config enforcement, and post-update hook to do so for existing sites
2 parents 443fca7 + d252083 commit a875fa9

26 files changed

+380
-71
lines changed

.github/workflows/build-3.x.yml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the target branch
8+
push:
9+
branches: [ 3.x ]
10+
pull_request:
11+
branches: [ 3.x ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
build:
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
php-versions: ["7.4", "8.0", "8.1"]
26+
drupal-version: ["9.3.x", "9.4.x", "9.5.x-dev"]
27+
mysql: ["8.0"]
28+
include:
29+
- allowed_failure: "false"
30+
- php-versions: "8.1"
31+
allowed_failure: "true"
32+
33+
name: PHP ${{ matrix.php-versions }} | drupal ${{ matrix.drupal-version }} | mysql ${{ matrix.mysql }}
34+
services:
35+
mysql:
36+
image: mysql:${{ matrix.mysql }}
37+
env:
38+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
39+
MYSQL_DATABASE: drupal
40+
ports:
41+
- 3306:3306
42+
activemq:
43+
image: webcenter/activemq:5.14.3
44+
ports:
45+
- 8161:8161
46+
- 61616:61616
47+
- 61613:61613
48+
49+
# Steps represent a sequence of tasks that will be executed as part of the job
50+
steps:
51+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
52+
- name: Checkout code
53+
uses: actions/checkout@v2
54+
with:
55+
path: build_dir
56+
57+
- name: Checkout islandora_ci
58+
uses: actions/checkout@v2
59+
with:
60+
repository: islandora/islandora_ci
61+
ref: github-actions
62+
path: islandora_ci
63+
64+
- name: Setup PHP
65+
uses: shivammathur/setup-php@v2
66+
with:
67+
php-version: ${{ matrix.php-versions }}
68+
tools: composer:v2
69+
70+
- name: Setup Mysql client
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get remove -y mysql-client mysql-common
74+
sudo apt-get install -y mysql-client
75+
76+
- name: Update Packages
77+
run: |
78+
sudo apt-get update
79+
80+
- name: Set environment variables
81+
run: |
82+
echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV
83+
echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV
84+
echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV
85+
echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV
86+
87+
- name: Cache Composer dependencies
88+
uses: actions/cache@v2
89+
with:
90+
path: /tmp/composer-cache
91+
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
92+
93+
- name: Setup Drupal
94+
run: |
95+
mkdir $DRUPAL_DIR
96+
$SCRIPT_DIR/travis_setup_drupal.sh
97+
cd $DRUPAL_DIR
98+
chmod -R u+w web/sites/default
99+
mkdir -p web/sites/simpletest/browser_output
100+
continue-on-error: ${{ matrix.allowed_failure }}
101+
102+
- name: Setup composer paths
103+
run: |
104+
git -C "$GITHUB_WORKSPACE/build_dir" checkout -b github-testing
105+
cd $DRUPAL_DIR
106+
composer config repositories.local path "$GITHUB_WORKSPACE/build_dir"
107+
composer config minimum-stability dev
108+
composer require "islandora/islandora:^2"
109+
composer require "drupal/search_api_solr:^4.1"
110+
composer require "islandora/islandora_defaults:dev-github-testing as 3.x-dev" --prefer-source -W
111+
112+
- name: Install modules
113+
run: |
114+
cd $DRUPAL_DIR/web
115+
drush --uri=127.0.0.1:8282 en -y islandora_audio islandora_breadcrumbs islandora_iiif islandora_image islandora_video islandora_text_extraction_defaults islandora_search
116+
drush --uri=127.0.0.1:8282 fim -y islandora_core_feature,islandora_text_extraction_defaults,islandora_defaults,islandora_search
117+
118+
119+
- name: Test scripts
120+
run: $SCRIPT_DIR/travis_scripts.sh
121+

README.md

+196-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,201 @@
66

77
## Future Development
88

9-
Islandora Defaults is no longer under active development. Its core purpose is being superceded by a project to create an example Starter Site. You can read the announcement [here](https://groups.google.com/u/1/g/islandora/c/uGzhTnW4TUI).
9+
Islandora Defaults is no longer under active development, and is being deprecated. Its core purpose is being (and has been) superseded by a project to create an example Starter Site, which [exists in the `islandora-starter-site` repository](https://github.com/Islandora/islandora-starter-site). You can read the announcement [here](https://groups.google.com/u/1/g/islandora/c/uGzhTnW4TUI).
10+
11+
### Deprecation/Removal Preparation
12+
13+
To ease the removal of this module from existing installations, we have implemented a post-update hook which should remove any references to this module from configuration entities that it installed. To make use of it, it should be sufficient to update to the `islandora/islandora_defaults` package in your Drupal project such that it includes the new hook, and to run it. On the CLI, this might be effected as something like:
14+
15+
```bash
16+
# Navigate to the root of your Composer project; for example:
17+
cd /var/www/html/drupal
18+
19+
# Update islandora/islandora_defaults such that it has the post-update hooks
20+
# available. Presently anticipating a "3.0.1" release to which it should update.
21+
composer require "islandora/islandora_defaults:^3"
22+
# A caveat exists in that, if `islandora/islandora_defaults` is required by any
23+
# other Composer package, then those packages may have to be updated first; for
24+
# example, it is known that there exist Drupal installation profiles that
25+
# specify a dependency on `islandora/islandora_defaults` (such as https://github.com/Islandora-Devops/islandora_install_profile_demo/blob/181a53bb230d7ced6e70e7746f0da567216ebbf7/composer.json#L157),
26+
# which would likely have to receive a treatment to strip out any references
27+
# from their configurations which explicitly bind to `islandora_defaults`
28+
# similar to our update hook, and to include updated requirements accordingly
29+
# in the root Composer project.
30+
31+
# Clear cache (paranoia; to ensure the update hooks are appropriately
32+
# discovered).
33+
drush cr
34+
35+
# Run the update hook.
36+
drush updb
37+
38+
# Now that our config entities should stay behind, the module itself should be
39+
# fine to be uninstalled. Note that this should/may also result in the
40+
# uninstallation of the islandora_oaipmh and islandora_search modules; though,
41+
# the configurations they included should remain in the system.
42+
drush pm-uninstall islandora_defaults
43+
44+
# Perform a dry-run removal to list out all that would be removed, when
45+
# islandora/islandora_defaults is removed, as some modules may only be included
46+
# transitively.
47+
composer remove --dry-run islandora/islandora_defaults
48+
49+
# Add back some of the modules that might just be included in the project
50+
# transitively, for example:
51+
composer require "drupal/field_group:^3" "drupal/field_permissions:^1" \
52+
"islandora/controlled_access_terms:^2" "islandora/islandora_mirador:^2"
53+
# However, in the event that you indeed are not using some of these modules, you
54+
# might instead proceed to ensure that they are uninstalled from Drupal, similar
55+
# to the "drush pm-uninstall" invocation above. For the version specs to use, it
56+
# may be useful to refer to what the our `composer.json` specifies.
57+
58+
# Remove the package from the project entirely.
59+
composer remove islandora/islandora_defaults
60+
61+
# Clear the caches, for cleanup/paranoia.
62+
drush cr
63+
64+
# Restart your webserver to register the movement of islandora_mirador from
65+
# submodule to a module in its own right; otherwise, caching of class
66+
# definitions might lead to errors. The command might look something like:
67+
sudo systemctl restart apache2
68+
```
69+
70+
<details>
71+
<summary>With output in context, what this might look like</summary>
72+
73+
This was executed on a revived `standard` instance of `islandora-playbook`, with
74+
some very minor preparation to work around the fact that the update hook code
75+
did not yet exist in released code (and so had to point at the development
76+
branch (`dev-fix/config-enforcement`) and made use of aliases accordingly (
77+
`[...] as 3.x-dev`)). When running post-release, the version spec `^3` should be
78+
able to be used instead.
79+
80+
```
81+
vagrant@islandora8:~$ cd /var/www/html/drupal
82+
vagrant@islandora8:/var/www/html/drupal$ composer require "islandora/islandora_defaults:dev-fix/config-enforcement as 3.x-dev"
83+
./composer.json has been updated
84+
Running composer update islandora/islandora_defaults
85+
Loading composer repositories with package information
86+
Info from https://repo.packagist.org: #StandWithUkraine
87+
Updating dependencies
88+
Lock file operations: 1 install, 1 update, 0 removals
89+
- Upgrading islandora/islandora_defaults (2.1.1 => dev-fix/config-enforcement dac37d2)
90+
- Locking islandora/islandora_mirador (2.2.1)
91+
Writing lock file
92+
Installing dependencies from lock file (including require-dev)
93+
Package operations: 1 install, 1 update, 0 removals
94+
- Downloading islandora/islandora_mirador (2.2.1)
95+
- Downloading islandora/islandora_defaults (dev-fix/config-enforcement dac37d2)
96+
- Installing islandora/islandora_mirador (2.2.1): Extracting archive
97+
- Upgrading islandora/islandora_defaults (2.1.1 => dev-fix/config-enforcement dac37d2): Extracting archive
98+
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
99+
Package silex/silex is abandoned, you should avoid using it. Use symfony/flex instead.
100+
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
101+
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
102+
Generating autoload files
103+
68 packages you are using are looking for funding.
104+
Use the `composer fund` command to find out more!
105+
No security vulnerability advisories found
106+
vagrant@islandora8:/var/www/html/drupal$ drush cr
107+
[warning] Illegal string offset 'label' OaiPmh.php:116
108+
[warning] Illegal string offset 'value' OaiPmh.php:116
109+
[warning] Illegal string offset 'label' OaiPmh.php:116
110+
[warning] Illegal string offset 'value' OaiPmh.php:116
111+
[success] Cache rebuild complete.
112+
vagrant@islandora8:/var/www/html/drupal$ drush updb
113+
-------------------- ------------- ------------- ---------------------------
114+
Module Update ID Type Description
115+
-------------------- ------------- ------------- ---------------------------
116+
islandora_defaults remove_enfo post-update Remove "enforced"
117+
rced_depend dependency on this module
118+
ency from installed config.
119+
-------------------- ------------- ------------- ---------------------------
120+
121+
122+
Do you wish to run the specified pending updates? (yes/no) [yes]:
123+
>
124+
125+
> [notice] Update started: islandora_defaults_post_update_remove_enforced_dependency
126+
> [notice] Update completed: islandora_defaults_post_update_remove_enforced_dependency
127+
> [warning] Illegal string offset 'label' OaiPmh.php:116
128+
> [warning] Illegal string offset 'value' OaiPmh.php:116
129+
> [warning] Illegal string offset 'label' OaiPmh.php:116
130+
> [warning] Illegal string offset 'value' OaiPmh.php:116
131+
[success] Finished performing updates.
132+
vagrant@islandora8:/var/www/html/drupal$ drush pm-uninstall islandora_defaults
133+
The following extensions will be uninstalled: islandora_defaults, islandora_oaipmh, islandora_search
134+
135+
Do you want to continue? (yes/no) [yes]:
136+
>
137+
138+
[warning] Illegal string offset 'label' OaiPmh.php:116
139+
[warning] Illegal string offset 'value' OaiPmh.php:116
140+
[warning] Illegal string offset 'label' OaiPmh.php:116
141+
[warning] Illegal string offset 'value' OaiPmh.php:116
142+
[success] Successfully uninstalled: islandora_defaults, islandora_oaipmh, islandora_search
143+
vagrant@islandora8:/var/www/html/drupal$ composer require "drupal/field_group:^3" "drupal/field_permissions:^1" "islandora/controlled_access_terms:^2" "islandora/islandora_mirador:^2"
144+
./composer.json has been updated
145+
Running composer update drupal/field_group drupal/field_permissions islandora/controlled_access_terms islandora/islandora_mirador
146+
Loading composer repositories with package information
147+
Updating dependencies
148+
Nothing to modify in lock file
149+
Installing dependencies from lock file (including require-dev)
150+
Package operations: 0 installs, 0 updates, 0 removals
151+
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
152+
Package silex/silex is abandoned, you should avoid using it. Use symfony/flex instead.
153+
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
154+
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
155+
Generating autoload files
156+
68 packages you are using are looking for funding.
157+
Use the `composer fund` command to find out more!
158+
No security vulnerability advisories found
159+
vagrant@islandora8:/var/www/html/drupal$ composer remove islandora/islandora_defaults
160+
./composer.json has been updated
161+
Running composer update islandora/islandora_defaults
162+
Loading composer repositories with package information
163+
Updating dependencies
164+
Lock file operations: 0 installs, 0 updates, 1 removal
165+
- Removing islandora/islandora_defaults (dev-fix/config-enforcement dac37d2)
166+
Writing lock file
167+
Installing dependencies from lock file (including require-dev)
168+
Package operations: 0 installs, 0 updates, 1 removal
169+
- Removing islandora/islandora_defaults (dev-fix/config-enforcement dac37d2)
170+
Deleting web/modules/contrib/islandora_defaults - deleted
171+
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
172+
Package silex/silex is abandoned, you should avoid using it. Use symfony/flex instead.
173+
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
174+
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
175+
Generating autoload files
176+
68 packages you are using are looking for funding.
177+
Use the `composer fund` command to find out more!
178+
No security vulnerability advisories found
179+
vagrant@islandora8:/var/www/html/drupal$ drush cr
180+
[warning] Illegal string offset 'label' OaiPmh.php:116
181+
[warning] Illegal string offset 'value' OaiPmh.php:116
182+
[warning] Illegal string offset 'label' OaiPmh.php:116
183+
[warning] Illegal string offset 'value' OaiPmh.php:116
184+
[success] Cache rebuild complete.
185+
vagrant@islandora8:/var/www/html/drupal$ sudo systemctl restart apache2
186+
vagrant@islandora8:/var/www/html/drupal$
187+
```
188+
189+
The warnings:
190+
191+
```
192+
[warning] Illegal string offset 'label' OaiPmh.php:116
193+
[warning] Illegal string offset 'value' OaiPmh.php:116
194+
```
195+
196+
... are from `islandora_defaults` shipping configuration for an older schema
197+
([commit which changed it](https://git.drupalcode.org/project/rest_oai_pmh/-/commit/784d827eb77cd2513b66054b31b7dfae54f469c2))
198+
of the [REST OAI-PMH module](https://www.drupal.org/project/rest_oai_pmh), of
199+
which it is outside the scope of present efforts to address.
200+
201+
</details>
202+
203+
---
10204

11205
## Introduction
12206

@@ -30,7 +224,7 @@ Further [documentation for this module](https://islandora.github.io/documentatio
30224

31225
## Troubleshooting/Issues
32226

33-
Having problems or solved a problem? Check out the Islandora google groups for a solution.
227+
Having problems or solved a problem? Check out the Islandora Google Groups for a solution.
34228

35229
* [Islandora Group](https://groups.google.com/forum/?hl=en&fromgroups#!forum/islandora)
36230

config/install/context.context.binary.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
langcode: en
22
status: true
33
dependencies:
4-
enforced:
5-
module:
6-
- islandora_defaults
74
module:
85
- islandora
96
name: binary

config/install/context.context.collection.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
langcode: en
22
status: true
33
dependencies:
4-
enforced:
5-
module:
6-
- islandora_defaults
74
module:
85
- islandora
96
name: collection

config/install/context.context.repository_content.yml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ dependencies:
44
module:
55
- islandora
66
- node
7-
enforced:
8-
module:
9-
- islandora_defaults
107
label: Content
118
name: repository_content
129
group: Indexing

config/install/context.context.taxonomy_terms.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
langcode: en
22
status: true
33
dependencies:
4-
enforced:
5-
module:
6-
- islandora_defaults
74
module:
85
- islandora
96
name: taxonomy_terms

config/install/core.entity_form_display.node.islandora_object.default.yml

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ dependencies:
4747
- field.field.node.islandora_object.field_temporal_subject
4848
- field.field.node.islandora_object.field_weight
4949
- node.type.islandora_object
50-
enforced:
51-
module:
52-
- islandora_defaults
5350
module:
5451
- controlled_access_terms
5552
- field_group

config/install/core.entity_view_display.media.file.open_seadragon.yml

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ dependencies:
1010
- field.field.media.file.field_mime_type
1111
- field.field.media.file.field_original_name
1212
- media.type.file
13-
enforced:
14-
module:
15-
- islandora_defaults
1613
module:
1714
- openseadragon
1815
id: media.file.open_seadragon

0 commit comments

Comments
 (0)