Skip to content

Commit 04caee8

Browse files
Merge pull request #857 from City-of-Helsinki/ASU-1793
ASU-1793: replace ElasticSearch with HTTPS REST API
2 parents e6e8c6e + 563f0f9 commit 04caee8

67 files changed

Lines changed: 8836 additions & 2441 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ jobs:
6969
- name: Install Drupal
7070
run: |
7171
mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A < latest.sql
72+
# The DB dump can occasionally contain an invalid view config row with
73+
# an empty ID (config name "views.view." or other malformed variants).
74+
# That breaks Drupal core's
75+
# block_content post-update which iterates all views and expects every
76+
# view entity to have a non-empty ID.
77+
mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A -e "DELETE FROM config WHERE name = 'views.view.';"
78+
drush php:eval '$storage = \Drupal::service("config.storage"); foreach ($storage->listAll("views.view.") as $name) { $data = $storage->read($name); if (empty($data["id"])) { $storage->delete($name); } }'
79+
# deploy runs updatedb before cim; overlay sync first so DB matches
80+
# conf/cmi (e.g. views without deprecated plugins) before post-updates.
81+
drush cim -y --partial
7282
drush deploy
7383
7484
- name: Start services

.github/workflows/update-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
run: |
4747
composer install --no-interaction
4848
$(drush sql:connect) < latest.sql
49+
# The DB dump can occasionally contain an invalid view config row with
50+
# an empty ID (config name "views.view." or other malformed variants).
51+
# Remove it before running updates that iterate over all view entities.
52+
drush sql:query "DELETE FROM config WHERE name = 'views.view.';"
53+
drush php:eval '$storage = \Drupal::service("config.storage"); foreach ($storage->listAll("views.view.") as $name) { $data = $storage->read($name); if (empty($data["id"])) { $storage->delete($name); } }'
4954
drush cim -y && drush updb -y && drush cr
5055
composer update drupal/helfi_* drupal/hdbt* -W --no-interaction
5156
drush cr

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Ignore OAuth keys
2+
/keys
3+
*.key
4+
keys/*
5+
16
# Ignore project files that should not be in version control
27
drush/sites/
38
drush/Commands/*

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This is an **Open Source Drupal project**. It serves as the content management s
99
* **External Integrations:** Connects to a Django microservice for specific logic.
1010
* agent skills are located in the `.agents/skills/` directory
1111

12+
## General directives
13+
- **always write tests first** and then pause to give the human in the loop time to inspect them
14+
- dont say "Next I'll..." and wait for prompt, just keep going until the task is complete
15+
- dont use git to make commits or push
16+
1217
## Security & Sensitive Data
1318
**STRICT RULE:** This is a public repository.
1419
* **NEVER** output or suggest code containing real secrets, passwords, API keys, or tokens.
@@ -46,6 +51,7 @@ The project runs inside Docker containers.
4651
* Run `make lint-drupal` to verify code style.
4752
* If linting errors occur, fix them before finalizing the solution.
4853
* Run tests with `docker exec asuntotuotanto-app sh -c "composer test-php public/modules/custom"`
54+
* run `docker exec asuntotuotanto-app sh -c "drush cr"` to verify nothing is broken
4955
5056
## Architecture Notes
5157
* **Django Microservice:** Be aware that complex business logic regarding application handling may reside in the connected Django microservice, not within Drupal.

compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ services:
3030
DRUPAL_VARNISH_PORT: 6081
3131
REDIS_HOST: redis
3232
ASU_ASUNTOTUOTANTO_URL: "https://asuntotuotanto.docker.so"
33+
ASU_REST_API_CACHE_MAX_AGE: "${ASU_REST_API_CACHE_MAX_AGE:-300}"
3334
networks:
3435
- internal
3536
- stonehenge-network

composer.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"drupal/config_filter": "^2.7",
2424
"drupal/config_terms": "^1.9",
2525
"drupal/context": "^5.0@RC",
26-
"drupal/core": "~11.2.0",
27-
"drupal/core-composer-scaffold": "~11.2.0",
28-
"drupal/core-recommended": "~11.2.0",
26+
"drupal/consumers": "^1.24",
27+
"drupal/core": "~11.3.7",
28+
"drupal/core-composer-scaffold": "~11.3.7",
29+
"drupal/core-recommended": "~11.3.7",
2930
"drupal/ctools": "^4.1",
3031
"drupal/default_content": "^2.0@alpha",
3132
"drupal/email_registration": "^1.4",
@@ -42,7 +43,7 @@
4243
"drupal/hdbt_admin": "^3.4",
4344
"drupal/helfi_api_base": "^2.8",
4445
"drupal/helfi_azure_fs": "^2.2",
45-
"drupal/helfi_platform_config": "^5.0",
46+
"drupal/helfi_platform_config": "^5.1",
4647
"drupal/helfi_tunnistamo": "^3.1",
4748
"drupal/honeypot": "^2.2",
4849
"drupal/imagemagick": "^4.0",
@@ -70,6 +71,7 @@
7071
"drupal/route_condition": "^2.0",
7172
"drupal/samlauth": "^3.13",
7273
"drupal/siteimprove": "^3.0",
74+
"drupal/simple_oauth": "5.2.5",
7375
"drupal/slick": "^3.0",
7476
"drupal/symfony_mailer_lite": "^2.0",
7577
"drupal/tfa": "^1.12",
@@ -86,16 +88,19 @@
8688
"mglaman/composer-drupal-lenient": "^1.0",
8789
"onelogin/php-saml": "^4.3",
8890
"robrichards/xmlseclibs": "^3.1.5",
91+
"psr/http-message": "^1.1",
92+
"steverhoades/oauth2-openid-connect-server": "^2.6.1",
8993
"zaporylie/composer-drupal-optimizations": "^1.2"
9094
},
9195
"require-dev": {
9296
"behat/mink": "^1.11",
9397
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
9498
"drupal/coder": "^8.3",
99+
"drupal/core-dev": "~11.3.7",
95100
"drupal/devel": "^5.0",
96101
"mikey179/vfsstream": "^1.6",
97102
"phpspec/prophecy-phpunit": "^2",
98-
"phpunit/phpunit": "^10.5",
103+
"phpunit/phpunit": "^11.5",
99104
"rector/rector": "^1.2",
100105
"weitzman/drupal-test-traits": "^2.0"
101106
},
@@ -164,8 +169,11 @@
164169
"patches": {
165170
"drupal/helfi_platform_config": {
166171
"Catch exception during hero paragraphs update": "patches/helfi_platform_config_hero_paragraph_fix.patch",
167-
"Skip update_9400 on Drupal 11 (HAL/RDF modules removed)": "patches/helfi_platform_config-d11-update-9400.patch",
168-
"Make update_9328 idempotent when status field is already deleting/purging": "patches/helfi_platform_config-update-9328-idempotent.patch"
172+
"Skip update_9400 on Drupal 11 (HAL/RDF modules removed)": "patches/helfi_platform_config-d11-update-9400.patch"
173+
},
174+
"drupal/simple_oauth": {
175+
"[D11] Allow installing simple_oauth 5.x on Drupal 11": "patches/simple_oauth-drupal11-core-version.patch",
176+
"[D11] Fix simple_oauth normalizer signatures for Symfony 7": "patches/simple_oauth-symfony7-normalizer-signatures.patch"
169177
},
170178
"drupal/config_terms": {
171179
"Drupal 11 compatibility fixes": "https://www.drupal.org/files/issues/2024-06-02/config_terms.1.x-dev.rector.patch"
@@ -174,12 +182,7 @@
174182
"Drupal 11 compatibility fixes": "patches/computed_field_plugin-d11.patch"
175183
},
176184
"drupal/core": {
177-
"[#UHF-12709] Patch 'Deleted and replaced ...' error messages": "patches/uhf-12709-skip-deleted-log.patch",
178-
"[#3452852] Add create() factory method with autowired parameters to PluginBase": "patches/3452852.patch",
179-
"[D11] Skip delete when config entity missing": "patches/core-import-delete-null.patch",
180-
"[D11] Skip delete in checkOp when entity missing": "patches/core-config-importer-null-entity.patch",
181-
"[D11] Skip countFieldData when table missing": "patches/core-count-field-data-missing-table.patch",
182-
"[D11] Skip delete when field table missing": "patches/core-skip-delete-missing-field-table.patch"
185+
"[CI] Unset foreach-by-ref in ViewsConfigUpdater (block_content post_update save)": "patches/core-views-foreach-reference-cleanup.patch"
183186
},
184187
"drupal/elasticsearch_connector": {
185188
"Use Search API field identifier in FilterBuilder": "patches/elasticsearch_connector-filterbuilder-use-field-identifier.patch"
@@ -196,6 +199,7 @@
196199
"drupal/config_terms",
197200
"drupal/computed_field_plugin",
198201
"drupal/big_pipe_sessionless",
202+
"drupal/simple_oauth",
199203
"doctrine/annotations"
200204
]
201205
}

0 commit comments

Comments
 (0)